Setting DIS serial number at runtime

How can I set serial number visible in DIS service programaticaly? I know I can set CONFIG_BT_DIS_SERIAL_NUMBER_STR, but putting serial number in project's source code makes no sense. Serial number should be unique for each device. So I'd like to read it using hw_id_get() and put it into DIS. In old Nordic SDK it was trivial. In Connect SDK it seems to be not possible.

Parents Reply
  • Hi  

    Yes, API would be better. But if runtime settings don't touch Flash then it's not that bad.

    Regarding the sample. It sets CONFIG_SETTINGS_NONE=y. Is it required by runtime settings? I guess runtime settings are always in RAM? Additionally I think CONFIG_SETTINGS_NVS=y is needed anyway because without it I get errors from bt module:

    00> [00561318] <err> bt_gatt: Failed to save Database Hash (err -2)
    00> [00561356] <err> bt_settings: Failed to save ID (err -2)
    00> [00561370] <err> bt_settings: Failed to save IRK (err -2)

    Regards,

    Grzegorz

Children
Related