Written values over BLE dont "stick"

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

cross mob
Anonymous
Not applicable

i'm pretty new to Psoc development so please forgive any obvious mistakes.
i've been working on a project for the past few days. the values im writing with the CySmart applet dont seem to "stick."

   

looking at some of the example projects i came up with the following.

   


case CYBLE_EVT_GATTS_WRITE_REQ:
            wrReqParam = (CYBLE_GATTS_WRITE_REQ_PARAM_T *) eventParam;
            if(wrReqParam->handleValPair.attrHandle == CYBLE_MULTFIBER_TOOL_DEVICE_CHAR_HANDLE){
                CYBLE_GATT_HANDLE_VALUE_PAIR_T hvp;
                uint8 theValue[2];
                theValue[0] = wrReqParam->handleValPair.value.val[0];
                theValue[1] = wrReqParam->handleValPair.value.val[1];
                hvp.attrHandle = CYBLE_MULTFIBER_TOOL_DEVICE_CHAR_HANDLE;
                hvp.value.val = theValue;
                hvp.value.len = 2;
                /* Report data to BLE component for sending data when read by Central device */
                CyBle_GattsWriteAttributeValue(&hvp, 0, &cyBle_connHandle, CYBLE_GATT_DB_PEER_INITIATED);
                }
         
            
            CyBle_GattsWriteRsp(cyBle_connHandle);
            break;

   

   

 

   

i've got a similar setup for the write without response, but when i write a value via the CySmart Applet it reads as the default value: 00
are there any glaring issues im overlooking?

0 Likes
1 Solution
Anonymous
Not applicable

so after some deliberation i found the answer.
the length of the value in the characteristic didn't match with the length of the value i was writing.
 

   

so if anyone else runs into this: check the length of your values

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

so after some deliberation i found the answer.
the length of the value in the characteristic didn't match with the length of the value i was writing.
 

   

so if anyone else runs into this: check the length of your values

0 Likes