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

[Bug]: Android - BluetoothCharacteristic.setNotifyValue(...) causes exception from version 1.28.5 onwards. #669

Closed
1 task done
MartinXBcn opened this issue Nov 10, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@MartinXBcn
Copy link
Contributor

Requirements

  • I've looked at the README 'Common Problems' section

Have you checked this problem on the example app?

No

FlutterBluePlus Version

1.28.5

Flutter Version

3.13.9

What OS?

Android

OS Version

Android 11

Bluetooth Module

ESP32-S3

What is your problem?

Changes between version 1.28.4 and 1.28.5 have side-effects on BluetoothCharacteristic.setNotifyValue(...) and causes exceptions from version 1.28.5 ff:
Exception has occurred. PlatformException (PlatformException(setNotifyValue, service not found '5cb7', null, null))

What I found out in function BluetoothCharacteristic.setNotifyValue(...) are different values in the structure BmSetNotifyValueRequest request before calling FlutterBluePlus._invokeMethod('setNotifyValue', request.toMap())

Version 1.28.4
request.serviceUuid = Guid (00005cb7-0001-9923-4d7d-0000000080ba)

Version 1.28.5/1.28.6
request.serviceUuid = Guid (5cb7)

Logs

X
@MartinXBcn MartinXBcn added the bug Something isn't working label Nov 10, 2023
@chipweinberger
Copy link
Collaborator

chipweinberger commented Nov 10, 2023

00005cb7-0001-9923-4d7d-0000000080ba

is this a custom uuid? you can only use short ids for XXXXXXXX-0000-1000-8000-00805f9b34fb

so Guid (5cb7) is of course not going to be found, you should use Guid (00005cb7-0001-9923-4d7d-0000000080ba)

does it work with Guid (00005cb7-0001-9923-4d7d-0000000080ba)?

@chipweinberger
Copy link
Collaborator

ah, now I get what you are saying. and yes I found the bug

@chipweinberger
Copy link
Collaborator

fixed 1.28.7

@MartinXBcn
Copy link
Contributor Author

Works, thank you!
Although you are right, good point: uuid is created by me, I never thought about if it is "valid", but it worked for me up to now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants