Writing Device Information Service (DIS) attribute permanently

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

cross mob
JuVo_286221
Level 2
Level 2

I am using a custom Bluetooth service to write Device Information Service attributes like device name and serial number from a smartphone to our connected IoT product. When I restart the device, the values are gone, so I need to store them in flash and set the attributes on every startup:

   
CyBle_DissSetCharacteristicValue(CYBLE_DIS_SERIAL_NUMBER, sizeof(serial_number), (uint8_t *)serial_number); CyBle_GasSetCharacteristicValue(CYBLE_GAS_DEVICE_NAME, sizeof(device_name), (uint8_t *)device_name); CyBle_GapSetLocalName(device_name); CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData, cyBle_discoveryModeInfo.scanRspData);
   

 

   

Is there any way to save that storage space and set the device name and serial number permanently at the time of receive? I wasn't able to find anything in the BLE CSD component's datasheet.

0 Likes
1 Solution
Anonymous
Not applicable

Hi,

   

You can use the CyBle_StoreAppData API or few other flash APIs to write data to flash. There are example projects available on the creator that demonstrates how to use the Flash.

   

regards,

   

- Madhu Sudhan

View solution in original post

0 Likes
1 Reply
Anonymous
Not applicable

Hi,

   

You can use the CyBle_StoreAppData API or few other flash APIs to write data to flash. There are example projects available on the creator that demonstrates how to use the Flash.

   

regards,

   

- Madhu Sudhan

0 Likes