I use nRF52832, with nRF5_SDK_13.0.0_04a0bfd, with s132_nrf52_4.0.2_softdevice.hex, IAR IDE for ARM 8.32.1 on WIN10
I created three services with each having a characteristic. It works fine, and I can transfer data.
The DEVICE_NAME shows up when advertising. OK
From: https://devzone.nordicsemi.com/f/nordic-q-a/18551/production-customization---nrfjprog-serial-number
I then use nrfjprog -f nrf52 --memwr 0x10001080 --val 0xCAFEBABE to store a serial number in Flash when I program the nRF52832
I can read the serial number at runtime with:
uint8_t serial_number[4];
memcpy(serial_number, (uint32_t *)0x10001080, 4);
How can I add / concatenate this serial number to the DEVICE_NAME so it shows up during advertising?
So if I have multiple device running at the same location, the user can connect to the correct one?
Say the advertised name was "GIZMO", and serial number was 0x012345678 then the advertising name would be:
GIZMO12345678
Problem: (I think)
#define DEVICE_NAME - this is a constant, known at compile time, but the serial number needs to be read at runtime, and then added to look like a constant?
Any help appreciated