You are here

Writing Device Information Service (DIS) attribute permanently | Cypress Semiconductor

Writing Device Information Service (DIS) attribute permanently

Summary: 1 Reply, Latest post by Madhu Sudhan on 05 Sep 2016 02:43 PM PDT
Verified Answers: 1
Last post
Log in to post new comments.
user_460593777's picture
User
21 posts

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.

mady's picture
Cypress Employee
1058 posts

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

Log in to post new comments.