Skip to content
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

resolve_gatt not implemented for bluezero.GATT.Descriptor #353

Open
JanuszSamborski opened this issue Nov 9, 2021 · 3 comments
Open

resolve_gatt not implemented for bluezero.GATT.Descriptor #353

JanuszSamborski opened this issue Nov 9, 2021 · 3 comments

Comments

@JanuszSamborski
Copy link

There is call for self.resolve_gatt() inside bluezero.GATT.Descriptor's constructor, however it's not implemented.

@JanuszSamborski
Copy link
Author

Actually, on the same note, resolve_gatt() is not called inside bluezero.GATT.Characteristic's constructor. Behavior should be probably unified.

@JanuszSamborski
Copy link
Author

I also found that (at least for my device) the first call to resolve_gatt() can fail, and second one succeeds, so it might be viable to call get_methods at least twice with some backoff, but this would need further testing.

@ukBaz
Copy link
Owner

ukBaz commented Nov 9, 2021

Hmm? That does look like it is all a bit of a mess.

I suspect that the resolve_gatt in the Service and Descriptor init's are never called because they are protected by that if statement. The services is never going to be resolved when you create the Service or Descriptor class instance.

if self.rmt_device.services_resolved:
self.resolve_gatt()

I suspect the way it is done in the Central is the correct way:

while not self.rmt_device.services_resolved:
sleep(0.5)
self.load_gatt()

There being no resolve_gatt for the descriptor is an oversight. Although there are only about 16 descriptors assigned by the Bluetooth SIG with fairly niche behavior so I would curious to know which one you are using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants