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

cross mob
Anonymous
Not applicable

Hi,

   

I know how to set the custom characteristics of a custom service using following code -

   

CYBLE_GATT_HANDLE_VALUE_PAIR_T tempHandle;
tempHandle.attrHandle = CYBLE_CUSTOMSERVICE_NAME_CHAR_HANDLE;
tempHandle.value.val = data;
tempHandle.value.len = sizeof(data);

   

CyBle_GattsWriteAttributeValue(&tempHandle, 0, &CYBLE_CUSTOMSERVICE_NAME_CHAR_HANDLE, CYBLE_GATT_DB_LOCALLY_INITIATED);

   

But now I want to set characteristics of Device Information service programatically (i.e Serial Number String). These services are standard services. Is there any example which I can use to set standard characteristics? If I try the above code to set it, it doesn't work. I can see the constant value set using the BLE settings.

   

Please help. Thanks in advance.

   

Kind Regards,

   

Jitender

0 Likes
1 Solution
Anonymous
Not applicable

Hi, 

   

The command you are looking for is CyBle_DissSetCharacteristicValue(CYBLE_DIS_SERIAL_NUMBER   , sizeof(serNum), serNum);

   

If you right click the BLE component and select "Open API Documentation" and then go to "Service Specific API's" and then select "Device Information Service" you will find everything you are looking for,

   

Hope this helps,

   

Stephen

View solution in original post

10 Replies