Skeleton of automatic connections driven by platform/user event.
Two layers will manage connections: Profiles can request on demand
connections registering ATTIO connection callbacks(one attempt) for
a given device and platform/user action can trigger automatic
connections for devices with ATTIO callbacks registered.
Removes continuous timer for ATTIO connection attempts. A new approach
is being implemented managing scanning and connection attempts driven
by platform/user actions. eg: screen unlocked.
Device object may exist but control wont be initialized causing the
following crash:
Invalid read of size 8
at 0x12B510: state_changed (control.c:90)
by 0x12BA20: avctp_set_state (avctp.c:367)
by 0x12C0DC: avctp_confirm_cb (avctp.c:733)
by 0x166481: server_cb (btio.c:200)
by 0x4E75ADC: g_main_context_dispatch (in /lib64/libglib-2.0.so.0.3000.0)
by 0x4E762D7: ??? (in /lib64/libglib-2.0.so.0.3000.0)
by 0x4E76824: g_main_loop_run (in /lib64/libglib-2.0.so.0.3000.0)
by 0x11ED19: main (main.c:473)
Address 0x8 is not stack'd, malloc'd or (recently) free'd
BlueZ will act as GAP central role, so for outgoing connections the
central is responsible for disconnecting the link. This patch adds
a function allowing the central to detach from the local attribute
server(removing the last GAttrib reference).
If CT tries to change an Application Setting providing only one
setting, the size of the PDU will be 3 bytes. Therefore we should check
if the PDU is shorter than or equal 3, not only shorter.
If media attribute is not available for a certain media file, return an
empty string instead of rejecting the request. The spec is not so clear
if only the title should be handled as an empty string when not present,
but this is the only alternative to rejecting the request.
IOP tests showed that some CT devices don't like reject messages: they
never ask for an attribute again if they previously received a REJECTED
message for that attribute. They consider REJECTED as "TG doesn't
implement it these optional attributes" as opposed to what we had
before, "this attribute is currently not available".
A bogus (or hostile) Proximity Reporter device may send a TX Power value
bigger than the buffer used. Therefore, create a temporary buffer with
the maximum size, and check for the length before using the value.
Note that all other current users of the dec_read_resp() already do
this. Another option would be to change dec_read_resp() to accept a
buffer length, but this would break external code, so it is avoided for
now.
This identifiers can be used by applications to implements quirks which
seems to be very common in some profiles such as syncml and since this
information is already stored permanently we can quickly retrieve it
without having to connect or parse the records again.
Check on active call is added for playing of DTMF feedback tones to
notify user. Network DTMF tones are handled by modem, and therefore
there is no need in special check for those.
StartEventTone and StopTone method calls to tone generator are added
to maemo6 telephony driver. Such implements playback of DTMF tones
in handsfree to notify user.
SendDTMF method call is replaced by StartDTMF/StopDTMF in maemo6 telephony
driver. StartDTMF/StopDTMF places DTMF tone in queue on modem side playing
it minimum required time. When using SendDTMF, modem ignores new tone
until currently playing one is not finished.
Downside of StartDTMF/StopDTMF combination is absence of audio feedback to
hands-free.
AVRCP is an extension of AV/C spec which has a limit of 512 bytes. The
only place where it can exceed this value is in the response to
GetElementAttributes command.
Now we simply don't add the attributes that would overflow the available
buffer space.
If adapter has more than one sdp session active find_by_bdaddr always
return the first one regardless if the device address match or not
which leads to the following crash:
Invalid read of size 4
at 0x16CB31: search_cb (in /usr/sbin/bluetoothd)
by 0x15C0CA: connect_watch (in /usr/sbin/bluetoothd)
by 0x48CFD37: g_io_unix_dispatch (in /usr/lib/libglib-2.0.so.0.2800.6)
by 0x488B4A0: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.2800.6)
by 0x488BCD0: g_main_context_iterate.clone.5 (in /usr/lib/libglib-2.0.so.0.2800.6)
by 0x488C3B8: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.2800.6)
by 0x152D09: main (in /usr/sbin/bluetoothd)
Address 0x4c8c600 is 16 bytes inside a block of size 48 free'd
at 0x48234A9: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
by 0x48920F0: g_free (in /usr/lib/libglib-2.0.so.0.2800.6)
by 0x16BDD3: browse_request_free (in /usr/sbin/bluetoothd)
by 0x16C7A2: browse_request_cancel (in /usr/sbin/bluetoothd)
Reported by Alberto José Rodríguez Rodríguez <ajrodriguez@blulabs.es>
When creating a new device, the UUIDs list is updated in the device
probing function. This patch moves the function call which emit the
signal after the device driver probing.
We need support for attaching a client connection to the attribute
server because the server that we are connected may want to do
something similar to a reverse service discovery, and we need to be
able to receive indications and notifications.
override speed setting if firmware script issues serial settings command,
otherwise the value given in the firmware script will be overridden.
Example:
hciattach /dev/ttyO1 texas 115200
will fail, because /dev/ttyO1 will be opened with 115200 b/s, then
the firmware script will set the buadrate to 3000000 b/s, after UART init
hciattach.c will set the baudrate to 115200, so communication is broken.
The only correct way is to set both speeds:
hciattach -s 115200 /dev/ttyO1 texas 3000000
With this patch only initial speed must be specified. The former semantic
will be preserved in case the firmware script doesn't provide serial
settings action.
Tested with wl1271 and firmware TIInit_7.2.31.bts
In case of incoming RFCOMM connection, manager calls
gateway_connect_rfcomm which already take reference to GIOChannel, hence
no need to take another one.
Make sure that state changes to disconnected on errors (authorization
refused, disconnect, sdp) This change will become necessary when
integrating the Audio interface which rely on state change to confirm
that connection has started successfully.