Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hawkBit Firmware Over-the-Air

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

Data Structures

struct  hawkbit_runtime_config
 hawkBit configuration structure. More...
 

Macros

#define HAWKBIT_JSON_URL   "/default/controller/v1"
 

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_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.
 
void hawkbit_autohandler (void)
 Runs hawkBit probe and hawkBit update automatically.
 
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_set_config (struct hawkbit_runtime_config *config)
 Set the hawkBit server configuration settings.
 
struct hawkbit_runtime_config hawkbit_get_config (void)
 Get the hawkBit server configuration settings.
 
static int hawkbit_set_server_addr (char *addr_str)
 Set the hawkBit server address.
 
static int hawkbit_set_server_port (uint16_t port)
 Set the hawkBit server port.
 
static int hawkbit_set_ddi_security_token (char *token)
 Set the hawkBit security token.
 
static int hawkbit_set_tls_tag (sec_tag_t tag)
 Set the hawkBit TLS tag.
 
static char * hawkbit_get_server_addr (void)
 Get the hawkBit server address.
 
static uint16_t hawkbit_get_server_port (void)
 Get the hawkBit server port.
 
static char * hawkbit_get_ddi_security_token (void)
 Get the hawkBit security token.
 
static sec_tag_t hawkbit_get_tls_tag (void)
 Get the hawkBit TLS tag.
 
int32_t hawkbit_get_action_id (void)
 Get the hawkBit action id.
 
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.

Macro Definition Documentation

◆ HAWKBIT_JSON_URL

#define HAWKBIT_JSON_URL   "/default/controller/v1"

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 <include/zephyr/mgmt/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 <include/zephyr/mgmt/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 <include/zephyr/mgmt/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_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 

Function Documentation

◆ hawkbit_autohandler()

void hawkbit_autohandler ( void  )

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

Runs hawkBit probe and hawkBit update automatically.

The hawkbit_autohandler handles the whole process in pre-determined time intervals.

◆ hawkbit_get_action_id()

int32_t hawkbit_get_action_id ( void  )

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

Get the hawkBit action id.

Returns
Action id.

◆ hawkbit_get_config()

struct hawkbit_runtime_config hawkbit_get_config ( void  )

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

Get the hawkBit server configuration settings.

Returns
Configuration settings.

◆ hawkbit_get_ddi_security_token()

static char * hawkbit_get_ddi_security_token ( void  )
inlinestatic

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

Get the hawkBit security token.

Returns
Security token.

◆ hawkbit_get_server_addr()

static char * hawkbit_get_server_addr ( void  )
inlinestatic

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

Get the hawkBit server address.

Returns
Server address.

◆ hawkbit_get_server_port()

static uint16_t hawkbit_get_server_port ( void  )
inlinestatic

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

Get the hawkBit server port.

Returns
Server port.

◆ hawkbit_get_tls_tag()

static sec_tag_t hawkbit_get_tls_tag ( void  )
inlinestatic

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

Get the hawkBit TLS tag.

Returns
TLS tag.

◆ hawkbit_init()

int hawkbit_init ( void  )

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

Init the flash partition.

Return values
0on success.
-errnoif init fails.

◆ hawkbit_probe()

enum hawkbit_response hawkbit_probe ( void  )

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

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

Return values
HAWKBIT_NETWORKING_ERRORfail to connect to the hawkBit server.
HAWKBIT_UNCONFIRMED_IMAGEimage is unconfirmed.
HAWKBIT_PERMISSION_ERRORfail to get the permission to access the hawkBit server.
HAWKBIT_METADATA_ERRORfail to parse or to encode the metadata.
HAWKBIT_DOWNLOAD_ERRORfail while downloading the update package.
HAWKBIT_OKif the image was already updated.
HAWKBIT_UPDATE_INSTALLEDif an update was installed. Reboot is required to apply it.
HAWKBIT_NO_UPDATEif no update was available.
HAWKBIT_CANCEL_UPDATEif the update was cancelled by the server.
HAWKBIT_NOT_INITIALIZEDif hawkBit is not initialized.
HAWKBIT_PROBE_IN_PROGRESSif probe is currently running.

◆ hawkbit_reboot()

void hawkbit_reboot ( void  )

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

Request system to reboot.

◆ hawkbit_reset_action_id()

int hawkbit_reset_action_id ( void  )

#include <include/zephyr/mgmt/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_config()

int hawkbit_set_config ( struct hawkbit_runtime_config config)

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

Set the hawkBit server configuration settings.

Parameters
configConfiguration settings to set.
Return values
0on success.
-EAGAINif probe is currently running.

◆ hawkbit_set_custom_data_cb()

int hawkbit_set_custom_data_cb ( hawkbit_config_device_data_cb_handler_t  cb)

#include <include/zephyr/mgmt/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_ddi_security_token()

static int hawkbit_set_ddi_security_token ( char *  token)
inlinestatic

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

Set the hawkBit security token.

Parameters
tokenSecurity token to set.
Return values
0on success.
-EAGAINif probe is currently running.

◆ hawkbit_set_device_identity_cb()

int hawkbit_set_device_identity_cb ( hawkbit_get_device_identity_cb_handler_t  cb)

#include <include/zephyr/mgmt/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.

◆ hawkbit_set_server_addr()

static int hawkbit_set_server_addr ( char *  addr_str)
inlinestatic

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

Set the hawkBit server address.

Parameters
addr_strServer address to set.
Return values
0on success.
-EAGAINif probe is currently running.

◆ hawkbit_set_server_port()

static int hawkbit_set_server_port ( uint16_t  port)
inlinestatic

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

Set the hawkBit server port.

Parameters
portServer port to set.
Return values
0on success.
-EAGAINif probe is currently running.

◆ hawkbit_set_tls_tag()

static int hawkbit_set_tls_tag ( sec_tag_t  tag)
inlinestatic

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

Set the hawkBit TLS tag.

Parameters
tagTLS tag to set.
Return values
0on success.
-EAGAINif probe is currently running.