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

◆ SSF_CLIENT_NOTIF_LISTENER_DEFINE

#define SSF_CLIENT_NOTIF_LISTENER_DEFINE (   _name,
  _srvc_name,
  _notif_decode,
  _handler 
)
Value:
static int _handler(struct ssf_notification *notif, void *context); \
static struct ssf_client_notif_listener _name = { \
.id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \
.version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \
.notif_decode = (ssf_notif_decoder)_notif_decode, \
.handler = _handler, \
.is_registered = false \
}
int(* ssf_notif_decoder)(const uint8_t *payload, size_t payload_len, void *result, size_t *payload_len_out)
SSF notification decode function prototype. Functions of this type are typically generated from cddl ...
Definition: ssf_client_notif.h:20
ssf_notif_handler handler
Definition: ssf_client_notif.h:62
uint16_t id
Definition: ssf_client_notif.h:56
bool is_registered
Definition: ssf_client_notif.h:66
uint16_t version
Definition: ssf_client_notif.h:58
SSF notification listener.
Definition: ssf_client_notif.h:54
Structure to hold an incoming notification. Decode with ssf_client_notif_decode.
Definition: ssf_client_notif.h:27

Define a notification listener, that is used for invoking the correct handler function when receiving notifications from the server. The listener must be registered with ssf_client_notif_register before notifications can be received.

Parameters
_nameName of the notification listener.
[in]_srvc_nameShort uppercase service name. Must match the service_name variable used when specifying the service with the Kconfig.template.service template.
[in]_notif_decodeFunction of type ssf_notif_decoder. Used when decoding notifications.
[in]_handlerFunction of type ssf_notif_handler. Invoked when receiving a notification with the associated service id.