Request for .handle field for pcc/pdc callbacks

I work currently working on a driver module supporting your nRF91x1.
I schedule rx-operations via your nrf_modem_dect_phy_rx() dect_phy modem-api.
I am using the .handle field of the struct nrf_modem_dect_phy_rx_params to store my context which I want to reference to when the modem does notify me via my provided callbacks.

If the rx-operation has finished the op_complete callback provides this very handle as parameter and I can re-create my related context.
But if pcc/pdc have been received the handle is not returned with pcc/pdc/pcc_crc_err/pdc_crc_err callbacks.
Now it creates some unexpected trouble for me to retrieve the related handle for that data if I want to associate that data to its related rx-operation.

Do you plan to add that handle as parameter field for example with nrf_modem_dect_phy_rx_pcc_status/nrf_modem_dect_phy_rx_pcc_status/nrf_modem_dect_phy_rx_pcc_crc_failure/nrf_modem_dect_phy_rx_pdc_crc_failure?

Parents Reply Children
  • Yes, currently I use the SDK v2.9.0. There is no error, I use your API as it is and so far it works well. Merely it is a improvement/feature request.

    I try to explain it with code examples:

    When I want to schedule an rx-operation I provide my context ctx as handle.

    struct nrf_modem_dect_phy_rx_params rx_params= {
        .handle = (uintptr_t)ctx,
        ...
    };
    ret = nrf_modem_dect_phy_rx(&rx_params);

    If that operation has been finished I can use that context (which creates the relation to the very operation) in my callback to do operation management.

    static void op_complete_cb(const uint64_t *time, int16_t temperature, enum nrf_modem_dect_phy_err status, uint32_t handle) {

        struct radio_op_ctx* ctx = (void*) handle;
        ...
    };

    If the modem received a message within that rx-operation then pcc_cb() and pdc_cb() callbacks are called before the op_complete_cb(). But both callbacks do not provide the handle, I can not retrieve my context and can not trigger operation management.

    static void pcc_cb(const uint64_t *time,const struct nrf_modem_dect_phy_rx_pcc_status *status, const union nrf_modem_dect_phy_hdr *hdr) {

        struct radio_op_ctx* ctx = (void*) handle; <- This would be nice!
        ...
    };

    static void pdc_cb(const uint64_t *time, const struct nrf_modem_dect_phy_rx_pdc_status *status, const void *data, uint32_t len) {

        struct radio_op_ctx* ctx = (void*) handle; <- This would be nice!
        ...
    };

    To circumvent that I have to implement some static global context access mechanism.

    I hope it is more clear now.

  • Thanks for clarifying! I will forward this as a feature request, and update you if they have any initial comments to this.

    Kind regards,
    Øyvind

  • Hello, 

    Do you plan to add that handle as parameter field for example with nrf_modem_dect_phy_rx_pcc_status/nrf_modem_dect_phy_rx_pcc_status/nrf_modem_dect_phy_rx_pcc_crc_failure/nrf_modem_dect_phy_rx_pdc_crc_failure?

    Handle has been added to related callbacks in modem v1.1 based libmodem api (which is currently used in ncs/main). Can you please have a look and test on your side?

    Kind regards,
    Øyvind

  • Thank you for your reply,

    until now I am working with modem v1.0.2 and have access to
    mfw-nr+_nrf91x1_1.1.0-47.alpha via dect-nr-pre-access (I assume v1.1 is currently not in final release state as it is marked alpha!?).

    I looked into
    https://github.com/nrfconnect/sdk-nrfxlib/blob/main/nrf_modem/include/nrf_modem_dect_phy.h (Commit 0d6797a) and it seems it is what I would appreciate.
    As soon as I will find time I will try that out. If it works it will save a lot of hassle.

    I also have seen you now have a "transaction-id" to map pdc to related pcc - also nice :).

    Best regards and thanks for that work in advance.

Related