Home
last modified time | relevance | path

Searched refs:nb (Results 1 – 25 of 52) sorted by relevance

123

/Zephyr-latest/subsys/mgmt/mcumgr/grp/os_mgmt_client/src/
Dos_mgmt_client.c43 static int reset_res_fn(struct net_buf *nb, void *user_data) in reset_res_fn() argument
45 if (!nb) { in reset_res_fn()
56 struct net_buf *nb; in os_mgmt_client_reset() local
62 nb = smp_client_buf_allocation(active_client->smp_client, MGMT_GROUP_ID_OS, in os_mgmt_client_reset()
64 if (!nb) { in os_mgmt_client_reset()
69 rc = smp_client_send_cmd(active_client->smp_client, nb, reset_res_fn, in os_mgmt_client_reset()
73 smp_packet_free(nb); in os_mgmt_client_reset()
89 static int echo_res_fn(struct net_buf *nb, void *user_data) in echo_res_fn() argument
100 if (!nb) { in echo_res_fn()
107 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1, NULL, 0); in echo_res_fn()
[all …]
/Zephyr-latest/tests/subsys/mgmt/mcumgr/mcumgr_client/src/
Dos_gr_stub.c32 struct net_buf *nb; in os_reset_response() local
34 nb = smp_response_buf_allocation(); in os_reset_response()
35 if (nb) { in os_reset_response()
36 nb->len = 0; in os_reset_response()
42 struct net_buf *nb; in os_echo_response() local
46 nb = smp_response_buf_allocation(); in os_echo_response()
48 if (!nb) { in os_echo_response()
52 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in os_echo_response()
68 nb->len = zse->payload - nb->data; in os_echo_response()
72 void os_echo_verify(struct net_buf *nb) in os_echo_verify() argument
[all …]
Dimg_gr_stub.c43 struct net_buf *nb; in img_upload_response() local
47 nb = smp_response_buf_allocation(); in img_upload_response()
49 if (!nb) { in img_upload_response()
53 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in img_upload_response()
70 nb->len = zse->payload - nb->data; in img_upload_response()
76 struct net_buf *nb; in img_fail_response() local
80 nb = smp_response_buf_allocation(); in img_fail_response()
82 if (!nb) { in img_fail_response()
86 zcbor_new_encode_state(zse, ARRAY_SIZE(zse), nb->data, net_buf_tailroom(nb), 0); in img_fail_response()
94 nb->len = zse->payload - nb->data; in img_fail_response()
[all …]
Dsmp_stub.c58 void smp_transport_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_transport_read_hdr() argument
60 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_transport_read_hdr()
66 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
71 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
78 memcpy(&res_hdr, nb->data, sizeof(res_hdr)); in smp_uart_tx_pkt()
85 rx_verify_cb(nb); in smp_uart_tx_pkt()
89 net_buf_unref(nb); in smp_uart_tx_pkt()
/Zephyr-latest/subsys/mgmt/mcumgr/transport/src/
Dserial_util.c22 if (rx_ctxt->nb != NULL) { in mcumgr_serial_free_rx_ctxt()
23 smp_packet_free(rx_ctxt->nb); in mcumgr_serial_free_rx_ctxt()
24 rx_ctxt->nb = NULL; in mcumgr_serial_free_rx_ctxt()
35 if (rx_ctxt->nb->len < 2) { in mcumgr_serial_extract_len()
39 rx_ctxt->pkt_len = net_buf_pull_be16(rx_ctxt->nb); in mcumgr_serial_extract_len()
49 rc = base64_decode(rx_ctxt->nb->data + rx_ctxt->nb->len, in mcumgr_serial_decode_frag()
50 net_buf_tailroom(rx_ctxt->nb), &dec_len, in mcumgr_serial_decode_frag()
56 rx_ctxt->nb->len += dec_len; in mcumgr_serial_decode_frag()
72 struct net_buf *nb; in mcumgr_serial_process_frag() local
77 if (rx_ctxt->nb == NULL) { in mcumgr_serial_process_frag()
[all …]
Dsmp_lorawan.c22 static int smp_lorawan_uplink(struct net_buf *nb);
24 static uint16_t smp_lorawan_get_mtu(const struct net_buf *nb);
50 struct net_buf *nb; member
55 .nb = NULL,
67 if (msg->nb != NULL) { in smp_lorawan_uplink_thread()
68 size = msg->nb->len; in smp_lorawan_uplink_thread()
88 data = net_buf_pull_mem(msg->nb, data_size); in smp_lorawan_uplink_thread()
161 struct net_buf *nb; in smp_lorawan_downlink()
163 nb = smp_packet_alloc(); in smp_lorawan_downlink()
165 if (!nb) { in smp_lorawan_downlink()
[all …]
Dsmp_dummy.c92 struct net_buf *nb; in smp_dummy_process_frag() local
97 nb = mcumgr_dummy_process_frag(&smp_dummy_rx_ctxt, in smp_dummy_process_frag()
106 if (nb != NULL) { in smp_dummy_process_frag()
107 smp_rx_req(&smp_dummy_transport, nb); in smp_dummy_process_frag()
118 struct net_buf *nb; in smp_dummy_process_frag_outgoing() local
123 nb = mcumgr_dummy_process_frag_outgoing(&smp_dummy_tx_ctxt, in smp_dummy_process_frag_outgoing()
126 return nb; in smp_dummy_process_frag_outgoing()
153 static uint16_t smp_dummy_get_mtu(const struct net_buf *nb) in smp_dummy_get_mtu() argument
178 static int smp_dummy_tx_pkt_int(struct net_buf *nb) in smp_dummy_tx_pkt_int() argument
182 rc = mcumgr_dummy_tx_pkt(nb->data, nb->len, dummy_mcumgr_send_raw); in smp_dummy_tx_pkt_int()
[all …]
Dsmp.c51 void smp_packet_free(struct net_buf *nb) in smp_packet_free() argument
53 net_buf_unref(nb); in smp_packet_free()
110 smp_process_packet(struct smp_transport *smpt, struct net_buf *nb) in smp_process_packet() argument
123 rc = smp_process_request_packet(&streamer, nb); in smp_process_packet()
134 struct net_buf *nb; in smp_handle_reqs() local
139 while ((nb = k_fifo_get(&smpt->fifo, K_NO_WAIT)) != NULL) { in smp_handle_reqs()
140 smp_process_packet(smpt, nb); in smp_handle_reqs()
200 smp_rx_req(struct smp_transport *smpt, struct net_buf *nb) in smp_rx_req() argument
202 k_fifo_put(&smpt->fifo, nb); in smp_rx_req()
215 struct net_buf *nb; in smp_rx_remove_invalid() local
[all …]
Dsmp_uart.c43 struct net_buf *nb; in smp_uart_process_frag() local
48 nb = mcumgr_serial_process_frag(&smp_uart_rx_ctxt, in smp_uart_process_frag()
57 if (nb != NULL) { in smp_uart_process_frag()
58 smp_rx_req(&smp_uart_transport, nb); in smp_uart_process_frag()
81 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
86 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
90 rc = uart_mcumgr_send(nb->data, nb->len); in smp_uart_tx_pkt()
91 smp_packet_free(nb); in smp_uart_tx_pkt()
Dsmp_bt.c315 struct net_buf *nb; in smp_bt_chr_write() local
322 nb = smp_packet_alloc(); in smp_bt_chr_write()
323 if (!nb) { in smp_bt_chr_write()
328 if (net_buf_tailroom(nb) < len) { in smp_bt_chr_write()
330 len, net_buf_tailroom(nb)); in smp_bt_chr_write()
331 smp_packet_free(nb); in smp_bt_chr_write()
335 net_buf_add_mem(nb, buf, len); in smp_bt_chr_write()
337 ud = net_buf_user_data(nb); in smp_bt_chr_write()
345 smp_rx_req(&smp_bt_transport, nb); in smp_bt_chr_write()
391 static struct bt_conn *smp_bt_conn_from_pkt(const struct net_buf *nb) in smp_bt_conn_from_pkt() argument
[all …]
Dsmp_udp.c98 static int smp_udp4_tx(struct net_buf *nb) in smp_udp4_tx() argument
101 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp4_tx()
103 ret = zsock_sendto(smp_udp_configs.ipv4.sock, nb->data, nb->len, 0, addr, sizeof(*addr)); in smp_udp4_tx()
115 smp_packet_free(nb); in smp_udp4_tx()
122 static int smp_udp6_tx(struct net_buf *nb) in smp_udp6_tx() argument
125 struct sockaddr *addr = net_buf_user_data(nb); in smp_udp6_tx()
127 ret = zsock_sendto(smp_udp_configs.ipv6.sock, nb->data, nb->len, 0, addr, sizeof(*addr)); in smp_udp6_tx()
139 smp_packet_free(nb); in smp_udp6_tx()
145 static uint16_t smp_udp_get_mtu(const struct net_buf *nb) in smp_udp_get_mtu() argument
147 ARG_UNUSED(nb); in smp_udp_get_mtu()
[all …]
Dsmp_shell.c189 struct net_buf *nb; in smp_shell_process() local
197 nb = mcumgr_serial_process_frag(&smp_shell_rx_ctxt, in smp_shell_process()
200 if (nb != NULL) { in smp_shell_process()
201 smp_rx_req(&smp_shell_transport, nb); in smp_shell_process()
208 static uint16_t smp_shell_get_mtu(const struct net_buf *nb) in smp_shell_get_mtu() argument
226 static int smp_shell_tx_pkt(struct net_buf *nb) in smp_shell_tx_pkt() argument
231 rc = mcumgr_serial_tx_pkt(nb->data, nb->len, smp_shell_tx_raw); in smp_shell_tx_pkt()
232 smp_packet_free(nb); in smp_shell_tx_pkt()
/Zephyr-latest/subsys/mgmt/mcumgr/smp_client/src/
Dclient.c29 struct net_buf *nb; member
46 static void smp_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr);
56 struct net_buf *nb; in smp_client_handle_reqs() local
61 while ((nb = k_fifo_get(&smp_client->tx_fifo, K_NO_WAIT)) != NULL) { in smp_client_handle_reqs()
62 smpt->functions.output(nb); in smp_client_handle_reqs()
111 entry->nb = net_buf_ref(entry->nb); in smp_client_transport_work_fn()
114 k_fifo_put(&entry->smp_client->tx_fifo, entry->nb); in smp_client_transport_work_fn()
172 smp_client_buf_free(cmd_req->nb); in smp_client_cmd_req_free()
173 cmd_req->nb = NULL; in smp_client_cmd_req_free()
195 smp_read_hdr(cmd_req->nb, &smp_header); in smp_client_response_discover()
[all …]
/Zephyr-latest/subsys/mgmt/mcumgr/grp/img_mgmt_client/src/
Dimg_mgmt_client.c47 static int image_state_res_fn(struct net_buf *nb, void *user_data) in image_state_res_fn() argument
72 if (!nb) { in image_state_res_fn()
77 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1, NULL, 0); in image_state_res_fn()
187 static int image_upload_res_fn(struct net_buf *nb, void *user_data) in image_upload_res_fn() argument
199 if (!nb) { in image_upload_res_fn()
204 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1, NULL, 0); in image_upload_res_fn()
221 static int erase_res_fn(struct net_buf *nb, void *user_data) in erase_res_fn() argument
231 if (!nb) { in erase_res_fn()
236 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data, nb->len, 1, NULL, 0); in erase_res_fn()
334 struct net_buf *nb; in img_mgmt_client_upload() local
[all …]
/Zephyr-latest/tests/subsys/mgmt/mcumgr/os_mgmt_echo/src/
Dmain.c39 struct net_buf *nb; in ZTEST() local
55 nb = smp_dummy_get_outgoing(); in ZTEST()
58 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
60 nb->len); in ZTEST()
62 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
/Zephyr-latest/tests/subsys/mgmt/mcumgr/smp_version/src/
Dmain.c63 static struct net_buf *nb; variable
146 nb = smp_dummy_get_outgoing(); in ZTEST()
150 zassert_equal(sizeof(response_old), nb->len, "Expected received data length mismatch"); in ZTEST()
151 zassert_mem_equal(response_old, nb->data, nb->len, "Expected received data mismatch"); in ZTEST()
154 smp_header = net_buf_pull_mem(nb, sizeof(struct smp_hdr)); in ZTEST()
158 zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0); in ZTEST()
233 nb = smp_dummy_get_outgoing(); in ZTEST()
237 zassert_equal(sizeof(response_current), nb->len, "Expected received data length mismatch"); in ZTEST()
238 zassert_mem_equal(response_current, nb->data, nb->len, "Expected received data mismatch"); in ZTEST()
241 smp_header = net_buf_pull_mem(nb, sizeof(struct smp_hdr)); in ZTEST()
[all …]
/Zephyr-latest/tests/subsys/mgmt/mcumgr/os_mgmt_info/src/
Dlimited.c30 static struct net_buf *nb; variable
79 nb = smp_dummy_get_outgoing(); in ZTEST()
83 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
84 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0); in ZTEST()
145 nb = smp_dummy_get_outgoing(); in ZTEST()
149 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
150 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0); in ZTEST()
158 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0); in ZTEST()
170 if (nb != NULL) { in cleanup_test()
171 net_buf_unref(nb); in cleanup_test()
[all …]
Dmain.c60 static struct net_buf *nb; variable
246 nb = smp_dummy_get_outgoing(); in ZTEST()
249 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
251 nb->len); in ZTEST()
253 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
256 net_buf_unref(nb); in ZTEST()
284 nb = smp_dummy_get_outgoing(); in ZTEST()
287 zassert_equal(sizeof(expected_response), nb->len, in ZTEST()
289 nb->len); in ZTEST()
291 zassert_mem_equal(expected_response, nb->data, nb->len, in ZTEST()
[all …]
Dbuild_date.c30 static struct net_buf *nb; variable
119 nb = smp_dummy_get_outgoing(); in ZTEST()
123 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
124 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0); in ZTEST()
195 nb = smp_dummy_get_outgoing(); in ZTEST()
199 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
200 zcbor_new_decode_state(zsd, 3, nb->data, nb->len, 1, NULL, 0); in ZTEST()
251 if (nb != NULL) { in cleanup_test()
252 net_buf_unref(nb); in cleanup_test()
253 nb = NULL; in cleanup_test()
/Zephyr-latest/tests/subsys/mgmt/mcumgr/smp_client/src/
Dsmp_transport_stub.c20 void smp_transport_read_hdr(const struct net_buf *nb, struct smp_hdr *dst_hdr) in smp_transport_read_hdr() argument
22 memcpy(dst_hdr, nb->data, sizeof(*dst_hdr)); in smp_transport_read_hdr()
30 static uint16_t smp_uart_get_mtu(const struct net_buf *nb) in smp_uart_get_mtu() argument
35 static int smp_uart_tx_pkt(struct net_buf *nb) in smp_uart_tx_pkt() argument
37 smp_packet_free(nb); in smp_uart_tx_pkt()
/Zephyr-latest/tests/subsys/mgmt/mcumgr/os_mgmt_datetime/src/
Dmain.c39 static struct net_buf *nb; variable
189 nb = smp_dummy_get_outgoing(); in ZTEST()
193 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
194 zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0); in ZTEST()
251 nb = smp_dummy_get_outgoing(); in ZTEST()
255 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
256 zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0); in ZTEST()
316 nb = smp_dummy_get_outgoing(); in ZTEST()
320 (void)net_buf_pull(nb, sizeof(struct smp_hdr)); in ZTEST()
321 zcbor_new_decode_state(zsd, 4, nb->data, nb->len, 1, NULL, 0); in ZTEST()
[all …]
/Zephyr-latest/tests/subsys/mgmt/mcumgr/settings_mgmt/src/
Dmain.c38 static struct net_buf *nb; variable
79 if (nb != NULL) { in cleanup_test()
80 net_buf_unref(nb); in cleanup_test()
81 nb = NULL; in cleanup_test()
137 nb = smp_dummy_get_outgoing(); in ZTEST()
141 zassert_equal(nb->len, TEST_RESPONSE_OK_LENGTH, "SMP response mismatch"); in ZTEST()
142 header = (struct smp_hdr *)nb->data; in ZTEST()
152 zassert_mem_equal(&nb->data[(TEST_RESPONSE_OK_LENGTH - TEST_RESPONSE_OK_DATA_LENGTH)], in ZTEST()
191 nb = smp_dummy_get_outgoing(); in ZTEST()
195 zassert_equal(nb->len, TEST_RESPONSE_ERROR_LENGTH, "SMP response mismatch"); in ZTEST()
[all …]
/Zephyr-latest/subsys/mgmt/mcumgr/smp/src/
Dsmp.c52 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()
[all …]
/Zephyr-latest/include/zephyr/mgmt/mcumgr/smp/
Dsmp_client.h61 typedef int (*smp_client_res_fn)(struct net_buf *nb, void *user_data);
72 int smp_client_single_response(struct net_buf *nb, const struct smp_hdr *res_hdr);
94 void smp_client_buf_free(struct net_buf *nb);
109 int smp_client_send_cmd(struct smp_client_object *smp_client, struct net_buf *nb,
/Zephyr-latest/tests/lib/multi_heap/src/
Dtest_mheap_api.c71 int nb; in ZTEST() local
73 for (nb = 0; nb < ARRAY_SIZE(block); nb++) { in ZTEST()
78 block[nb] = k_malloc(BLK_SIZE_MIN); in ZTEST()
79 if (block[nb] == NULL) { in ZTEST()
88 for (int i = 0; i < nb; i++) { in ZTEST()
107 size_t nb; in ZTEST() local
119 for (nb = 2; nb < (2 * BLK_NUM_MAX); nb++) { in ZTEST()
122 block1 = k_realloc(block1, nb * BLK_SIZE_MIN); in ZTEST()
155 for (size_t i = 1; i < nb; i++) { in ZTEST()

123