Commit Graph

8671 Commits

Author SHA1 Message Date
Claudio Takahasi
b3ccd8541f Proximity API simplification
Delegates the Immediate Alert Level control to the caller(client).
Immediate Alert Service is shared between Path Loss and Find Me.

Three signal level states are defined: "good", "regular" and "weak".
Meaning that at least two thresholds are necessary to implement a
proper state transition. "unknown" will be returned if the link is not
active. For Path Loss, the logic to trigger the writting operation of
the Immediate Alert Level characteristic needs to be implemented in
the client. SignalLevel can be only one of the inputs to define when
and which value to write in the characteristic.
2011-08-02 16:48:49 +03:00
Claudio Takahasi
4528e82b65 Remove unneeded header includes in event.c 2011-08-02 10:53:41 +03:00
Claudio Takahasi
9c0c6b6b33 Remove unneeded textfile header includes 2011-08-02 10:53:38 +03:00
Marcel Holtmann
ad2952750a Release 4.96 2011-08-01 01:15:20 +02:00
Marcel Holtmann
b5ff279155 Update library version 2011-07-31 22:36:18 +02:00
Łukasz Stelmach
0065cf3be9 Fix off-by-one error in form factor detection
The keywords we are looking for are at odd positions.
2011-07-29 13:12:28 +03:00
Anderson Lizardo
facc0d862b Fix setting noinst_LIBRARIES in Makefile.am
When both audio and sap plugins are enabled, noinst_LIBRARIES is
incorrectly overwritten.
2011-07-29 13:07:36 +03:00
Andrei Emeltchenko
3c9698114e Add L2CAP EFS definitions
These are needed e.g. by hcidump.
2011-07-29 13:01:10 +03:00
Johan Hedberg
4c4c4e5917 Remove per-file author information
In the long run this information becomes a pain to maintain and it is
already covered by the AUTHORS file and the git commit history.
2011-07-29 12:52:58 +03:00
Santiago Carot-Nemesio
e8825b76fc Add thermometer driver skeleton 2011-07-29 12:50:35 +03:00
Santiago Carot-Nemesio
3e24f80260 Add manager files for HTP 2011-07-29 12:50:32 +03:00
Santiago Carot-Nemesio
67c15df485 Initial support for Health Thermometer Profile (HTP) 2011-07-29 12:50:30 +03:00
Dmitriy Paliy
2ed2c75c11 Fix adapter->global_mode updating in btd_adapter_switch_offline()
Currently, use of RequestSession and SetProperty adapter method
calls sets global_mode to on. Switching adapter off via plug-in
interface in this scenario releases all sessions, that, in turn,
restores adapter's state to global_mode, which is on.

