Lines Matching refs:nb
52 static void cbor_nb_reader_init(struct cbor_nb_reader *cnr, struct net_buf *nb) in cbor_nb_reader_init() argument
54 cnr->nb = nb; in cbor_nb_reader_init()
55 zcbor_new_decode_state(cnr->zs, ARRAY_SIZE(cnr->zs), nb->data, in cbor_nb_reader_init()
56 nb->len, 1, NULL, 0); in cbor_nb_reader_init()
59 static void cbor_nb_writer_init(struct cbor_nb_writer *cnw, struct net_buf *nb) in cbor_nb_writer_init() argument
61 net_buf_reset(nb); in cbor_nb_writer_init()
62 cnw->nb = nb; in cbor_nb_writer_init()
63 cnw->nb->len = sizeof(struct smp_hdr); in cbor_nb_writer_init()
64 zcbor_new_encode_state(cnw->zs, ARRAY_SIZE(cnw->zs), nb->data + sizeof(struct smp_hdr), in cbor_nb_writer_init()
65 net_buf_tailroom(nb), 0); in cbor_nb_writer_init()
94 static int smp_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_read_hdr() argument
96 if (nb->len < sizeof(*dst_hdr)) { in smp_read_hdr()
100 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_read_hdr()
109 memcpy(streamer->writer->nb->data, src_hdr, sizeof(*src_hdr)); in smp_write_hdr()
140 zsp->payload_mut - nbw->nb->data - MGMT_HDR_SIZE); in smp_build_err_rsp()
141 nbw->nb->len = zsp->payload_mut - nbw->nb->data; in smp_build_err_rsp()
314 zsp->payload_mut - nbw->nb->data - MGMT_HDR_SIZE); in smp_handle_single_req()
315 nbw->nb->len = zsp->payload_mut - nbw->nb->data; in smp_handle_single_req()