19#ifndef ZEPHYR_INCLUDE_MGMT_HAWKBIT_EVENT_H_
20#define ZEPHYR_INCLUDE_MGMT_HAWKBIT_EVENT_H_
62struct hawkbit_event_callback;
90struct hawkbit_event_callback {
113#define HAWKBIT_EVENT_CREATE_CALLBACK(_callback, _handler, _event) \
114 struct hawkbit_event_callback _callback = { \
115 .handler = _handler, \
130 __ASSERT(callback,
"Callback pointer should not be NULL");
131 __ASSERT(handler,
"Callback handler pointer should not be NULL");
133 callback->handler = handler;
134 callback->event = event;
static void hawkbit_event_init_callback(struct hawkbit_event_callback *callback, hawkbit_event_callback_handler_t handler, enum hawkbit_event_type event)
Helper to initialize a struct hawkbit_event_callback properly.
Definition event.h:126
void(* hawkbit_event_callback_handler_t)(struct hawkbit_event_callback *cb, enum hawkbit_event_type event)
Define the application callback handler function signature.
Definition event.h:75
int hawkbit_event_add_callback(struct hawkbit_event_callback *cb)
Add an application callback.
hawkbit_event_type
hawkBit event type.
Definition event.h:31
int hawkbit_event_remove_callback(struct hawkbit_event_callback *cb)
Remove an application callback.
@ HAWKBIT_EVENT_ERROR_ALLOC
Event triggered when there was an allocation error.
Definition event.h:43
@ HAWKBIT_EVENT_END_RUN
Event triggered after the hawkBit run ends.
Definition event.h:57
@ HAWKBIT_EVENT_BEFORE_REBOOT
Event triggered before hawkBit does a reboot.
Definition event.h:59
@ HAWKBIT_EVENT_ERROR_PERMISSION
Event triggered when there was a permission error.
Definition event.h:37
@ HAWKBIT_EVENT_ERROR
Event triggered when there was an error.
Definition event.h:33
@ HAWKBIT_EVENT_NO_UPDATE
Event triggered when there is no update available.
Definition event.h:47
@ HAWKBIT_EVENT_UPDATE_DOWNLOADED
Event triggered when a new update was downloaded.
Definition event.h:45
@ HAWKBIT_EVENT_ERROR_DOWNLOAD
Event triggered when there was a download error.
Definition event.h:41
@ HAWKBIT_EVENT_END_DOWNLOAD
Event triggered after the download ends.
Definition event.h:53
@ HAWKBIT_EVENT_START_DOWNLOAD
Event triggered before the download starts.
Definition event.h:51
@ HAWKBIT_EVENT_START_RUN
Event triggered before the hawkBit run starts.
Definition event.h:55
@ HAWKBIT_EVENT_ERROR_NETWORKING
Event triggered when there was a networking error.
Definition event.h:35
@ HAWKBIT_EVENT_CANCEL_UPDATE
Event triggered when the update was canceled by the server.
Definition event.h:49
@ HAWKBIT_EVENT_ERROR_METADATA
Event triggered when there was a metadata error.
Definition event.h:39
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39