-
Notifications
You must be signed in to change notification settings - Fork 419
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
[Help]: During initState activation of notification for characteristic fails #656
Comments
Important thing: If I try to process only one service instead of 4 or 2, the setNotifyValue call in initState works without problems. |
you should always use you should not be calling |
I add await.
Every time same result. |
OK, but how I can automatically activate notification for characteristic. Should I create a delay? |
try 1.21.0 i've made the btw, you should always be checking for errors either with try/catch or |
Hello! |
Requirements
Have you checked this problem on the example app?
Yes
FlutterBluePlus Version
1.20.7
Flutter Version
3.13.9
What OS?
Android
OS Version
Android 11/13
Bluetooth Module
bgm210pa22jia2
What is your problem?
I have 4 services with different uuids which have. Each service have 2 characteristics the uuid for these are same form service to service:
![image](https://private-user-images.githubusercontent.com/1131130/280397726-f6677760-82ad-4c00-bfd8-cdba4ea49c42.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjEyNDU3NTEsIm5iZiI6MTcyMTI0NTQ1MSwicGF0aCI6Ii8xMTMxMTMwLzI4MDM5NzcyNi1mNjY3Nzc2MC04MmFkLTRjMDAtYmZkOC1jZGJhNGVhNDljNDIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTdUMTk0NDExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9M2Y2ODdhZmJhODM5MWJiNWQ2NTBjNmQ0MzNhNTU0N2JhMWU4MzEyNDYyOTY1MWNkNjBiMTljYjVjZjJjODc3ZiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.DiQhHehSAKAB1lzZpOj8idPEFJ1F9KYGD4NWMkuHyRI)
It was done to create in flutter one widget and create for each service a instance of widget.
The State characteristic I want to use as feedback with notification from BLE device.
The problem is that is I try to call setNotifyValue for State I receive next Exception:
Exception has occurred. PlatformException (PlatformException(setNotifyValue, gatt.writeDescriptor() returned 201 : ERROR_GATT_WRITE_REQUEST_BUSY, null, null))
I tried in may different ways to do it in initState, but every time has same Exception.
If I move setNotifyValue to button somewhere in widget everything works without problem.
Logs
The text was updated successfully, but these errors were encountered: