Bluetooth: Mesh: save stream mode in io_open()

Mode affects access to flash aread for `block_start`. When mode is set
to `BT_MESH_BLOB_READ` function return early, and because
`BT_MESH_BLOB_READ = 0` this is default behaviour. For write flash area
must be erased to allow driver to write there new data - bits can only
be pulled down, so overwrite will not be permitted.

Signed-off-by: Krzysztof Kopyściński <krzysztof.kopyscinski@codecoup.pl>
This commit is contained in:
Krzysztof Kopyściński 2023-03-24 08:34:00 +01:00 committed by Carles Cufí
commit fc2dcc4665

View file

@ -43,6 +43,8 @@ static int io_open(const struct bt_mesh_blob_io *io,
{
struct bt_mesh_blob_io_flash *flash = FLASH_IO(io);
flash->mode = mode;
return flash_area_open(flash->area_id, &flash->area);
}