The device pointer in struct connect_req can be completely removed since
the callback already receives such pointer, and the network_peer takes
care of the device refcounting.
Separate the D-Bus code from the internal connection handling code,
exposing an internal API in case some internal codepath/plugin is
interested in using it.
Only one type of server is being installed (BNEP_SVC_NAP), but the
server API actually supports having several of them. Therefore, it is
more accurate to specify BNEP_SVC_NAP in the manager's side.
Measurement CCC is written during discovery only in case watcher is
registered and notifications shall be enabled. However, it may happen
that (e.g. during reconnection scenario) notifications are already
enabled on remote but watcher is no longer registered and we will
be receiving unwanted notifications.
This patch makes sure measurement CCC is written to proper value
every time it's discovered during connection.
Notification handler is registered only when CCC is written during
descriptors discovery, i.e. at least one watcher is registered before
device is connected. This means there will be no handler registered in
case watcher is registered after device already connected.
This is side-effect of 74a9fc7.
This patch registers handler immediately when measurement characteristic
is discovered so it does not matter when watcher is registered.
ccc_write_cb() is reduntant in this case so it's removed.
When discovering descriptors of the last characteristic of a service the
discovery range was exceeding the service limits. This commit keeps the
discovery within the limits of the HoG service.
The discover descriptors sub-procedure is complete when the error
response is received and the error code is set to "Attribute Not Found"
or the find information response has an attribute handle that is equal
to the last handle in the request. This commit fixes the stop condition
for characteristic descriptor discovery.
We want only the profile that implements a service to be notified of
changes on that service. Before this patch, all the registered event
notifiers are being called.
Data buffer is read by simply moving buffer pointer instead of calculating
indexes of consecutive fields. This makes function flow easier to follow
as there's no need to care about presence of fields prior to current when
reading data.
There are now few separate functions to write CCC for measurement
characteristics which looks similar. This patch adds common function
to write given value into CCC for given characteristics and leaves
dedicated functions to act only as simple wrappers.
This patch changes device probe and remove functions name to include
'device' rather than 'driver' name as it better describes what both
do.
Also profile driver name is changed to better describe that it's now
profile driver rather than device driver only.
Since watchers are now registered per-adapter it's necessary to include
remote device information in MeasurementReceived callback.
This patch adds parameter to MeasurementReceived method which is an
object path to remote device object.
This patch moves watcher related methods to ThermometerManager interface
so watchers can be registered per-adapter instead of per-device.
Final measurement notifications are now enabled on all devices connected
to given adapter when first watcher is registered and disabled when last
watcher is unregistered.
Intermediate measurement notifications are enabled for all devices
connected to given adapter which support this feature.
This allow to remove number of local variables used only to get device
address and pass it as pointer later on.
bdaddr_type parameter is also removed as there is device_get_addr_type
already present which can be used to get it if needed.