How to send response to BLE characteristic with read property? #1329
Replies: 2 comments
-
To the best of my knowledge, the Moddable SDK BLE implementation is designed to handle characteristic read requests synchronously. When the client requests the characteristic value, your BLE Server implementation will receive the Synchronous return of characteristic read values is a requirement of at least some of the BLE APIs provided by the platform-specific SDKs on which the Moddable SDK is built. As you note, Characteristic value changes are usually handled asynchronously via Notifications and Indications rather than using Read. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response. |
Beta Was this translation helpful? Give feedback.
-
In my project, customer hardware is using Moddable SDK. BLE connection is established between custom hardware and mobile app successfully.
On custom hardware, BLE characteristic under service is having read property. So, user can get characteristic value by reading this characteristic. When user reads characteristic value from mobile, mobile app sends read characteristic request to custom hardware and custom hardware needs to get this value from other device over other interface. Once custom hardware gets this value from other device then it can send response to mobile app over BLE interface.
So, in this kind of scenario where response is not ready while receiving BLE request which Moddable BLE API is used to send response? I found that if characteristic has notify property then BLE server can use notifyValue API to send response to mobile app, but if characteristic doesn't have notify property then which BLE API user should use to send response?
Beta Was this translation helpful? Give feedback.
All reactions