Lines Matching full:buf
7 #include <zephyr/net/buf.h>
15 int bt_mesh_dfu_metadata_decode(struct net_buf_simple *buf, in bt_mesh_dfu_metadata_decode() argument
18 if (buf->len < 12) { in bt_mesh_dfu_metadata_decode()
22 metadata->fw_ver.major = net_buf_simple_pull_u8(buf); in bt_mesh_dfu_metadata_decode()
23 metadata->fw_ver.minor = net_buf_simple_pull_u8(buf); in bt_mesh_dfu_metadata_decode()
24 metadata->fw_ver.revision = net_buf_simple_pull_le16(buf); in bt_mesh_dfu_metadata_decode()
25 metadata->fw_ver.build_num = net_buf_simple_pull_le32(buf); in bt_mesh_dfu_metadata_decode()
26 metadata->fw_size = net_buf_simple_pull_le24(buf); in bt_mesh_dfu_metadata_decode()
27 metadata->fw_core_type = net_buf_simple_pull_u8(buf); in bt_mesh_dfu_metadata_decode()
30 if (buf->len < 6) { in bt_mesh_dfu_metadata_decode()
34 metadata->comp_hash = net_buf_simple_pull_le32(buf); in bt_mesh_dfu_metadata_decode()
35 metadata->elems = net_buf_simple_pull_le16(buf); in bt_mesh_dfu_metadata_decode()
38 metadata->user_data = buf->len > 0 ? buf->data : NULL; in bt_mesh_dfu_metadata_decode()
39 metadata->user_data_len = buf->len; in bt_mesh_dfu_metadata_decode()
46 struct net_buf_simple *buf) in bt_mesh_dfu_metadata_encode() argument
54 if (net_buf_simple_tailroom(buf) < md_len_min) { in bt_mesh_dfu_metadata_encode()
58 net_buf_simple_add_u8(buf, metadata->fw_ver.major); in bt_mesh_dfu_metadata_encode()
59 net_buf_simple_add_u8(buf, metadata->fw_ver.minor); in bt_mesh_dfu_metadata_encode()
60 net_buf_simple_add_le16(buf, metadata->fw_ver.revision); in bt_mesh_dfu_metadata_encode()
61 net_buf_simple_add_le32(buf, metadata->fw_ver.build_num); in bt_mesh_dfu_metadata_encode()
62 net_buf_simple_add_le24(buf, metadata->fw_size); in bt_mesh_dfu_metadata_encode()
63 net_buf_simple_add_u8(buf, metadata->fw_core_type); in bt_mesh_dfu_metadata_encode()
64 net_buf_simple_add_le32(buf, metadata->comp_hash); in bt_mesh_dfu_metadata_encode()
65 net_buf_simple_add_le16(buf, metadata->elems); in bt_mesh_dfu_metadata_encode()
68 net_buf_simple_add_mem(buf, metadata->user_data, metadata->user_data_len); in bt_mesh_dfu_metadata_encode()
74 int bt_mesh_dfu_metadata_comp_hash_get(struct net_buf_simple *buf, uint8_t *key, uint32_t *hash) in bt_mesh_dfu_metadata_comp_hash_get() argument
78 struct bt_mesh_sg sg = {.data = buf->data, .len = buf->len}; in bt_mesh_dfu_metadata_comp_hash_get()
92 NET_BUF_SIMPLE_DEFINE(buf, BT_MESH_TX_SDU_MAX); in bt_mesh_dfu_metadata_comp_hash_local_get()
95 err = bt_mesh_comp_data_get_page_0(&buf, 0); in bt_mesh_dfu_metadata_comp_hash_local_get()
100 err = bt_mesh_dfu_metadata_comp_hash_get(&buf, key, hash); in bt_mesh_dfu_metadata_comp_hash_local_get()