Lines Matching full:buf

16 #define IS_LENGTH_LONG(buf) ((buf)->data[0] & 1)  argument
19 int bt_mesh_op_agg_encode_msg(struct net_buf_simple *msg, struct net_buf_simple *buf) in bt_mesh_op_agg_encode_msg() argument
22 if (net_buf_simple_tailroom(buf) < (msg->len + 2)) { in bt_mesh_op_agg_encode_msg()
26 net_buf_simple_add_le16(buf, (msg->len << 1) | 1); in bt_mesh_op_agg_encode_msg()
28 if (net_buf_simple_tailroom(buf) < (msg->len + 1)) { in bt_mesh_op_agg_encode_msg()
32 net_buf_simple_add_u8(buf, msg->len << 1); in bt_mesh_op_agg_encode_msg()
34 net_buf_simple_add_mem(buf, msg->data, msg->len); in bt_mesh_op_agg_encode_msg()
40 struct net_buf_simple *buf) in bt_mesh_op_agg_decode_msg() argument
44 if (IS_LENGTH_LONG(buf)) { in bt_mesh_op_agg_decode_msg()
45 if (buf->len < 2) { in bt_mesh_op_agg_decode_msg()
49 len = net_buf_simple_pull_le16(buf) >> 1; in bt_mesh_op_agg_decode_msg()
51 if (buf->len < 1) { in bt_mesh_op_agg_decode_msg()
55 len = net_buf_simple_pull_u8(buf) >> 1; in bt_mesh_op_agg_decode_msg()
58 if (buf->len < len) { in bt_mesh_op_agg_decode_msg()
62 net_buf_simple_init_with_data(msg, net_buf_simple_pull_mem(buf, len), len); in bt_mesh_op_agg_decode_msg()
67 bool bt_mesh_op_agg_is_op_agg_msg(struct net_buf_simple *buf) in bt_mesh_op_agg_is_op_agg_msg() argument
69 if (buf->len >= 2 && (buf->data[0] >> 6) == 2) { in bt_mesh_op_agg_is_op_agg_msg()
73 net_buf_simple_save(buf, &state); in bt_mesh_op_agg_is_op_agg_msg()
74 opcode = net_buf_simple_pull_be16(buf); in bt_mesh_op_agg_is_op_agg_msg()
75 net_buf_simple_restore(buf, &state); in bt_mesh_op_agg_is_op_agg_msg()