Result is the adapter is switched off and immediately switched on.
This patch fixes such inconsistency by overwriting global_mode to
mode off when request comes from plug-in.
2011-07-29 12:13:24 +03:00
Arek Lichwa
de16dfe912 Fix memory leak in sap plugin
Without this patch, when dropping RFCOMM channel to sap server, the
component's channel cleanup process doesn't release assigned GIOChannel
resources since conn->io is set to NULL before calling sap_conn_remove
(which would normally do the g_io_channel_unref).
2011-07-28 10:48:44 +03:00
Tom Rini
c5d2a5e570 Makefile.am: Mark local_headers as BUILT_SOURCES
As these files are auto-generated they need to be marked as BUILT_SOURCES
so that we don't run into a build race later on.  lib/bluetooth is removed
by clean-local so this doesn't need to be in CLEAN_FILES
2011-07-28 00:42:17 +03:00
Johan Hedberg
d7f192abc0 Fix D-Bus error code for security mode 3 pairings
This patch makes sure that the HCI level status gets used to generate
the D-Bus error reply to Adapter.CreatePairedDevice.
2011-07-27 12:36:25 +03:00
Claudio Takahasi
3b876e47d5 Address remote initiated disconnection
Local initiated disconnection will be triggered when the last GAttrib
reference is dropped. For remote initiated disconnection it is necessary
to track the socket HUP registering disconnection GAttrib callback.
2011-07-27 10:41:51 +03:00
Claudio Takahasi
a45a05ce05 Postpone calling connected callback
In the ATT callbacks registration function, the connection callback should
not be called in the same main loop iteraction to avoid accessing not
initialized data in the profiles during probing.
2011-07-27 10:36:53 +03:00
Claudio Takahasi
608bc4a579 Manage GAttrib refs based on registered callbacks
Connection should not be dropped if there is at least one ATT connection
callback registered. After discovering primary services over the LE link,
GAttrib ref needs to be held to allow notifying an active connection
while registering connection callbacks(inside plugins probing).
2011-07-27 10:36:31 +03:00
Claudio Takahasi
b3eea75304 Add on demand characteristic write
Changes the Generic Attribute registering a callback to request ATT
connection(if necessary) and write the characteristic value.
2011-07-27 10:32:40 +03:00
Claudio Takahasi
a0988557ea On demand connection for characteristics discovery
In the Generic Attribute API, when DiscoverCharacteristics is called
ATT connection should be requested if the link is not up. A query
list is required to control when the link can be disconnected since
the discover finishes after receiving all caracteristic declarations.
2011-07-27 10:32:17 +03:00
Claudio Takahasi
3177d97eed Register ATT connection callback based on watchers
In the Generic Attribute API, the ATT connection should be requested
on demand. In the case of watchers, the connection doesn't need to be
stay up if there isn't watcher registered.
2011-07-27 10:32:01 +03:00
Claudio Takahasi
8fb640ef60 Change GAttrib ref counting in Generic Attribute 2011-07-27 10:31:30 +03:00
Claudio Takahasi
e4a3edb111 Remove implicit connection from generic API
Generic attribute API should not actively manage L2CAP connections.
GAttrib instance is notified through registered callbacks. SetProperty
or DiscoverCharacteristic now returns NotConnected error if the link
is down.
2011-07-27 10:31:15 +03:00
Claudio Takahasi
95bf1f076a Register the ATT connection callbacks
Registers the ATT connection and disconnection callbacks in the generic
attribute API. First commit to remove implicit L2CAP connection
establishment.
2011-07-27 10:30:55 +03:00
Claudio Takahasi
3b010c0a14 Cleanup of primary service structs
Get rid of local structure to store all GATT primary services of a
given device. "primary" struct has been renamed to "gatt_service"
to avoid misinterpretation or confusion with "att_primary".
2011-07-27 10:30:25 +03:00
Claudio Takahasi
27347f58bd Cleanup of primary service registration 2011-07-27 10:30:13 +03:00
Claudio Takahasi
cdeb4dab7d Remove leftover D-Bus message in gatt_service 2011-07-27 10:29:58 +03:00
Claudio Takahasi
c34ccee6b8 Remove storing device path in gatt_service 2011-07-27 10:29:29 +03:00
Claudio Takahasi
c7b1f0bb28 Remove not necessary data from gatt_service
Bluetooth source and destination address can be obtained from the
device object. GATT service doesn't need to keep these addresses.
2011-07-27 10:28:47 +03:00
Claudio Takahasi
82d4778b26 Fix typo in mgmt-api 2011-07-26 13:01:46 +03:00
Luiz Augusto von Dentz
e2482a5ee3 Fix removing inotify watch whenever an adapter is removed
This sometimes cause bluetoothd to burn cpu when an adapter is removed
from the system.

Since the watch is not really bond to any adapter, in fact it is added on
plugin .init, its removal is now moved to plugin .exit.
2011-07-26 12:59:54 +03:00
Luiz Augusto von Dentz
9a7e2cc81c Fix possible invalid read/free on manager.c
Invalid read of size 4
    at 0x178A20: adapter_get_address (string3.h:52)
    by 0x174C28: adapter_cmp (manager.c:324)
    by 0x4EA95B0: g_slist_find_custom (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x174ED9: manager_find_adapter (manager.c:333)
    by 0x16ABFA: sdp_record_remove (sdpd-database.c:270)
    by 0x16A4D6: remove_record_from_server (sdpd-service.c:286)
    by 0x12A947: avrcp_unregister (control.c:972)
    by 0x1208CC: avrcp_server_remove (manager.c:1066)
    by 0x4EA9826: g_slist_foreach (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x178985: adapter_remove (adapter.c:2326)
    by 0x4EA9826: g_slist_foreach (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x4EA984A: g_slist_free_full (in /lib64/libglib-2.0.so.0.2908.0)
  Address 0x603ccd0 is 16 bytes inside a block of size 448 free'd
    at 0x4A055FE: free (vg_replace_malloc.c:366)
    by 0x4E938F2: g_free (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x11EB59: remove_interface (object.c:563)
    by 0x11F380: g_dbus_unregister_interface (object.c:715)
    by 0x1787EC: btd_adapter_unref (adapter.c:2496)
    by 0x4EA9826: g_slist_foreach (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x4EA984A: g_slist_free_full (in /lib64/libglib-2.0.so.0.2908.0)
    by 0x174E96: manager_cleanup (manager.c:301)
    by 0x11CCE8: main (main.c:305)
2011-07-26 12:38:09 +03:00
Claudio Takahasi
e501b00e02 Add Link Loss device driver skeleton 2011-07-26 11:13:05 +03:00
Claudio Takahasi
b81ddf51e9 Add Proximity Monitor skeleton
Registers hard-coded D-Bus object path for Proximity Monitor and
exports GetProperties and SetProperty.
2011-07-26 11:13:03 +03:00
Claudio Takahasi
37c3958aba Add Proximity Profile plugin skeleton 2011-07-26 11:13:01 +03:00
Andrei Emeltchenko
8a617a8df5 l2test: enhance L2CAP mode option 2011-07-26 11:01:00 +03:00
Andrei Emeltchenko
3a94d5d09c l2test: Make use of L2CAP extended feature mask definitions 2011-07-26 11:00:57 +03:00
Andrei Emeltchenko
c7aac05539 Add L2CAP extended feature mask definitions 2011-07-26 11:00:02 +03:00
Szymon Janc
53e6e763d2 Fix telephony driver compilation with GLib < 2.28 2011-07-19 00:05:40 +03:00
Claudio Takahasi
16072709d1 Try to connect when registering the first callback
If the device is disconnected and the first ATT connection callback is
registered, the first connection attempt can be triggered instead of
waiting the timer.
2011-07-14 19:48:52 +03:00
Claudio Takahasi
b405d2da26 Drop GAttrib ref if callback list is empty
If all ATT connection callbacks are unregistered, GAttrib reference
can be dropped.
2011-07-14 19:48:35 +03:00
Claudio Takahasi
1eddeb66e8 Enable ATT re-connection
If the link is lost and there is at least one connection callback
registered the timer for ATT automatic connection shall be enabled.
2011-07-14 17:41:52 +03:00
Claudio Takahasi
bc80d767ab Add auto connection based on registered callbacks
This initial approach uses a hardcoded timer(45s). Passive scanning
or any other mechanism to avoid unnecessary connection attempt is not
supported at the moment. For LE, device discovery needs to be executed
to update the kernel advertising cache to allow re-connections.
2011-07-14 17:41:28 +03:00
Claudio Takahasi
ed57f0d28a Add ATT disconnect callback 2011-07-14 17:40:29 +03:00
Claudio Takahasi
1557acd733 Notify the GAttrib instance if already connected
When registering the connect and disconnect callbacks for ATT, GAttrib
instance should be informed to the caller if the link is up.
2011-07-14 17:40:17 +03:00
Claudio Takahasi
f6e2c8c614 Fix crash when create device is cancelled
If the owner leaves the bus or cancels the device creation process
the connection callback is called causing invalid memory access.
2011-07-14 17:39:33 +03:00
Claudio Takahasi
f61a6cad34 Add a function to remove ATT connection callback 2011-07-14 17:38:13 +03:00
Claudio Takahasi
55f9fbf822 Add ATT connection callback registration
Function intends to be used by profiles to inform that a connection
is required and the callback that needs to be called when the it is
established. New header is required to avoid non GATT based profiles
including GAttrib header.
2011-07-14 17:37:15 +03:00
Claudio Takahasi
37cd89f003 Set primary services before probing
Fix accessing primary services data in the probing function of GATT
based plugins.
2011-07-14 17:35:57 +03:00