Commit Graph

8738 Commits

Author SHA1 Message Date
Sheldon Demario
7223e60a54 Test script for LinkLossAlertLevel property
Initial test script for Proximity Monitor. This patch allows the
user to set the Link Loss alert level of a given Reporter.
Usage example:
$test-proximity -i hci1 --device <mac> LinkLossAlertLevel mild
2011-08-03 16:06:49 +03:00
Claudio Takahasi
d955e9b1d9 Return LinkLossAlertLevel if enabled
GetProperties method of Proximity Monitor should not append the
LinkLossAlertLevel property if the LinkLoss service is not enabled
in the configuration file.
2011-08-03 12:29:22 +03:00
Claudio Takahasi
9c24b591d1 Return an error if LinkLoss is disabled
Changes SetProperty method of the Proximity Monitor to verify if the
LinkLoss service is enabled before allowing to change the alert level.
Not available error is returned if LinkLoss service is disabled in the
Proximity configuration file.
2011-08-03 12:29:20 +03:00
Claudio Takahasi
a70d39b01a Match probed UUIDs and enabled services
Verify if the service is enabled in the proximity configuration file
before to register the Proximity Monitor.
2011-08-03 12:29:17 +03:00
Claudio Takahasi
2637d94576 Add config file for proximity monitor
Initial config file to disable Proximity and Find ME support in the
proximity monitor side. By default all services will be supported.
Config file is necessary at least to disable Find ME profile since the
Immediate Alert service is shared between Pass Loss and Find ME.
2011-08-03 12:29:14 +03:00
Claudio Takahasi
99a9b6cfca Add Tx Power and Immediate Alert UUID
Changes Proximity Monitor driver declaration adding the Tx Power and
Immediate Alert UUIDs. UUIDs are required to support Path Loss and
Find ME.
2011-08-03 12:29:12 +03:00
Anderson Lizardo
46fd11cd90 Proximity Monitor: Write Alert Level to Reporter
When the Proximity Monitor connects to the Reporter, it shall write its
current Alert Level (usually defined by the user) into the Alert Level
characteristic on the Monitor. So once the link is lost, the Monitor
will alert with the appropriate level.

Note: Register connection callback to write alert level to the Reporter.
2011-08-03 12:28:49 +03:00
Sheldon Demario
5f3ec93302 Use device object path on Proximity Monitor 2011-08-03 12:23:41 +03:00
Sheldon Demario
a7c03cd4a3 Emit a signal when Link Loss Alert Level changes
There is only one instance of the Alert level in the Link Loss service.
Signal is emitted to notify other local clients that the alert level
has changed. Necessary if the proximity monitor wants to notify the user
and the application responsible for alerting is another application.
2011-08-03 12:23:39 +03:00
Bruna Moreira
5a65a1c1c5 Add load/store functions for Alert Level
The Alert Level Characteristic must be persistent across connections.
New functions to load/store the alert level value were created.
2011-08-03 12:23:36 +03:00
Sheldon Demario
06ea0b9650 Add get Link Loss Alert Level 2011-08-03 12:23:34 +03:00
Sheldon Demario
fabcf0e5dd Add set Link Loss Alert Level
Add LinkLossAlertLevel property for SetProperty method in Proximity
Monitor. Allowed values are: none, mild and high.
2011-08-03 12:23:31 +03:00
Claudio Takahasi
b33f1f5922 Check if attrib server is enabled for Proximity
Before registering Proximity services(Link Loss, Immediate alert and
TX Power), "AttributeServer" option value needs to be verified.
2011-08-03 12:20:50 +03:00
Anderson Lizardo
47e3b783f2 Register primary service for Immediate Alert 2011-08-03 12:20:46 +03:00
Anderson Lizardo
bf470478d6 Register primary service for Tx Power service 2011-08-03 12:20:43 +03:00
Anderson Lizardo
0a67a9d57e Register primary service for Link Loss service 2011-08-03 12:20:40 +03:00
Claudio Takahasi
d5466d15d3 Add Proximity Reporter skeleton 2011-08-03 12:20:36 +03:00
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