Commit Graph

202 Commits

Author SHA1 Message Date
Andre Guedes
7d0cd92007 proximity: Enable reconnection in Proximity monitor
According to Proximity Profile spec, when a connection is terminated
due to link loss a Proximity Monitor should attempt to reconnect.
2012-11-05 10:28:15 +02:00
Frédéric Danis
fbdca558d6 input: Retrieve device name from device object 2012-10-31 11:05:07 +02:00
Mikel Astiz
79b5c838af network: Remove unnecessary field from connect_req
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.
2012-10-26 10:04:21 +03:00
Johan Hedberg
83ee9c4dc6 network: Add missing btd_device reference counting 2012-10-25 13:41:22 +03:00
Mikel Astiz
c814fa7b49 input: Add profile .disconnect
Add the disconnect hook to the btd_profile.
2012-10-25 13:36:26 +03:00
Mikel Astiz
2c31fdb6a4 input: Expose internal disconnection API
Expose the same API exposed in D-Bus to disconnect devices.
2012-10-25 13:36:16 +03:00
Mikel Astiz
b9c588d567 input: Trivial function rename
Use the local_ name prefix for functions implementing the D-Bus API.
2012-10-25 13:36:08 +03:00
Mikel Astiz
60be28030f network: Add network .connect and .disconnect
Add the btd_profile hooks to connect and disconnect all three network
roles.
2012-10-25 13:35:22 +03:00
Mikel Astiz
afa7a207d3 network: Split Network into three btd_profile
Split the possible roles into three different btd_profile instances, one
role each, in accordance with the rest of the existing profiles.
2012-10-25 13:35:09 +03:00
Mikel Astiz
77ba3a7ced network: Expose internal connection API
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.
2012-10-25 13:34:46 +03:00
Mikel Astiz
3a4473bbae network: Trivial function rename
Avoid the connection_ prefix for local functions implementing the D-Bus
API.
2012-10-25 13:34:23 +03:00
Mikel Astiz
1541c28068 network: Specify id while registering server
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.
2012-10-25 13:34:08 +03:00
Johan Hedberg
70a609bb3a sap: Fix connected property fetching when not connected 2012-10-19 19:49:00 +03:00
Lucas De Marchi
b9d9498e81 health: Convert HealthDevice to DBus.Properties 2012-10-19 10:38:01 +03:00
Lucas De Marchi
d9ecb9c64c health: Convert HealthChannel to DBus.Properties
Also remove a needless strdup to send type property.
2012-10-19 10:37:05 +03:00
Lucas De Marchi
aaa40311d0 sap: Convert to DBus.Properties 2012-10-19 10:36:46 +03:00
Lucas De Marchi
5b804fe6f9 sap: Fix usage of wrong struct in get_properties() 2012-10-19 10:35:38 +03:00
Lucas De Marchi
6b351f591f input: Fix not sending PropertiesChanged signal 2012-10-19 10:35:20 +03:00
Andrzej Kaczmarek
fd16f2cc64 heartrate: Always write measurement CCC on discovery
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.
2012-10-17 11:08:14 +03:00
Szymon Janc
ef7452842d input: Remove not needed adapters list in manager
adapters list is not used for anything usefull.
2012-10-16 13:32:50 +03:00
Szymon Janc
c36d3d7dce network: Remove redundant struct network_peer members
struct network_peer holds reference to btd_device so path, src and dst
can be accessed from it.
2012-10-16 13:32:37 +03:00
Andrzej Kaczmarek
6f4d4e0390 heartrate: Convert to DBus.Properties 2012-10-13 22:30:33 +03:00
Andrzej Kaczmarek
7a4839b972 heartrate: Remove unused measurement characteristic value handle
Since notification handler is now registered only for measurement
characteristic value handle it's no longer needed to keep this handle.
2012-10-13 19:47:55 +03:00
Andrzej Kaczmarek
dbdc52599d heartrate: Fix registration of notification handler
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.
2012-10-13 19:47:53 +03:00
Lucas De Marchi
80351fac7c input: Convert to DBus.Properties 2012-10-13 12:19:26 +03:00
Johan Hedberg
fe4a0f717c hog: Fix passing NULL pointer to g_attrib_unregister
The hogdev->attrib pointer can be NULL if we got disconnected.
2012-10-11 15:04:24 +03:00
João Paulo Rechi Vita
22b8991210 hog: Fix requested range for descriptor discovery
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.
2012-10-11 09:02:59 +02:00
João Paulo Rechi Vita
f89c553fb6 hog: Fix characteristic descriptor discovery
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.
2012-10-11 09:02:43 +02:00
Vinicius Costa Gomes
87747f131a gas: Add the per handle GATT event notifier 2012-10-11 08:56:25 +02:00
Vinicius Costa Gomes
74a9fc7231 heartrate: Use the per handle GATT event notifier 2012-10-11 08:56:22 +02:00
Vinicius Costa Gomes
85506ccd62 hog: Use the per handle GATT event notifier 2012-10-11 08:56:16 +02:00
Vinicius Costa Gomes
cb0a835d79 scan: Use the per handle GATT event notifier 2012-10-11 08:55:55 +02:00
Vinicius Costa Gomes
0f92869a3b gattrib: Add support for listening for events for specific handles
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.
2012-10-11 08:55:50 +02:00
Vinicius Costa Gomes
9b8871db95 gas: Only do the Exchange MTU procedure over LE links
The Exchange MTU procedure should only be performed over LE links,
we are using the check of the Channel ID used to verify this.
2012-10-11 08:48:47 +02:00
Vinicius Costa Gomes
a2e4b27451 attrib: Remove all the usages of ATT_MAX_MTU
This "define" was bogus for two reasons: 1. There's no concept
of maximum MTU in the ATT level; 2. It was used as a maximum attribute
value length.
2012-10-11 08:35:06 +02:00
Andrzej Kaczmarek
9d1380fc9f thermometer: Fix missing braces 2012-10-09 17:56:41 +02:00
Andrzej Kaczmarek
c3e50abd82 thermometer: Fix indentation 2012-10-09 17:56:39 +02:00
Andrzej Kaczmarek
10d0fe065b thermometer: Fix whitespace 2012-10-09 17:56:37 +02:00
Andrzej Kaczmarek
53daf29fb3 thermometer: Refactor processing of measurement characteristic value
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.
2012-10-09 17:56:33 +02:00
Andrzej Kaczmarek
215f837470 thermometer: Add common function to write characteristics CCC
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.
2012-10-09 17:56:26 +02:00
Andrzej Kaczmarek
99685790cb thermometer: Add constant definition for watcher interface name 2012-10-09 17:56:18 +02:00
Andrzej Kaczmarek
b37495e622 thermometer: Update driver naming style
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.
2012-10-09 17:56:11 +02:00
Andrzej Kaczmarek
2f32a90868 thermometer: Change string properties to lower-case 2012-10-09 17:56:09 +02:00
Andrzej Kaczmarek
3c10778c40 thermometer: Include remote device information in MeasurementReceived
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.
2012-10-09 17:50:07 +02:00
Andrzej Kaczmarek
f083aa5242 thermometer: Move watcher logic to adapter interface
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.
2012-10-09 17:49:45 +02:00
Andrzej Kaczmarek
7bfdb32a17 thermometer: Register ThermometerManager interface on adapter path 2012-10-09 17:49:37 +02:00
Andrzej Kaczmarek
d135efe767 thermometer: Store thermometer devices per-adapter
This patch replaces global list of thermometer devices with per-adapter
lists.
2012-10-09 17:49:21 +02:00
Vinicius Costa Gomes
8a39d6ed2d attrib: Remove opcode parameter from g_attrib_send()
In all uses of g_attrib_send() the opcode of the command/event is
already clear because of the att.h functions used to build the ATT
PDU.
2012-10-09 10:56:52 +02:00
Vinicius Costa Gomes
e1805bb500 input: Fix registering HoG service for non-HoG profiles
We need to handle the case that the device has multiple HoG services,
but before registering we must check the service UUID.
2012-10-09 10:51:07 +02:00
Szymon Janc
ed6a8af4a3 device: Convert device_get_address into simple getter
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.
2012-10-05 11:27:45 +03:00