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

BLOB stream. More...

#include <blob.h>

Data Fields

int(* open )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, enum bt_mesh_blob_io_mode mode)
 Open callback.
 
void(* close )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer)
 Close callback.
 
int(* block_start )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block)
 Block start callback.
 
void(* block_end )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block)
 Block end callback.
 
int(* wr )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block, const struct bt_mesh_blob_chunk *chunk)
 Chunk data write callback.
 
int(* rd )(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block, const struct bt_mesh_blob_chunk *chunk)
 Chunk data read callback.
 

Detailed Description

BLOB stream.

Field Documentation

◆ block_end

void(* bt_mesh_blob_io::block_end) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block)

Block end callback.

Called when the current block has been transmitted in full. No data from this block will be requested again, and the application data associated with this block may be discarded.

Parameters
ioBLOB stream.
xferBLOB transfer.
blockBlock that finished sending.

◆ block_start

int(* bt_mesh_blob_io::block_start) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block)

Block start callback.

Called when a new block is opened for sending. Each block is only sent once, and are always sent in increasing order. The data chunks inside a single block may be requested out of order and multiple times.

Parameters
ioBLOB stream.
xferBLOB transfer.
blockBlock that was started.

◆ close

void(* bt_mesh_blob_io::close) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer)

Close callback.

Called when the reader is closed.

Parameters
ioBLOB stream.
xferBLOB transfer.

◆ open

int(* bt_mesh_blob_io::open) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, enum bt_mesh_blob_io_mode mode)

Open callback.

Called when the reader is opened for reading.

Parameters
ioBLOB stream.
xferBLOB transfer.
modeDirection of the stream (read/write).
Returns
0 on success, or (negative) error code otherwise.

◆ rd

int(* bt_mesh_blob_io::rd) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block, const struct bt_mesh_blob_chunk *chunk)

Chunk data read callback.

Used by the BLOB Transfer Client to fetch outgoing data.

The Client calls the chunk data request callback to populate a chunk message going out to the Target nodes. The data request callback may be called out of order and multiple times for each offset, and cannot be used as an indication of progress.

Returning a non-zero status code on the chunk data request callback results in termination of the transfer.

Parameters
ioBLOB stream.
xferBLOB transfer.
blockBlock the chunk is part of.
chunkChunk to get the data of. The buffer pointer to by the data member should be filled by the callback.
Returns
0 on success, or (negative) error code otherwise.

◆ wr

int(* bt_mesh_blob_io::wr) (const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer, const struct bt_mesh_blob_block *block, const struct bt_mesh_blob_chunk *chunk)

Chunk data write callback.

Used by the BLOB Transfer Server on incoming data.

Each block is divided into chunks of data. This callback is called when a new chunk of data is received. Chunks may be received in any order within their block.

If the callback returns successfully, this chunk will be marked as received, and will not be received again unless the block is restarted due to a transfer suspension. If the callback returns a non-zero value, the chunk remains unreceived, and the BLOB Transfer Client will attempt to resend it later.

Note that the Client will only perform a limited number of attempts at delivering a chunk before dropping a Target node from the transfer. The number of retries performed by the Client is implementation specific.

Parameters
ioBLOB stream.
xferBLOB transfer.
blockBlock the chunk is part of.
chunkReceived chunk.
Returns
0 on success, or (negative) error code otherwise.

The documentation for this struct was generated from the following file: