-
Notifications
You must be signed in to change notification settings - Fork 583
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature DiscoverService with clearCache #453
base: master
Are you sure you want to change the base?
Feature DiscoverService with clearCache #453
Conversation
waiting for this to be merged impatiently |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got a moment to comment on this PR. I have one doubt about it:
The thing is that some Observables returned by RxBleConnection
use the RxBleConnection.discoverServices()
internally. If services will get changed during a connection all those previously created Observable
s may be out of sync. If a handle for a BluetoothGattCharacteristic
with a given UUID
will get changed then the user would need to create a new one using i.e. RxBleConnection.readCharacteristic(UUID)
as the previous one may no longer use the correct handle which may lead to hard to debug errors...
I was thinking about this issue but haven't yet implemented an appropriate architecture for that. It is a part of new connection API proposition which should not allow to use BluetoothGattCharacteristic
/descriptor/UUID directly
That's good comment, i understand your wish to carry the user/dev to avoid any possible mistake or oversight and i am totally ok with it ! |
I am not a fan of adding unsecure APIs. Users tend not to read the documentation frequently enough :( The expert mode is the |
i do not see how today we can make this feature with customOperation... "Users tend not to read the documentation frequently enough" i agree with you. Here the little difference is to access to the refresh mode the user has to use the most complex version of the function. The basic user will use the simplier method first i think |
One can make an operation with The only downside is that the user cannot use the API that takes |
Yes we can perform a discover from CustomOperation but in "ServiceDiscoveryManager.java" there are also 2 level of cache, the observable saved and the rx ".cache()" on the other observable... |
Usually the
Yes — most probably. I plan to add this feature at some point but not yet. My arguments:
|
For me yes this may introduce miss understanding behaviour for basic use (where this feature don't aim). But at the opposite, not having it, may introduce the same for user who needs real discovers feature.
I won't see how its possible through the RxBleCustomOperation.. May the solution for "expert mode" is to supply some feature like this with rxBleCustomOperation class ? |
Why still not merged? |
Any news about integrating this feature in this shape or another @dariuszseweryn ? |
1513722
to
a0942e1
Compare
Unfortunately I didn't had time to properly handle this project in the recent months. My previous doubts still stand |
We worked on the service changed BLE feature (0x2A05) cause iOS needs it to be able to refresh services, it works fine with it. On Android we can see in HCI log the incoming command but the GATT does not refresh the services list and there is no event fired by the GATT to handle... |
To relieve your pain in awaiting a proper fix I am posting implementation on how one can refresh gatt on their own and then perform service discovery bypassing all caches First the
Then a
And usage example:
Hope this help you for now |
Pull new commits from forked repository
Guillaume Bourge seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Allow to refresh entierely the discover cache, to perform a new Gatt discover and be able to see a new service appeared during the connection