How to become notified of BSD non-blocking events

Hi there,

I'm intending to use the nrfxlib modem library and its BSD socket implementation on the nRF9160. My goal is to use non-blocking APIs and use `nrf_poll` in response to various events.

For example, I'd like to use `nrf_recv` (1) with `NRF_O_NONBLOCK` and then receive a notification when there is data available given its respective file descriptor. To achieve this, I'm wondering if I can connect an IPC RECEIVE event with all IPC channels, which'd see that `nrf_poll` is then called by my code.

Thanks for any guidance here.

(1) https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/nrf_modem/doc/api.html#group__nrf__socket__api_1ga1a288076f560857cb46fa0df46e1c7e5

Parents Reply
  • Triggering of a hw event indicates that something has happened, it does not indicate what. This comes by parsing the data, which is done in the "libmodem", which then exposes a given API towards your application. 

    Yes, understood. I'm happy to call poll often even if the peripheral event is only a hint toward poll needing to be called.

    This is the callback that is triggered when one (or more) events have occurred on a socket:

    I should explain that I'm not using Zephyr. However, it appears that the purpose of this callback is to sleep. I don't want to do that. :-) I want my program to call poll if it is likely that there has been some socket activity. Apologies if I'm being unclear. I appreciate your replies.

Children
Related