Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

API for the Bluetooth Mesh Firmware Update Server model. More...

Data Structures

struct  bt_mesh_dfu_srv_cb
 Firmware Update Server event callbacks. More...
 
struct  bt_mesh_dfu_srv
 Firmware Update Server instance. More...
 

Macros

#define BT_MESH_DFU_SRV_INIT(_handlers, _imgs, _img_count)
 Initialization parameters for Firmware Update Server model.
 
#define BT_MESH_MODEL_DFU_SRV(_srv)
 Firmware Update Server model entry.
 

Functions

void bt_mesh_dfu_srv_verified (struct bt_mesh_dfu_srv *srv)
 Accept the received DFU transfer.
 
void bt_mesh_dfu_srv_rejected (struct bt_mesh_dfu_srv *srv)
 Reject the received DFU transfer.
 
void bt_mesh_dfu_srv_cancel (struct bt_mesh_dfu_srv *srv)
 Cancel the ongoing DFU transfer.
 
void bt_mesh_dfu_srv_applied (struct bt_mesh_dfu_srv *srv)
 Confirm that the received DFU transfer was applied.
 
bool bt_mesh_dfu_srv_is_busy (const struct bt_mesh_dfu_srv *srv)
 Check if the Firmware Update Server is busy processing a transfer.
 
uint8_t bt_mesh_dfu_srv_progress (const struct bt_mesh_dfu_srv *srv)
 Get the progress of the current DFU procedure, in percent.
 

Detailed Description

API for the Bluetooth Mesh Firmware Update Server model.

Macro Definition Documentation

◆ BT_MESH_DFU_SRV_INIT

#define BT_MESH_DFU_SRV_INIT (   _handlers,
  _imgs,
  _img_count 
)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Value:
{ \
.blob = { .cb = &_bt_mesh_dfu_srv_blob_cb }, .cb = _handlers, \
.imgs = _imgs, .img_count = _img_count, \
}

Initialization parameters for Firmware Update Server model.

Parameters
_handlersDFU handler function structure.
_imgsList of bt_mesh_dfu_img managed by this Server.
_img_countNumber of DFU images managed by this Server.

◆ BT_MESH_MODEL_DFU_SRV

#define BT_MESH_MODEL_DFU_SRV (   _srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Value:
BT_MESH_MODEL_BLOB_SRV(&(_srv)->blob), \
BT_MESH_MODEL_CB(BT_MESH_MODEL_ID_DFU_SRV, _bt_mesh_dfu_srv_op, NULL, \
_srv, &_bt_mesh_dfu_srv_cb)
#define BT_MESH_MODEL_ID_DFU_SRV
Firmware Update Server.
Definition: access.h:347
#define BT_MESH_MODEL_BLOB_SRV(_srv)
BLOB Transfer Server model composition data entry.
Definition: blob_srv.h:43

Firmware Update Server model entry.

Parameters
_srvPointer to a Firmware Update Server model instance.

Function Documentation

◆ bt_mesh_dfu_srv_applied()

void bt_mesh_dfu_srv_applied ( struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Confirm that the received DFU transfer was applied.

Should be called as a result of the bt_mesh_dfu_srv_cb::apply callback.

Parameters
srvFirmware Update Server instance.

◆ bt_mesh_dfu_srv_cancel()

void bt_mesh_dfu_srv_cancel ( struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Cancel the ongoing DFU transfer.

Parameters
srvFirmware Update Server instance.

◆ bt_mesh_dfu_srv_is_busy()

bool bt_mesh_dfu_srv_is_busy ( const struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Check if the Firmware Update Server is busy processing a transfer.

Parameters
srvFirmware Update Server instance.
Returns
true if a DFU procedure is in progress, false otherwise.

◆ bt_mesh_dfu_srv_progress()

uint8_t bt_mesh_dfu_srv_progress ( const struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Get the progress of the current DFU procedure, in percent.

Parameters
srvFirmware Update Server instance.
Returns
The current transfer progress in percent.

◆ bt_mesh_dfu_srv_rejected()

void bt_mesh_dfu_srv_rejected ( struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Reject the received DFU transfer.

Should be called at the end of a successful DFU transfer.

If the DFU transfer completes successfully, the application should verify the image validity (including any image authentication or integrity checks), and call this function if one of the checks fail.

Parameters
srvFirmware Update Server instance.

◆ bt_mesh_dfu_srv_verified()

void bt_mesh_dfu_srv_verified ( struct bt_mesh_dfu_srv srv)

#include <zephyr/bluetooth/mesh/dfu_srv.h>

Accept the received DFU transfer.

Should be called at the end of a successful DFU transfer.

If the DFU transfer completes successfully, the application should verify the image validity (including any image authentication or integrity checks), and call this function if the image is ready to be applied.

Parameters
srvFirmware Update Server instance.