Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
|
API for the Bluetooth Mesh Firmware Update Client model More...
Data Structures | |
struct | bt_mesh_dfu_target |
DFU Target node. More... | |
struct | bt_mesh_dfu_metadata_status |
Metadata status response. More... | |
struct | bt_mesh_dfu_target_status |
DFU Target node status parameters. More... | |
struct | bt_mesh_dfu_cli_cb |
Firmware Update Client event callbacks. More... | |
struct | bt_mesh_dfu_cli |
Firmware Update Client model instance. More... | |
struct | bt_mesh_dfu_cli_xfer_blob_params |
BLOB parameters for Firmware Update Client transfer: More... | |
struct | bt_mesh_dfu_cli_xfer |
Firmware Update Client transfer parameters: More... | |
Macros | |
#define | BT_MESH_DFU_CLI_INIT(_handlers) |
Initialization parameters for the Firmware Uppdate Client model. | |
#define | BT_MESH_MODEL_DFU_CLI(_cli) |
Firmware Update Client model Composition Data entry. | |
Typedefs | |
typedef enum bt_mesh_dfu_iter(* | bt_mesh_dfu_img_cb_t) (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, uint8_t total, const struct bt_mesh_dfu_img *img, void *cb_data) |
DFU image callback. | |
Functions | |
int | bt_mesh_dfu_cli_send (struct bt_mesh_dfu_cli *cli, const struct bt_mesh_blob_cli_inputs *inputs, const struct bt_mesh_blob_io *io, const struct bt_mesh_dfu_cli_xfer *xfer) |
Start distributing a DFU. | |
int | bt_mesh_dfu_cli_suspend (struct bt_mesh_dfu_cli *cli) |
Suspend a DFU transfer. | |
int | bt_mesh_dfu_cli_resume (struct bt_mesh_dfu_cli *cli) |
Resume the suspended transfer. | |
int | bt_mesh_dfu_cli_cancel (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx) |
Cancel a DFU transfer. | |
int | bt_mesh_dfu_cli_apply (struct bt_mesh_dfu_cli *cli) |
Apply the completed DFU transfer. | |
int | bt_mesh_dfu_cli_confirm (struct bt_mesh_dfu_cli *cli) |
Confirm that the active transfer has been applied on the Target nodes. | |
uint8_t | bt_mesh_dfu_cli_progress (struct bt_mesh_dfu_cli *cli) |
Get progress as a percentage of completion. | |
bool | bt_mesh_dfu_cli_is_busy (struct bt_mesh_dfu_cli *cli) |
Check whether a DFU transfer is in progress. | |
int | bt_mesh_dfu_cli_imgs_get (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx, bt_mesh_dfu_img_cb_t cb, void *cb_data, uint8_t max_count) |
Perform a DFU image list request. | |
int | bt_mesh_dfu_cli_metadata_check (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t img_idx, const struct bt_mesh_dfu_slot *slot, struct bt_mesh_dfu_metadata_status *rsp) |
Perform a metadata check for the given DFU image slot. | |
int | bt_mesh_dfu_cli_status_get (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx, struct bt_mesh_dfu_target_status *rsp) |
Get the status of a Target node. | |
int32_t | bt_mesh_dfu_cli_timeout_get (void) |
Get the current procedure timeout value. | |
void | bt_mesh_dfu_cli_timeout_set (int32_t timeout) |
Set the procedure timeout value. | |
API for the Bluetooth Mesh Firmware Update Client model
#define BT_MESH_DFU_CLI_INIT | ( | _handlers | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Initialization parameters for the Firmware Uppdate Client model.
_handlers | Handler callback structure. |
#define BT_MESH_MODEL_DFU_CLI | ( | _cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Firmware Update Client model Composition Data entry.
_cli | Pointer to a Firmware Uppdate Client model instance. |
typedef enum bt_mesh_dfu_iter(* bt_mesh_dfu_img_cb_t) (struct bt_mesh_dfu_cli *cli, struct bt_mesh_msg_ctx *ctx, uint8_t idx, uint8_t total, const struct bt_mesh_dfu_img *img, void *cb_data) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
DFU image callback.
The image callback is called for every DFU image on the Target node when calling bt_mesh_dfu_cli_imgs_get.
cli | Firmware Update Client model instance. |
ctx | Message context of the received message. |
idx | Image index. |
total | Total number of images on the Target node. |
img | Image information for the given image index. |
cb_data | Callback data. |
BT_MESH_DFU_ITER_STOP | Stop iterating through the image list and return from bt_mesh_dfu_cli_imgs_get. |
BT_MESH_DFU_ITER_CONTINUE | Continue iterating through the image list if any images remain. |
int bt_mesh_dfu_cli_apply | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Apply the completed DFU transfer.
A transfer can only be applied after it has ended successfully. The Firmware Update Client's applied
callback is called at the end of the apply procedure.
cli | Firmware Update Client model instance. |
int bt_mesh_dfu_cli_cancel | ( | struct bt_mesh_dfu_cli * | cli, |
struct bt_mesh_msg_ctx * | ctx ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Cancel a DFU transfer.
Will cancel the ongoing DFU transfer, or the transfer on a specific Target node if ctx
is valid.
cli | Firmware Update Client model instance. |
ctx | Message context, or NULL to cancel the ongoing DFU transfer. |
int bt_mesh_dfu_cli_confirm | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Confirm that the active transfer has been applied on the Target nodes.
A transfer can only be confirmed after it has been applied. The Firmware Update Client's confirmed
callback is called at the end of the confirm procedure.
Target nodes that have reported the effect as BT_MESH_DFU_EFFECT_UNPROV are expected to not respond to the query, and will fail if they do.
cli | Firmware Update Client model instance. |
int bt_mesh_dfu_cli_imgs_get | ( | struct bt_mesh_dfu_cli * | cli, |
struct bt_mesh_msg_ctx * | ctx, | ||
bt_mesh_dfu_img_cb_t | cb, | ||
void * | cb_data, | ||
uint8_t | max_count ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Perform a DFU image list request.
Requests the full list of DFU images on a Target node, and iterates through them, calling the cb
for every image.
The DFU image list request can be used to determine which image index the Target node holds its different firmwares in.
Waits for a response until the procedure timeout expires.
cli | Firmware Update Client model instance. |
ctx | Message context. |
cb | Callback to call for each image index. |
cb_data | Callback data to pass to cb . |
max_count | Max number of images to return. |
bool bt_mesh_dfu_cli_is_busy | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Check whether a DFU transfer is in progress.
cli | Firmware Update Client model instance. |
int bt_mesh_dfu_cli_metadata_check | ( | struct bt_mesh_dfu_cli * | cli, |
struct bt_mesh_msg_ctx * | ctx, | ||
uint8_t | img_idx, | ||
const struct bt_mesh_dfu_slot * | slot, | ||
struct bt_mesh_dfu_metadata_status * | rsp ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Perform a metadata check for the given DFU image slot.
The metadata check procedure allows the Firmware Update Client to check if a Target node will accept a transfer of this DFU image slot, and what the effect would be.
Waits for a response until the procedure timeout expires.
cli | Firmware Update Client model instance. |
ctx | Message context. |
img_idx | Target node's image index to check. |
slot | DFU image slot to check for. |
rsp | Metadata status response buffer. |
uint8_t bt_mesh_dfu_cli_progress | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Get progress as a percentage of completion.
cli | Firmware Update Client model instance. |
int bt_mesh_dfu_cli_resume | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Resume the suspended transfer.
cli | Firmware Update Client instance. |
int bt_mesh_dfu_cli_send | ( | struct bt_mesh_dfu_cli * | cli, |
const struct bt_mesh_blob_cli_inputs * | inputs, | ||
const struct bt_mesh_blob_io * | io, | ||
const struct bt_mesh_dfu_cli_xfer * | xfer ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Start distributing a DFU.
Starts distribution of the firmware in the given slot to the list of DFU Target nodes in ctx
. The transfer runs in the background, and its end is signalled through the bt_mesh_dfu_cli_cb::ended callback.
targets
list must point to a list of bt_mesh_dfu_target nodes.cli | Firmware Update Client model instance. |
inputs | BLOB Transfer Client transfer inputs. |
io | BLOB stream to read BLOB from. |
xfer | Firmware Update Client transfer parameters. |
int bt_mesh_dfu_cli_status_get | ( | struct bt_mesh_dfu_cli * | cli, |
struct bt_mesh_msg_ctx * | ctx, | ||
struct bt_mesh_dfu_target_status * | rsp ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Get the status of a Target node.
cli | Firmware Update Client model instance. |
ctx | Message context. |
rsp | Response data buffer. |
int bt_mesh_dfu_cli_suspend | ( | struct bt_mesh_dfu_cli * | cli | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Suspend a DFU transfer.
cli | Firmware Update Client instance. |
int32_t bt_mesh_dfu_cli_timeout_get | ( | void | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Get the current procedure timeout value.
void bt_mesh_dfu_cli_timeout_set | ( | int32_t | timeout | ) |
#include <zephyr/bluetooth/mesh/dfu_cli.h>
Set the procedure timeout value.
timeout | The new procedure timeout. |