CySmart Write/Read to GATT DB not changing the data read

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

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

0 Likes
3 Replies
GyanC_36
Employee
Employee
250 replies posted 100 replies posted 50 replies posted

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

0 Likes
Anonymous
Not applicable

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

0 Likes
lock attach
Attachments are accessible only for community members.
AnjanaM_61
Moderator
Moderator
Moderator
5 comments on KBA First comment on KBA 5 questions asked

Hi,

   

You can refer the attached example project of Read, Write properties.

   

Thanks,

   

Anjana

0 Likes