Setting DIS info dynamically in Zephyr

SDK v3.0.2 Toolchain 3.01

Is it possible to set the DIS name, (and possibly others) dynamically at runtime? I need to provide some level of configuration to my  end users.

I've done this before at boot time using ble_dis_init() under SDK17 but under NCS/Zephyr it's buried in kconfig

  • Screenshots were taken from the peripheral_uart sample, but I was testing the peripheral_dis sample from the Zephyr repo.

    Nick_RA said:
    My app currently uses NVS to save a structure which contains a mix of integer & string values, about 16 values plus maybe 40 bytes in strings (including the custom DIS name). I suppose I should be able to move that to ZMS assuming it's compatible with nRF52832 which I also need to support.

    The sample is not configured to support any NV storage by default.

    ZMS is optimized for RRAM/MMRAM and NVS for FLASH. If you have a project for both nRF52 and nRF54L. you can create a Kconfig file in your project root that selectes the appropriate filesystem based on the NV memory the chip has. Same as we do in some of ourr SDK samplse. For example, in  the peripheral_uart sample here: https://github.com/nrfconnect/sdk-nrf/blob/main/samples/bluetooth/peripheral_uart/Kconfig#L39-L43 

Related