aioble saving service discovery #15801
Unanswered
brianreinhold
asked this question in
Libraries & Drivers
Replies: 2 comments
-
You may need to reconstruct the ClientService and ClientCharacteristic objects manually. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I did and it worked. Because after service discovery I create an array of ClientServices and their ClientCharacteristics and that's all I use in the remainder of the code (except for dsiconnects). The source code says I should not do that but there appears to be no consequence for doing so. At least so far ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Help me here authors of aioble!!
A major shortcoming of this library is that is does NOT save the results of service discovery which results in losing data from bonded devices on reconnection. An important element of BLE is the saving of power, so that in a bonded reconnect after encryption the device can notify/indicate its data and disconnect. However, in aioble one is forced to redo service discovery (painfully slow) and by the time it is done the device has already indicated/notified its data.
Well I have gotten to the point of saving service discovery handles and uuids so I should, in theory, be able to recreate the
ClientService
and itsClientCharacteristic
objects. However, the code has this 'warning'Of course doing as suggested forces one to go through service discovery again.
The constructor for the
ClientService
isdef __init__(self, connection: DeviceConnection, start_handle: int, end_handle: int, uuid: UUID)
and I have saved all these values.How can I directly restore the
ClientService
and theClientCharacteristic
objects?It would also be nice to be able to subscribe without doing descriptor discovery, as that too is slow. All I should have to do is write the notification/indication state directly to the CCCD without having to discover it first.
Beta Was this translation helpful? Give feedback.
All reactions