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
GetProperties method of Proximity Monitor should not append the
LinkLossAlertLevel property if the LinkLoss service is not enabled
in the configuration file.
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.
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.
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.
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.
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.
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.
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).
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
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.
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.
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).
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.
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.
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.
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".
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.
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)