How to differentiate versions of modem lib for dect nr+?

Nordic has changed the API of nrfx nrf_modem_dect_phy from SDK 2.7 to SDK v2.9.

In struct nrf_modem_dect_phy_callbacks there is an additional callback member stf_cover_seq_control.

I found nrf_modem_build_version(); with that I can check the version of the modem lib which I compiled against at runtime I assume.

I also found an AT command for checking the version of the running modem firmware. I can print it via modem CONFIG_NRF_MODEM_LIB_LOG_FW_VERSION_UUID but did not compare against version of the modem lib.

But how can I differentiate at compile time which version of the struct I have to use (I want to support both).

Is there some #define to specify the version of the modem lib and/or the sdk?

Parents Reply Children
  • It should select the correct initializer for the needed callbacks depending on modem lib version it is build against.
    Something like:

    static const struct nrf_modem_dect_phy_callbacks callbacks = {
    .init = radio_init_cb,
    .op_complete = op_complete_cb,
    .rssi = rssi_cb,
    .rx_stop = rx_stop_cb,
    .pcc = pcc_cb,
    .pcc_crc_err = pcc_crc_err_cb,
    .pdc = pdc_cb,
    .pdc_crc_err = pdc_crc_err_cb,
    .link_config = link_config_cb,
    .time_get = time_get_cb,
    .capability_get = capability_get_cb,
    #if defined NRF_MODEM_VERSION == "2.9"
    .stf_cover_seq_control = stf_cover_seq_control_cb,
    #endif
    .deinit = deinit_cb
    };
Related