Zephyr Project API  3.4.0
A Scalable Open Source RTOS
blob.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2020 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_BLUETOOTH_MESH_BLOB_H__
8#define ZEPHYR_INCLUDE_BLUETOOTH_MESH_BLOB_H__
9
10#include <sys/types.h>
11
12#include <zephyr/kernel.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
24#ifndef CONFIG_BT_MESH_BLOB_CHUNK_COUNT_MAX
25#define CONFIG_BT_MESH_BLOB_CHUNK_COUNT_MAX 0
26#endif
27
38};
39
54};
55
95};
96
100 size_t size;
109 8)];
110};
111
117 size_t size;
120};
121
127 size_t size;
130 /* Logarithmic representation of the block size. */
134};
135
142};
143
156 int (*open)(const struct bt_mesh_blob_io *io,
157 const struct bt_mesh_blob_xfer *xfer,
159
167 void (*close)(const struct bt_mesh_blob_io *io,
168 const struct bt_mesh_blob_xfer *xfer);
169
181 int (*block_start)(const struct bt_mesh_blob_io *io,
182 const struct bt_mesh_blob_xfer *xfer,
183 const struct bt_mesh_blob_block *block);
184
195 void (*block_end)(const struct bt_mesh_blob_io *io,
196 const struct bt_mesh_blob_xfer *xfer,
197 const struct bt_mesh_blob_block *block);
198
225 int (*wr)(const struct bt_mesh_blob_io *io,
226 const struct bt_mesh_blob_xfer *xfer,
227 const struct bt_mesh_blob_block *block,
228 const struct bt_mesh_blob_chunk *chunk);
229
250 int (*rd)(const struct bt_mesh_blob_io *io,
251 const struct bt_mesh_blob_xfer *xfer,
252 const struct bt_mesh_blob_block *block,
253 const struct bt_mesh_blob_chunk *chunk);
254};
255
258#ifdef __cplusplus
259}
260#endif
261
262#endif /* ZEPHYR_INCLUDE_BLUETOOTH_MESH_BLOB_H__ */
bt_mesh_blob_io_mode
Definition: blob.h:137
bt_mesh_blob_xfer_phase
Definition: blob.h:41
#define CONFIG_BT_MESH_BLOB_CHUNK_COUNT_MAX
Definition: blob.h:25
bt_mesh_blob_status
Definition: blob.h:57
bt_mesh_blob_xfer_mode
Definition: blob.h:29
@ BT_MESH_BLOB_WRITE
Definition: blob.h:141
@ BT_MESH_BLOB_READ
Definition: blob.h:139
@ BT_MESH_BLOB_XFER_PHASE_WAITING_FOR_BLOCK
Definition: blob.h:47
@ BT_MESH_BLOB_XFER_PHASE_INACTIVE
Definition: blob.h:43
@ BT_MESH_BLOB_XFER_PHASE_WAITING_FOR_START
Definition: blob.h:45
@ BT_MESH_BLOB_XFER_PHASE_SUSPENDED
Definition: blob.h:53
@ BT_MESH_BLOB_XFER_PHASE_COMPLETE
Definition: blob.h:51
@ BT_MESH_BLOB_XFER_PHASE_WAITING_FOR_CHUNK
Definition: blob.h:49
@ BT_MESH_BLOB_ERR_BLOB_TOO_LARGE
Definition: blob.h:84
@ BT_MESH_BLOB_ERR_INFO_UNAVAILABLE
Definition: blob.h:94
@ BT_MESH_BLOB_ERR_WRONG_BLOB_ID
Definition: blob.h:81
@ BT_MESH_BLOB_ERR_INVALID_BLOCK_NUM
Definition: blob.h:63
@ BT_MESH_BLOB_ERR_WRONG_PHASE
Definition: blob.h:77
@ BT_MESH_BLOB_ERR_UNSUPPORTED_MODE
Definition: blob.h:88
@ BT_MESH_BLOB_ERR_INTERNAL
Definition: blob.h:90
@ BT_MESH_BLOB_SUCCESS
Definition: blob.h:59
@ BT_MESH_BLOB_ERR_INVALID_BLOCK_SIZE
Definition: blob.h:68
@ BT_MESH_BLOB_ERR_INVALID_PARAM
Definition: blob.h:79
@ BT_MESH_BLOB_ERR_INVALID_CHUNK_SIZE
Definition: blob.h:73
@ BT_MESH_BLOB_XFER_MODE_PUSH
Definition: blob.h:33
@ BT_MESH_BLOB_XFER_MODE_ALL
Definition: blob.h:37
@ BT_MESH_BLOB_XFER_MODE_NONE
Definition: blob.h:31
@ BT_MESH_BLOB_XFER_MODE_PULL
Definition: blob.h:35
#define DIV_ROUND_UP(n, d)
Divide and round up.
Definition: util.h:262
Public kernel APIs.
__INTPTR_TYPE__ off_t
Definition: types.h:36
__UINT64_TYPE__ uint64_t
Definition: stdint.h:91
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Definition: blob.h:98
uint16_t number
Definition: blob.h:104
size_t size
Definition: blob.h:100
uint16_t chunk_count
Definition: blob.h:106
off_t offset
Definition: blob.h:102
uint8_t missing[DIV_ROUND_UP(0, 8)]
Definition: blob.h:109
Definition: blob.h:113
off_t offset
Definition: blob.h:115
uint8_t * data
Definition: blob.h:119
size_t size
Definition: blob.h:117
Definition: blob.h:145
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.
Definition: blob.h:250
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.
Definition: blob.h:156
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.
Definition: blob.h:195
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.
Definition: blob.h:181
void(* close)(const struct bt_mesh_blob_io *io, const struct bt_mesh_blob_xfer *xfer)
Close callback.
Definition: blob.h:167
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.
Definition: blob.h:225
Definition: blob.h:123
enum bt_mesh_blob_xfer_mode mode
Definition: blob.h:129
uint16_t chunk_size
Definition: blob.h:133
size_t size
Definition: blob.h:127
uint64_t id
Definition: blob.h:125
uint8_t block_size_log
Definition: blob.h:131
void * block
Definition: test_threads_cancel_abort.c:108