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

andorid start_notify no Descriptor #1527

Closed
wants to merge 1 commit into from
Closed

andorid start_notify no Descriptor #1527

wants to merge 1 commit into from

Conversation

tsiens
Copy link

@tsiens tsiens commented Mar 17, 2024

@tsiens tsiens changed the title Develop andorid start_notify no Descriptor Mar 17, 2024
@tsiens
Copy link
Author

tsiens commented Mar 18, 2024

What happened?Format and Lint?I don't understand

@dlech
Copy link
Collaborator

dlech commented Mar 18, 2024

Format and Lint?I don't understand

We use black to automatically format the code. So the CI failure is because black wasn't run on the changes.

Also, I don't think this is the right way to fix the issue. It seems like the if statements are just silently ignoring the bug.

Can you explain more about what you are trying to fix and why this fixes it?

@tsiens
Copy link
Author

tsiens commented Mar 18, 2024

Format and Lint?I don't understand

We use black to automatically format the code. So the CI failure is because black wasn't run on the changes.

Also, I don't think this is the right way to fix the issue. It seems like the if statements are just silently ignoring the bug.

Can you explain more about what you are trying to fix and why this fixes it?

I am developing an APK that uses a ble device,
1、In function “start_notify“,characteristic can be a string like the function 'stop_notify'
2、I don't know why my ble notification_descriptor is empty,self.write_gatt_descriptor will report an error,i think it's necessary to be compatible with empty notification_descriptor

@dlech
Copy link
Collaborator

dlech commented Mar 18, 2024

In function “start_notify“,characteristic can be a string like the function 'stop_notify'

This should already be handled in the start_notify() in bleak/__init__.py. Is it not working?

I don't know why

I would like to understand what is actually going on before considering merging these change. E.g. does the same Python script work on other OSes but not on Android. Can we get logs showing what descriptors are actually reported by the device. Are we sure this isn't a defective device like those described in #972?

@tsiens
Copy link
Author

tsiens commented Mar 19, 2024

In function “start_notify“,characteristic can be a string like the function 'stop_notify'

This should already be handled in the start_notify() in bleak/__init__.py. Is it not working?

I don't know why

I would like to understand what is actually going on before considering merging these change. E.g. does the same Python script work on other OSes but not on Android. Can we get logs showing what descriptors are actually reported by the device. Are we sure this isn't a defective device like those described in #972?

my code is working properly on Windows,
in bleak/p4android/client.py start_nofity,The original code required input BleakGATTCharacteristic object,This is unreasonable,Because the program will input a string char uuid just like stop_nofity,So the char_specifier should be modified to char_specifier: Union[BleakGATTCharacteristic, int, str, uuid.UUID].

and bleak/init.py start_nofity also char_specifier: Union[BleakGATTCharacteristic, int, str, uuid.UUID]

@tsiens tsiens closed this Mar 19, 2024
@tsiens
Copy link
Author

tsiens commented Mar 19, 2024

In function “start_notify“,characteristic can be a string like the function 'stop_notify'

This should already be handled in the start_notify() in bleak/__init__.py. Is it not working?

I don't know why

I would like to understand what is actually going on before considering merging these change. E.g. does the same Python script work on other OSes but not on Android. Can we get logs showing what descriptors are actually reported by the device. Are we sure this isn't a defective device like those described in #972?

He doesn't work. I entered a string uuid into the start_nofity and reported an error.
After I modified the p4a/client.py, it was successful

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

Successfully merging this pull request may close these issues.

2 participants