- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is there a way in the main application to detect when a characteristic read is occurring.
In my application, I need to generate the characteristic data dynamically as it is requested. Ideally I would like a callback so that I can update the characteristic value before it is sent.
Thanks
Solved! Go to Solution.
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, there is a CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ
event. See this thread: http://www.cypress.com/forum/psoc-4-ble/gatt-server-event-when-long-read-completes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, there is a CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ
event. See this thread: http://www.cypress.com/forum/psoc-4-ble/gatt-server-event-when-long-read-completes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Speedycat,
That worked! I am getting that event.
There is still a small problem, I update the GATT database in the event handler, but the previous value is sent to the client. The next time the client reads the value, it reads the value that I had set so the read value is always delayed by one request.
Is this event triggered AFTER the response is sent to the client ?
and is there any way to update the data BEFORE it is sent to the client ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think the BLE component/code prohibits you from doing this. Maybe this is some constraint made by Cypress; maybe it is required by Bluetooth specification. I don't know.
You could create your own Characteristic with Write and Indicate properties. Use write to send your own "read command" to the server, and then let the server do an Indication back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your help, I can work around this limitation.