Commit Graph

9024 Commits

Author SHA1 Message Date
Claudio Takahasi
64e1a59a89 Add set auto connect in device
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.
2011-10-05 18:01:18 +03:00
Claudio Takahasi
d6e10cb567 Remove timer to trigger connection attempts
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.
2011-10-05 18:01:09 +03:00
Luiz Augusto von Dentz
90c9c7bb13 Fix crash when remote connects to AVRCP without having a record
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
2011-10-05 17:08:57 +03:00
Luiz Augusto von Dentz
2d4c58a760 Fix not being able to register pdu handlers
This happens when removing and adding again an adapter
2011-10-05 17:08:53 +03:00
Johan Hedberg
4cadf1d198 Fix missing initialization of A2DP error 2011-10-05 15:28:08 +03:00
Claudio Takahasi
6c729fd1ec Minor cleanup in attrib server channel disconnect 2011-10-05 11:16:24 +03:00
Claudio Takahasi
aa9e4e4b30 Add attrib server channel detach
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).
2011-10-05 11:16:20 +03:00
Claudio Takahasi
6baa6b0fb9 Emit LinkLossAlertLevel after writing the alert 2011-10-05 11:16:14 +03:00
Claudio Takahasi
f6daa9b4e3 Fix wrong write GATT-subprocedure for Link Loss
According to Link Loss Service specification, Write Characteristic
Value sub-procedure should be used to change the Alert Level.
2011-10-05 11:16:10 +03:00
Luiz Augusto von Dentz
e5753d8778 Fix regression when disconnecting AVRCP
This prevent to disconnect AVRCP when doing e.g. Audio.Disconnect
2011-10-03 18:00:20 +03:00
Lucas De Marchi
4d3bb39485 AVRCP: fix missing bytes on notification 2011-10-03 16:14:12 +03:00
Johan Hedberg
d9ae5bead2 Filter duplicates by default with hcitool lescan 2011-10-03 15:16:24 +03:00
Marcel Holtmann
1cf761e1db Update company identifiers 2011-10-02 19:40:25 -07:00
Frédéric Danis
355637a057 Fix Unref message after it was sent 2011-10-02 18:53:45 +03:00
Lucas De Marchi
4364aa411d AVRCP: fix changed notification
We sure want to send notifications only when section is not NULL.
Otherwise we either crash or do not send the expected notification.
2011-10-02 18:52:05 +03:00
Lucas De Marchi
8ebb3c79e1 AVRCP: fix case when only one setting is provided
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.
2011-10-02 18:48:06 +03:00
Lucas De Marchi
138f831787 AVRCP: return empty string instead of rejecting
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".
2011-10-02 18:47:58 +03:00
Anderson Lizardo
547f9e37b8 Fix memory corruption when decoding Read Response PDU
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.
2011-10-01 10:09:13 +03:00
Claudio Takahasi
3d6f41b498 Mention Andre's and Sheldon's contributions 2011-10-01 10:04:54 +03:00
Luiz Augusto von Dentz
42b90a434a Remove use of read_device_id in wiimote plugin
Make use of btd_device_get_vendor and btd_device_get_product intead.
2011-10-01 09:02:19 +03:00
Luiz Augusto von Dentz
73952ca597 Remove use of read_device_id in input plugin
Make use of btd_device_get_vendor, btd_device_get_product and
btd_device_get_version intead.
2011-10-01 09:02:12 +03:00
Luiz Augusto von Dentz
5600f99bd9 Print Vendor/Product/Version in hexadecimal
This is how their are more commonly known.
2011-10-01 09:02:05 +03:00
Luiz Augusto von Dentz
d1d4f1b2a6 Add Vendor, Product and Version properties to org.bluez.Device
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.
2011-10-01 09:01:52 +03:00
Dmitriy Paliy
b5dae52d36 Fix remove feedback DTMF tones timer on call release
User feedback DTMF tones queue is freed and timer removed when call
is released.
2011-09-27 16:41:11 +03:00
Dmitriy Paliy
4861017b1b Fix play DTMF feeback tones only for active call
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.
2011-09-27 16:41:09 +03:00
Dmitriy Paliy
5d9207acc1 Add playback of tones to handsfree
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.
2011-09-27 16:41:07 +03:00
Dmitriy Paliy
b48e610314 Fix error handling in start_dtmf_reply
If csd replyed with error to StartDTMF, then StopDTMF method call
is not sent.
2011-09-27 16:41:05 +03:00
Dmitriy Paliy
16af0ec65e Replace SendDTMF by StartDTMF/StopDTMF in maemo6
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.
2011-09-27 16:41:01 +03:00
Lucas De Marchi
6d0ec74904 AVRCP: limit AVRCP packet size to the MTU of AV/C
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.
2011-09-27 13:11:35 +03:00
Antti Julku
f8a44769ff Rename fast_connectable function in hciops
Rename fast_connectable function in hciops to set_fast_connectable
to make it consistent with rest of the file and with mgmt interface
counterpart.
2011-09-26 15:39:39 +03:00
Antti Julku
1dcd74358c Implement fast connectable mode for mgmt interface
Management interface implementation for fast connectable mode.
2011-09-26 15:39:36 +03:00
Claudio Takahasi
fa63522766 Fix test-proximity usage info 2011-09-24 13:12:10 +03:00
Frédéric Dalleau
3c78fa2f91 Minor style fix 2011-09-24 13:12:05 +03:00
Frédéric Dalleau
f245d02b7a Remove unneeded checks in gateway_is_connected 2011-09-24 13:12:03 +03:00
Frédéric Dalleau
9344ad5be8 Check all states before allowing gw connection 2011-09-24 13:12:00 +03:00
Luiz Augusto von Dentz
4af12dd50e Fix possible crash while removing a device
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>
2011-09-24 19:09:39 +09:00
Antti Julku
a09d1717e4 Add device blocking events to mgmt API documentation 2011-09-24 19:09:29 +09:00
Claudio Takahasi
390795c72b Fix Device UUIDs property list being sent empty
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.
2011-09-22 20:26:54 +09:00
Vinicius Costa Gomes
eb41b504d0 Fix the attrib server trying to handle responses
The attribute server should only try to handle ATT requests, responses
and events should be handled by the client.
2011-09-22 20:25:25 +09:00
Vinicius Costa Gomes
6184bc5911 Attrib server integration for outgoing connections
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.
2011-09-22 20:25:23 +09:00
Yegor Yefremov
2f440ad7b5 hciattach: fix serial speed setting for wl1271
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
2011-09-22 20:19:11 +09:00
Frédéric Dalleau
85d21c3ea5 Fix reference count issue in incoming connections
In case of incoming RFCOMM connection, manager calls
gateway_connect_rfcomm which already take reference to GIOChannel, hence
no need to take another one.
2011-09-22 20:10:28 +09:00
Frédéric Dalleau
dfea776a9c Set state to "connecting" on connection requested
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.
2011-09-22 20:10:17 +09:00
Frédéric Dalleau
f00fc7ae6d Fix state to "playing" on SCO establishment 2011-09-22 20:10:12 +09:00
Frédéric Dalleau
68119298ac Fix asynchronously run request stream cb
Cancel pending callback if stream is canceled Asynchronously run
gateway_config_stream cb Remove occurences of sco_start_cb
2011-09-22 20:10:05 +09:00
Frédéric Dalleau
1fcbc48066 Fix disconnect SCO at same time than RFCOMM
If RFCOMM disconnects, SCO should be disconnected too.
2011-09-22 20:08:23 +09:00
Dmitriy Paliy
98ee8c58f9 Fix freeing watches list in maemo6 telephony
This fixes regression introduced in 8306448148.
List watches has to be freed instead of list pending.
2011-09-22 20:05:15 +09:00
Bruna Moreira
d7925ed6c4 Add Phone Alert Server skeleton plugin 2011-09-22 20:05:06 +09:00
Anderson Lizardo
8f769e9565 Add GATT Time Server skeleton plugin 2011-09-22 20:05:04 +09:00
Anderson Lizardo
c703241170 Fix characteristic property on GATT example plugin
Any GATT characteristics which have a Client Characteristic
Configuration must have "Notify" property set.
2011-09-22 20:01:40 +09:00