7#ifndef SSF_CLIENT_NOTIF_H__
8#define SSF_CLIENT_NOTIF_H__
21 size_t *payload_len_out);
83#define SSF_CLIENT_NOTIF_LISTENER_DEFINE(_name, _srvc_name, _notif_decode, _handler) \
84 static int _handler(struct ssf_notification *notif, void *context); \
85 static struct ssf_client_notif_listener _name = { \
86 .id = (CONFIG_SSF_##_srvc_name##_SERVICE_ID), \
87 .version = (CONFIG_SSF_##_srvc_name##_SERVICE_VERSION), \
88 .notif_decode = (ssf_notif_decoder)_notif_decode, \
89 .handler = _handler, \
90 .is_registered = false \
int ssf_client_notif_deregister(struct ssf_client_notif_listener *listener)
De-register a listener. Stops the listener's handler from being called when receiving notifications f...
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
int(* ssf_notif_handler)(struct ssf_notification *notif, void *context)
SSF notification handler prototype.
Definition ssf_client_notif.h:49
void ssf_client_notif_decode_done(struct ssf_notification *notif)
Must be invoked from ssf_notif_handler to free transport layer buffer when the request have been deco...
int ssf_client_notif_decode(const struct ssf_notification *notif, void *decoded_notif)
Decode a received notification.
int ssf_client_notif_register(struct ssf_client_notif_listener *listener, void *context)
Register a listener. Enables the listener's handler to be called when receiving notifications from se...
ssf_notif_handler handler
Definition ssf_client_notif.h:62
ssf_notif_decoder notif_decode
Definition ssf_client_notif.h:60
uint16_t id
Definition ssf_client_notif.h:56
void * context
Definition ssf_client_notif.h:64
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
size_t data_len
Definition ssf_client_notif.h:31
const uint8_t * data
Definition ssf_client_notif.h:29
const uint8_t * pkt
Definition ssf_client_notif.h:36
ssf_notif_decoder notif_decode
Definition ssf_client_notif.h:38
Structure to hold an incoming notification. Decode with ssf_client_notif_decode.
Definition ssf_client_notif.h:27