nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches

◆ sms_register_listener()

int sms_register_listener ( sms_callback_t  listener,
void *  context 
)

#include <include/modem/sms.h>

Register a new listener to SMS library.

Also registers to modem's SMS service if it is not already subscribed.

A listener is identified by a unique handle value. This handle should be used to unregister the listener. A listener can be registered multiple times with the same or a different context.

Parameters
[in]listenerCallback function. Cannot be null.
[in]contextUser context. Can be null if not used.
Return values
-EINVALInvalid parameter.
-ENOSPCList of observers is full.
-EBUSYIndicates that one SMS client has already been registered towards the modem and SMS subscriber module is not able to do it.
-ENOMEMOut of memory.
Returns
Handle identifying the listener, or a negative value if an error occurred.