这个页面的 最新开发版本 可能比这个发布的 2.3-beta.1 版本新。

BLOB 闪存

BLOB 闪存读写器实现对闪存映射 <Flash_map_api>() 中定义的闪存分区的 BLOB 读写。

BLOB闪存读取器

BLOB Flash Reader 与 BLOB Transfer Client 交互,以直接从闪存读取 BLOB 数据。在传递给 BLOB 传输客户端之前,必须通过调用 bt_mesh_blob_flash_rd_init()() 对其进行初始化。每个 BLOB Flash Reader 一次仅支持一次传输

BLOB Flash Writer(BLOB 闪存编写器)

BLOB Flash Writer 与 BLOB 传输服务器交互,以将 BLOB 数据直接写入闪存。 在传递给 BLOB 传输服务器之前,必须通过调用 bt_mesh_blob_flash_rd_init() 对其进行初始化。 每个 BLOB Flash Writer 一次只支持一个传输,并且需要闪存页面大小的倍数的块大小。 如果在块大小小于闪存页面大小的情况下启动传输,则传输将被拒绝。

BLOB Flash Writer 将区块数据复制到缓冲区中,以容纳与闪存写入块大小未对齐的区块。如果块的开始或长度未对齐,则用 0xff 填充缓冲区数据。

API 参考

group bt_mesh_blob_io_flash

Functions

int bt_mesh_blob_io_flash_init(struct bt_mesh_blob_io_flash *flash, uint8_t area_id, off_t offset)

Initialize a flash stream.

参数:
  • flash – Flash stream.

  • area_id – Flash partition identifier. See flash_area_open.

  • offset – Offset into the flash area, in bytes.

返回:

0 on success or (negative) error code otherwise.

struct bt_mesh_blob_io_flash

BLOB flash stream.