-
Notifications
You must be signed in to change notification settings - Fork 55
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
How to create characteristics with uint8 value respond #28
Comments
As far as I can see, it is always fixed to 4 bytes, big endian. |
I tried to use arrays: But can't run the code, it exits with Error |
@0xFACE try to using the below code. Your syntax is indeed wrong, you cannot use DIM A(1) inside the GATT command. DIM A(1) must be outside. A running idle loop keeps the DIM A(1) alive. If the basic program terminates, it falls back to Int32 type and you get the 4 bytes by reading. You can also not declare DIM A(1) in the GOSUB area, since this would hide the instance variable which gets accessed by GATT. Another thing I observed is, that the DIM variable gets lost for GATT when you use a DELAY instruction during GATT access in the GOSUB section. Sometimes an "DELAY 1" is required in interactive sessions, to give control back to the BLE stack in order not to loose the console connection. But this is only the case when you execute longer tasks in the BASIC program. For GATT access I try to avoid this, by e.g. using a TIMER to shift some processing outside the GATT access (see e.g. line 400 below). -Kai
|
Wow, great. |
BlueBasic is using 32-bit variables. When I create characteristic for reading, the response value is 32bit long. Is it possible to respond with uint8 values ?
According to the specification: alert level characteristic is uint8:
https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.alert_level.xml&u=org.bluetooth.characteristic.alert_level.xml
32bit response gives invalid value :
The text was updated successfully, but these errors were encountered: