Lines Matching refs:metadata
16 struct bt_mesh_dfu_metadata *metadata) in bt_mesh_dfu_metadata_decode() argument
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()
29 if (metadata->fw_core_type & BT_MESH_DFU_FW_CORE_TYPE_APP) { 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()
45 int bt_mesh_dfu_metadata_encode(const struct bt_mesh_dfu_metadata *metadata, in bt_mesh_dfu_metadata_encode() argument
48 size_t md_len_min = 12 + metadata->user_data_len; in bt_mesh_dfu_metadata_encode()
50 if (metadata->fw_core_type & BT_MESH_DFU_FW_CORE_TYPE_APP) { 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()
67 if (metadata->user_data_len > 0) { 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()