Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hawkBit Firmware Over-the-Air

hawkBit Firmware Over-the-Air for Zephyr Project. More...

Topics

 hawkBit autohandler API
 hawkBit autohandler API.
 
 hawkBit configuration API
 hawkBit configuration API.
 

Typedefs

typedef int(* hawkbit_config_device_data_cb_handler_t) (const char *device_id, uint8_t *buffer, const size_t buffer_size)
 Callback to provide the custom data to the hawkBit server.
 
typedef bool(* hawkbit_get_device_identity_cb_handler_t) (char *id, int id_max_len)
 Callback to get the device identity.
 

Enumerations

enum  hawkbit_response {
  HAWKBIT_NO_RESPONSE , HAWKBIT_NETWORKING_ERROR , HAWKBIT_UNCONFIRMED_IMAGE , HAWKBIT_PERMISSION_ERROR ,
  HAWKBIT_METADATA_ERROR , HAWKBIT_DOWNLOAD_ERROR , HAWKBIT_OK , HAWKBIT_UPDATE_INSTALLED ,
  HAWKBIT_NO_UPDATE , HAWKBIT_CANCEL_UPDATE , HAWKBIT_NOT_INITIALIZED , HAWKBIT_PROBE_IN_PROGRESS
}
 Response message from hawkBit. More...
 

Functions

int hawkbit_set_custom_data_cb (hawkbit_config_device_data_cb_handler_t cb)
 Set the custom data callback.
 
int hawkbit_init (void)
 Init the flash partition.
 
enum hawkbit_response hawkbit_probe (void)
 The hawkBit probe verify if there is some update to be performed.
 
void hawkbit_reboot (void)
 Request system to reboot.
 
int hawkbit_set_device_identity_cb (hawkbit_get_device_identity_cb_handler_t cb)
 Set the device identity callback.
 
int hawkbit_reset_action_id (void)
 Resets the hawkBit action id, that is saved in settings.
 

Detailed Description

hawkBit Firmware Over-the-Air for Zephyr Project.

Typedef Documentation

◆ hawkbit_config_device_data_cb_handler_t

typedef int(* hawkbit_config_device_data_cb_handler_t) (const char *device_id, uint8_t *buffer, const size_t buffer_size)

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Callback to provide the custom data to the hawkBit server.

This callback is used to provide the custom data to the hawkBit server. The custom data is used to provide the hawkBit server with the device specific data.

Parameters
device_idThe device ID.
bufferThe buffer to store the json.
buffer_sizeThe size of the buffer.

◆ hawkbit_get_device_identity_cb_handler_t

typedef bool(* hawkbit_get_device_identity_cb_handler_t) (char *id, int id_max_len)

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Callback to get the device identity.

Parameters
idPointer to the buffer to store the device identity
id_max_lenThe maximum length of the buffer

Enumeration Type Documentation

◆ hawkbit_response

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Response message from hawkBit.

These messages are used to inform the server and the user about the process status of the hawkBit and also used to standardize the errors that may occur.

Enumerator
HAWKBIT_NO_RESPONSE 

matching events were not received within the specified time

HAWKBIT_NETWORKING_ERROR 

fail to connect to the hawkBit server

HAWKBIT_UNCONFIRMED_IMAGE 

image is unconfirmed

HAWKBIT_PERMISSION_ERROR 

fail to get the permission to access the hawkBit server

HAWKBIT_METADATA_ERROR 

fail to parse or to encode the metadata

HAWKBIT_DOWNLOAD_ERROR 

fail while downloading the update package

HAWKBIT_OK 

image was already updated

HAWKBIT_UPDATE_INSTALLED 

an update was installed.

Reboot is required to apply it

HAWKBIT_NO_UPDATE 

no update was available

HAWKBIT_CANCEL_UPDATE 

update was cancelled by the server

HAWKBIT_NOT_INITIALIZED 

hawkBit is not initialized

HAWKBIT_PROBE_IN_PROGRESS 

probe is currently running

Function Documentation

◆ hawkbit_init()

int hawkbit_init ( void )

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Init the flash partition.

Return values
0on success.
-errnoif init fails.

◆ hawkbit_probe()

enum hawkbit_response hawkbit_probe ( void )

#include <zephyr/mgmt/hawkbit/hawkbit.h>

The hawkBit probe verify if there is some update to be performed.

Returns
A value from hawkbit_response.

◆ hawkbit_reboot()

void hawkbit_reboot ( void )

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Request system to reboot.

◆ hawkbit_reset_action_id()

int hawkbit_reset_action_id ( void )

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Resets the hawkBit action id, that is saved in settings.

This should be done after changing the hawkBit server.

Return values
0on success.
-EAGAINif probe is currently running.
-EIOif the action id could not be reset.

◆ hawkbit_set_custom_data_cb()

int hawkbit_set_custom_data_cb ( hawkbit_config_device_data_cb_handler_t cb)

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Set the custom data callback.

This function is used to set the custom data callback. The callback is used to provide the custom data to the hawkBit server.

Parameters
cbThe callback function.
Return values
0on success.
-EINVALif the callback is NULL.

◆ hawkbit_set_device_identity_cb()

int hawkbit_set_device_identity_cb ( hawkbit_get_device_identity_cb_handler_t cb)

#include <zephyr/mgmt/hawkbit/hawkbit.h>

Set the device identity callback.

This function is used to set a custom device identity callback.

Parameters
cbThe callback function.
Return values
0on success.
-EINVALif the callback is NULL.