Generic Attribute API race condition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

There is a potential race condition in the Generic Attribute API. I'd
like to collect opinions to avoid re-work later.

How to reproduce:
- call CreateDevice() for a device which exports a GATT based service:
CreateDevice will discover all primary services
  and the Generic API will register the object paths for all found services
- Call DiscoverCharacteristics() of the primary service followed by
Characteristic GetProperties(), expected result: read all
characteristics properties outcome: partial characteristics properties
may appear.

This problem happens because DiscoverCharacteristics() doesn't wait
for all characteristic VALUES, it returns after discovering all
characteristic DECLARATIONS.
Wait for characteristic values is a problem, attributes may require
authentication or authorization.

Suggestions are:
1. Report discovered characteristic values using PropertyChanged:
Returning empty properties values (for GetProperties) if the discovery
is in progress

2. Block GetProperties() if there is a discovery pending: returning
after discovery finishes. Timeout can still happen!

3. Return Busy for GetProperties() if there is a characteristic
discovery in progress

Comments?

BR,
Claudio
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux