Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Bluetooth Mesh BLOB Transfer Client model API

Data Structures

struct  bt_mesh_blob_target_pull
 Target node's Pull mode (Pull BLOB Transfer Mode) context used while sending chunks to the Target node. More...
 
struct  bt_mesh_blob_target
 BLOB Transfer Client Target node. More...
 
struct  bt_mesh_blob_xfer_info
 BLOB transfer information. More...
 
struct  bt_mesh_blob_cli_inputs
 BLOB Transfer Client transfer inputs. More...
 
struct  bt_mesh_blob_cli_caps
 Transfer capabilities of a Target node. More...
 
struct  bt_mesh_blob_cli_cb
 Event handler callbacks for the BLOB Transfer Client model. More...
 
struct  bt_mesh_blob_cli
 BLOB Transfer Client model instance. More...
 

Macros

#define BT_MESH_MODEL_BLOB_CLI(_cli)
 BLOB Transfer Client model Composition Data entry.
 

Enumerations

enum  bt_mesh_blob_cli_state {
  BT_MESH_BLOB_CLI_STATE_NONE , BT_MESH_BLOB_CLI_STATE_CAPS_GET , BT_MESH_BLOB_CLI_STATE_START , BT_MESH_BLOB_CLI_STATE_BLOCK_START ,
  BT_MESH_BLOB_CLI_STATE_BLOCK_SEND , BT_MESH_BLOB_CLI_STATE_BLOCK_CHECK , BT_MESH_BLOB_CLI_STATE_XFER_CHECK , BT_MESH_BLOB_CLI_STATE_CANCEL ,
  BT_MESH_BLOB_CLI_STATE_SUSPENDED , BT_MESH_BLOB_CLI_STATE_XFER_PROGRESS_GET
}
 BLOB Transfer Client state. More...
 

Functions

int bt_mesh_blob_cli_caps_get (struct bt_mesh_blob_cli *cli, const struct bt_mesh_blob_cli_inputs *inputs)
 Retrieve transfer capabilities for a list of Target nodes.
 
int bt_mesh_blob_cli_send (struct bt_mesh_blob_cli *cli, const struct bt_mesh_blob_cli_inputs *inputs, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_io *io)
 Perform a BLOB transfer.
 
int bt_mesh_blob_cli_suspend (struct bt_mesh_blob_cli *cli)
 Suspend the active transfer.
 
int bt_mesh_blob_cli_resume (struct bt_mesh_blob_cli *cli)
 Resume the suspended transfer.
 
void bt_mesh_blob_cli_cancel (struct bt_mesh_blob_cli *cli)
 Cancel an ongoing transfer.
 
int bt_mesh_blob_cli_xfer_progress_get (struct bt_mesh_blob_cli *cli, const struct bt_mesh_blob_cli_inputs *inputs)
 Get the progress of BLOB transfer.
 
uint8_t bt_mesh_blob_cli_xfer_progress_active_get (struct bt_mesh_blob_cli *cli)
 Get the current progress of the active transfer in percent.
 
bool bt_mesh_blob_cli_is_busy (struct bt_mesh_blob_cli *cli)
 Get the current state of the BLOB Transfer Client.
 

Detailed Description

Macro Definition Documentation

◆ BT_MESH_MODEL_BLOB_CLI

#define BT_MESH_MODEL_BLOB_CLI (   _cli)

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

Value:
NULL, _cli, &_bt_mesh_blob_cli_cb)
#define BT_MESH_MODEL_ID_BLOB_CLI
BLOB Transfer Client.
Definition: access.h:337
#define BT_MESH_MODEL_CB(_id, _op, _pub, _user_data, _cb)
Composition data SIG model entry with callback functions.
Definition: access.h:491

BLOB Transfer Client model Composition Data entry.

Parameters
_cliPointer to a Bluetooth Mesh BLOB Transfer Client model API instance.

Enumeration Type Documentation

◆ bt_mesh_blob_cli_state

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

BLOB Transfer Client state.

Enumerator
BT_MESH_BLOB_CLI_STATE_NONE 

No transfer is active.

BT_MESH_BLOB_CLI_STATE_CAPS_GET 

Retrieving transfer capabilities.

BT_MESH_BLOB_CLI_STATE_START 

Sending transfer start.

BT_MESH_BLOB_CLI_STATE_BLOCK_START 

Sending block start.

BT_MESH_BLOB_CLI_STATE_BLOCK_SEND 

Sending block chunks.

BT_MESH_BLOB_CLI_STATE_BLOCK_CHECK 

Checking block status.

BT_MESH_BLOB_CLI_STATE_XFER_CHECK 

Checking transfer status.

BT_MESH_BLOB_CLI_STATE_CANCEL 

Cancelling transfer.

BT_MESH_BLOB_CLI_STATE_SUSPENDED 

Transfer is suspended.

BT_MESH_BLOB_CLI_STATE_XFER_PROGRESS_GET 

Checking transfer progress.

Function Documentation

◆ bt_mesh_blob_cli_cancel()

void bt_mesh_blob_cli_cancel ( struct bt_mesh_blob_cli cli)

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

Cancel an ongoing transfer.

Parameters
cliBLOB Transfer Client instance.

◆ bt_mesh_blob_cli_caps_get()

int bt_mesh_blob_cli_caps_get ( struct bt_mesh_blob_cli cli,
const struct bt_mesh_blob_cli_inputs inputs 
)

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

Retrieve transfer capabilities for a list of Target nodes.

Queries the availability and capabilities of all Target nodes, producing a cumulative set of transfer capabilities for the Target nodes, and returning it through the bt_mesh_blob_cli_cb::caps callback.

Retrieving the capabilities may take several seconds, depending on the number of Target nodes and mesh network performance. The end of the procedure is indicated through the bt_mesh_blob_cli_cb::caps callback.

This procedure is not required, but strongly recommended as a preparation for a transfer to maximize performance and the chances of success.

Parameters
cliBLOB Transfer Client instance.
inputsStatically allocated BLOB Transfer Client transfer inputs.
Returns
0 on success, or (negative) error code otherwise.

◆ bt_mesh_blob_cli_is_busy()

bool bt_mesh_blob_cli_is_busy ( struct bt_mesh_blob_cli cli)

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

Get the current state of the BLOB Transfer Client.

Parameters
cliBLOB Transfer Client instance.
Returns
true if the BLOB Transfer Client is currently participating in a transfer or retrieving the capabilities and false otherwise.

◆ bt_mesh_blob_cli_resume()

int bt_mesh_blob_cli_resume ( struct bt_mesh_blob_cli cli)

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

Resume the suspended transfer.

Parameters
cliBLOB Transfer Client instance.
Returns
0 on success, or (negative) error code otherwise.

◆ bt_mesh_blob_cli_send()

int bt_mesh_blob_cli_send ( struct bt_mesh_blob_cli cli,
const struct bt_mesh_blob_cli_inputs inputs,
const struct bt_mesh_blob_xfer xfer,
const struct bt_mesh_blob_io io 
)

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

Perform a BLOB transfer.

Starts sending the transfer to the Target nodes. Only Target nodes with a status of BT_MESH_BLOB_SUCCESS will be considered.

The transfer will keep going either until all Target nodes have been dropped, or the full BLOB has been sent.

The BLOB transfer may take several minutes, depending on the number of Target nodes, size of the BLOB and mesh network performance. The end of the transfer is indicated through the bt_mesh_blob_cli_cb::end callback.

A Client only supports one transfer at the time.

Parameters
cliBLOB Transfer Client instance.
inputsStatically allocated BLOB Transfer Client transfer inputs.
xferStatically allocated transfer parameters.
ioBLOB stream to read the transfer from.
Returns
0 on success, or (negative) error code otherwise.

◆ bt_mesh_blob_cli_suspend()

int bt_mesh_blob_cli_suspend ( struct bt_mesh_blob_cli cli)

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

Suspend the active transfer.

Parameters
cliBLOB Transfer Client instance.
Returns
0 on success, or (negative) error code otherwise.

◆ bt_mesh_blob_cli_xfer_progress_active_get()

uint8_t bt_mesh_blob_cli_xfer_progress_active_get ( struct bt_mesh_blob_cli cli)

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

Get the current progress of the active transfer in percent.

Parameters
cliBLOB Transfer Client instance.
Returns
The current transfer progress, or 0 if no transfer is active.

◆ bt_mesh_blob_cli_xfer_progress_get()

int bt_mesh_blob_cli_xfer_progress_get ( struct bt_mesh_blob_cli cli,
const struct bt_mesh_blob_cli_inputs inputs 
)

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

Get the progress of BLOB transfer.

This function can only be used if the BLOB Transfer Client is currently not performing a BLOB transfer. To get progress of the active BLOB transfer, use the bt_mesh_blob_cli_xfer_progress_active_get function.

Parameters
cliBLOB Transfer Client instance.
inputsStatically allocated BLOB Transfer Client transfer inputs.
Returns
0 on success, or (negative) error code otherwise.