nrfxlib API 0.1.0
Loading...
Searching...
No Matches

◆ nrf_modem_os_timedwait()

int32_t nrf_modem_os_timedwait ( uint32_t  context,
int32_t *  timeout 
)

#include <nrf_modem/include/nrf_modem_os.h>

Put a thread to sleep for a specific time or until an event occurs.

The thread is woken if the timeout has expired and by a nrf_modem_event_notify call if

  • The context equals the event context.
  • The context is zero (thread wakes on all calls to event notify).
  • The event context is zero (wake all sleeping threads).

The timeout parameter is updated to contain the amount of time left to sleep.

Parameters
contextLibrary context.
[in,out]timeoutTimeout in milliseconds, or NRF_MODEM_OS_FOREVER for no timeout. Specifies the timeout value on input and the remaining time to sleep on output.
Return values
0The thread is woken before the timeout expired.
-NRF_EAGAINThe timeout expired.
-NRF_ESHUTDOWNModem is not initialized, or was shut down.