20#ifndef ZEPHYR_INCLUDE_MGMT_HAWKBIT_EVENT_H_
21#define ZEPHYR_INCLUDE_MGMT_HAWKBIT_EVENT_H_
68struct hawkbit_event_callback;
96struct hawkbit_event_callback {
119#define HAWKBIT_EVENT_CREATE_CALLBACK(_callback, _handler, _event) \
120 struct hawkbit_event_callback _callback = { \
121 .handler = _handler, \
136 __ASSERT(callback,
"Callback pointer should not be NULL");
137 __ASSERT(handler,
"Callback handler pointer should not be NULL");
139 callback->handler = handler;
140 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:132
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:81
int hawkbit_event_add_callback(struct hawkbit_event_callback *cb)
Add an application callback.
hawkbit_event_type
hawkBit event type.
Definition event.h:32
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:44
@ HAWKBIT_EVENT_END_RUN
Event triggered after the hawkBit run ends.
Definition event.h:58
@ HAWKBIT_EVENT_BEFORE_REBOOT
Event triggered before hawkBit does a reboot.
Definition event.h:60
@ HAWKBIT_EVENT_ERROR_PERMISSION
Event triggered when there was a permission error.
Definition event.h:38
@ HAWKBIT_EVENT_ERROR
Event triggered when there was an error.
Definition event.h:34
@ HAWKBIT_EVENT_NO_UPDATE
Event triggered when there is no update available.
Definition event.h:48
@ HAWKBIT_EVENT_CONFIRMED_CURRENT_IMAGE
Event triggered during initialisation when the current image is confirmed and the old image is erased...
Definition event.h:65
@ HAWKBIT_EVENT_UPDATE_DOWNLOADED
Event triggered when a new update was downloaded.
Definition event.h:46
@ HAWKBIT_EVENT_ERROR_DOWNLOAD
Event triggered when there was a download error.
Definition event.h:42
@ HAWKBIT_EVENT_END_DOWNLOAD
Event triggered after the download ends.
Definition event.h:54
@ HAWKBIT_EVENT_START_DOWNLOAD
Event triggered before the download starts.
Definition event.h:52
@ HAWKBIT_EVENT_START_RUN
Event triggered before the hawkBit run starts.
Definition event.h:56
@ HAWKBIT_EVENT_ERROR_NETWORKING
Event triggered when there was a networking error.
Definition event.h:36
@ HAWKBIT_EVENT_CANCEL_UPDATE
Event triggered when the update was canceled by the server.
Definition event.h:50
@ HAWKBIT_EVENT_ERROR_METADATA
Event triggered when there was a metadata error.
Definition event.h:40
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:44
Header file for the single-linked list API.