Change advertising name dynamically when using ultra low power mode sd_power_system_off

Greetings,

I am facing a problem making my BLE device change its advertising name by parameter received from UART. The advertising name is generated using my function, what i want to do is, when there is a parameter received by UART i want to change the advertising name and to keep that new advertising name until next change is occurred. Also i am using low power mode sd_power_system_off when putting it to sleep after some time.

static void make_dev_name(void)
{
ble_gap_addr_t device_address;
// Changed for Sudmetal
uint8_t companyName[] = {"S"};
uint8_t modelName[] = {(advertisingData > 0) ? advertisingData + '0' : "1",'\0'};
uint8_t *macAddressName;
uint8_t macTmp[12]; // macTmp[8];

sd_ble_gap_addr_get(&device_address);
macAddressName = Convert_Hex_To_Ascii(&device_address.addr[0], 6);


memcpy(&DEVICE_NAME[0], companyName, 1); //3);
memcpy(&DEVICE_NAME[1], modelName, 1); //3);
memcpy(&DEVICE_NAME[2], macAddressName, 12); //8);

}

Parents
  • Hi,

    The SoftDevice itself does not have any persistent storage, and wakeup from system off is in form of a reset. So in order to make this persistent you need to write the updated address to flash (using for instance FDS) or use RAM retention to keep the data intact during system off, and read this back and set the name every time after wakeup from system off.

Reply
  • Hi,

    The SoftDevice itself does not have any persistent storage, and wakeup from system off is in form of a reset. So in order to make this persistent you need to write the updated address to flash (using for instance FDS) or use RAM retention to keep the data intact during system off, and read this back and set the name every time after wakeup from system off.

Children
No Data