- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using CySmart 1.2 to change and write to a GATT attribute is verified to be correct by my firmware (EZ-BLE 4100) but reading back the attribute with the tool returns the original unchanged value. What is going on?
ie: original value = 0x0A, write 0x0B with CySmart and verify with debugger in my f/w, but read a 0x0A with CySmart
- Labels:
-
BLE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If you are using custom characteristics then you have to manually store the value in Gatt_Server_database that is written by Gatt_Client to read back by the client.
To accomplished this task you have to call -
CyBle_GattsWriteAttributeValue() API
> When CYBLE_EVT_GATTS_WRITE_REQ event is generated and after storing the value(written by client) in a variable ,you hav eto call above API .
> See the below code snippet-------------
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""'
/* Update RGB control handle with new values */
rgbHandle.attrHandle = RGB_LED_CHAR_HANDLE;
rgbHandle.value.val = RGBledData;
rgbHandle.value.len = RGB_CHAR_DATA_LEN;
rgbHandle.value.actualLen = RGB_CHAR_DATA_LEN;
/* Send updated RGB control handle as attribute for read by central device */
CyBle_GattsWriteAttributeValue(&rgbHandle, FALSE, &cyBle_connHandle, FALSE);
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
-Gyan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you, Gyan it all makes perfectly good sense now: If you want to read what you've written you must write what you read! I guess its a matter of verification protocol to prevent unwanted things written to your GATT DB.
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content