Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 175) sorted by relevance

1234567

/samples/bluetooth/hci_ipc/src/
A Dmain.c68 if (buf) { in hci_ipc_cmd_recv()
91 return buf; in hci_ipc_cmd_recv()
105 if (buf) { in hci_ipc_acl_recv()
128 return buf; in hci_ipc_acl_recv()
142 if (buf) { in hci_ipc_iso_recv()
165 return buf; in hci_ipc_iso_recv()
197 if (buf) { in hci_ipc_rx()
200 LOG_HEXDUMP_DBG(buf->data, buf->len, "Final net buffer:"); in hci_ipc_rx()
231 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in hci_ipc_send()
233 LOG_HEXDUMP_DBG(buf->data, buf->len, "Final HCI buffer:"); in hci_ipc_send()
[all …]
/samples/bluetooth/hci_spi/src/
A Dmain.c110 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in spi_send()
114 net_buf_unref(buf); in spi_send()
135 tx.buf = buf->data; in spi_send()
136 tx.len = buf->len; in spi_send()
142 net_buf_unref(buf); in spi_send()
192 tx.buf = txmsg; in bt_tx_thread()
194 rx.buf = rxmsg; in bt_tx_thread()
210 if (buf) { in bt_tx_thread()
222 if (buf) { in bt_tx_thread()
235 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in bt_tx_thread()
[all …]
/samples/boards/st/bluetooth/interactive_gui/src/
A Dmain.c141 struct net_buf *buf; in send_evt() local
145 if (!buf) { in send_evt()
151 net_buf_unref(buf); in send_evt()
280 if (!buf) { in rx_isr()
344 if (!buf) { in tx_isr()
346 if (!buf) { in tx_isr()
351 len = uart_fifo_fill(hci_uart_dev, buf->data, buf->len); in tx_isr()
353 if (!buf->len) { in tx_isr()
355 buf = NULL; in tx_isr()
390 len = parse_cmd(buf->data, buf->len, response); in tx_thread()
[all …]
/samples/bluetooth/hci_uart/src/
A Dmain.c153 if (!buf) { in rx_isr()
175 buf->len += read; in rx_isr()
212 if (!buf) { in tx_isr()
214 if (!buf) { in tx_isr()
220 len = uart_fifo_fill(hci_uart_dev, buf->data, buf->len); in tx_isr()
222 if (!buf->len) { in tx_isr()
223 net_buf_unref(buf); in tx_isr()
224 buf = NULL; in tx_isr()
258 err = bt_send(buf); in tx_thread()
273 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in h4_send()
[all …]
/samples/boards/nordic/nrf_led_matrix/src/
A Dmain.c16 static uint8_t buf[5]; variable
18 .buf_size = sizeof(buf),
64 buf[0] = PIXEL_MASK(0, 0, 0, 0, 1); in update_block_5x5()
65 buf[1] = PIXEL_MASK(0, 0, 0, 1, 1); in update_block_5x5()
66 buf[2] = PIXEL_MASK(0, 0, 1, 1, 1); in update_block_5x5()
80 tmp = buf[0]; in update_block_5x5()
81 buf[0] = buf[1]; in update_block_5x5()
82 buf[1] = buf[2]; in update_block_5x5()
83 buf[2] = buf[3]; in update_block_5x5()
84 buf[3] = buf[4]; in update_block_5x5()
[all …]
/samples/drivers/lcd_cyclonev_socdk/src/
A Dmain.c22 const uint8_t buf = c; in send_ascii() local
25 ret = i2c_write(i2c, &buf, sizeof(buf), LCD_ADDRESS); in send_ascii()
49 const uint8_t buf[] = {0xFE, command_id}; in send_command_no_param() local
53 ret = i2c_write(i2c, (const uint8_t *) &buf, sizeof(buf), LCD_ADDRESS); in send_command_no_param()
64 const uint8_t buf[] = { 0xFE, command_id, param}; in send_command_one_param() local
68 ret = i2c_write(i2c, (const uint8_t *) &buf, sizeof(buf), LCD_ADDRESS); in send_command_one_param()
/samples/drivers/mspi/mspi_flash/src/
A Dmain.c32 uint8_t buf[sizeof(expected)]; local
65 memset(buf, 0, len);
72 if (memcmp(expected, buf, len) == 0) {
76 const uint8_t *rp = buf;
104 uint8_t buf[sizeof(expected)]; local
126 memset(buf, 0, len);
135 if (buf[0] != 0xff) {
137 offs, buf[0]);
157 memset(buf, 0, len);
168 const uint8_t *rp = buf;
[all …]
/samples/drivers/display/src/
A Dmain.c67 *((uint32_t *)(buf + idx)) = color; in fill_buffer_argb8888()
92 *(buf + idx + 0) = color >> 16; in fill_buffer_rgb888()
93 *(buf + idx + 1) = color >> 8; in fill_buffer_rgb888()
94 *(buf + idx + 2) = color >> 0; in fill_buffer_rgb888()
139 *(uint16_t *)(buf + idx) = color; in fill_buffer_rgb565()
158 memset(buf, color, buf_size); in fill_buffer_mono()
164 *(uint8_t *)(buf + idx) = grey; in fill_buffer_l_8()
192 *((uint16_t *)(buf + idx)) = color; in fill_buffer_al_88()
218 uint8_t *buf; in main() local
330 buf = k_malloc(buf_size); in main()
[all …]
/samples/bluetooth/hci_uart_async/src/
A Dhci_uart_async.c205 struct net_buf *buf; in h2c_h4_transport() local
225 if (!buf) { in h2c_h4_transport()
239 net_buf_unref(buf); in h2c_h4_transport()
269 net_buf_reset(buf); in h2c_h4_transport()
285 net_buf_unref(buf); in h2c_h4_transport()
286 buf = NULL; in h2c_h4_transport()
292 if (buf) { in h2c_h4_transport()
293 err = bt_send(buf); in h2c_h4_transport()
298 buf = NULL; in h2c_h4_transport()
379 uart_c2h_tx(buf->data, buf->len); in c2h_thread_entry()
[all …]
/samples/net/dhcpv4_client/src/
A Dmain.c51 char buf[NET_IPV4_ADDR_LEN]; in handler() local
61 buf, sizeof(buf))); in handler()
65 buf, sizeof(buf))); in handler()
69 buf, sizeof(buf))); in handler()
80 char buf[NET_IPV4_ADDR_LEN]; in option_handler() local
83 net_addr_ntop(AF_INET, cb->data, buf, sizeof(buf))); in option_handler()
/samples/drivers/spi_flash/src/
A Dmain.c77 uint8_t buf[sizeof(expected)]; in single_sector_test() local
97 memset(buf, 0, len); in single_sector_test()
103 if (memcmp(erased, buf, len) != 0) { in single_sector_test()
119 memset(buf, 0, len); in single_sector_test()
130 const uint8_t *rp = buf; in single_sector_test()
153 uint8_t buf[sizeof(expected)]; in multi_sector_test() local
174 memset(buf, 0, len); in multi_sector_test()
185 offs, *(uint32_t *)buf); in multi_sector_test()
205 memset(buf, 0, len); in multi_sector_test()
216 const uint8_t *rp = buf; in multi_sector_test()
[all …]
/samples/net/openthread/coap/src/
A Dcoap_utils.h16 typedef int (*coap_req_handler_put)(void *ctx, uint8_t *buf, int size);
22 int coap_resp_send(otMessage *req, const otMessageInfo *req_info, uint8_t *buf, int len);
23 int coap_put_req_send(const char *addr, const char *uri, uint8_t *buf, int len,
25 int coap_get_req_send(const char *addr, const char *uri, uint8_t *buf, int len,
28 int coap_get_data(otMessage *msg, void *buf, int *len);
/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/mesh/
A Ddevice_composition.c142 switch (buf->len) { in gen_onoff_set_unack()
212 switch (buf->len) { in gen_onoff_set()
269 if (buf->len == 2U) { in gen_onoff_status()
348 switch (buf->len) { in gen_level_set_unack()
415 switch (buf->len) { in gen_level_set()
492 switch (buf->len) { in gen_delta_set_unack()
575 switch (buf->len) { in gen_delta_set()
651 switch (buf->len) { in gen_move_set_unack()
726 switch (buf->len) { in gen_move_set()
1131 switch (buf->len) { in light_lightness_set_unack()
[all …]
/samples/net/wpan_serial/src/
A Dmain.c75 struct net_buf *buf; in slip_process_byte() local
125 LOG_ERR("No more buf space: buf %p len %u", buf, buf->len); in slip_process_byte()
132 net_buf_add_u8(buf, c); in slip_process_byte()
256 net_buf_pull_u8(buf); in process_data()
263 pkt, buf); in process_data()
311 struct net_buf *buf; in rx_thread() local
319 LOG_HEXDUMP_DBG(buf->data, buf->len, "SLIP >"); in rx_thread()
341 size_t len = buf->len; in slip_buffer()
402 struct net_buf *buf; in tx_thread() local
411 LOG_HEXDUMP_DBG(buf->data, buf->len, "SLIP <"); in tx_thread()
[all …]
/samples/userspace/prod_consumer/src/
A Dsample_driver_handlers.c22 int z_vrfy_sample_driver_write(const struct device *dev, void *buf) in z_vrfy_sample_driver_write() argument
28 if (K_SYSCALL_MEMORY_READ(buf, SAMPLE_DRIVER_MSG_SIZE)) { in z_vrfy_sample_driver_write()
32 return z_impl_sample_driver_write(dev, buf); in z_vrfy_sample_driver_write()
/samples/subsys/nvs/src/
A Dmain.c65 char buf[16]; in main() local
99 rc = nvs_read(&fs, ADDRESS_ID, &buf, sizeof(buf)); in main()
101 printk("Id: %d, Address: %s\n", ADDRESS_ID, buf); in main()
103 strcpy(buf, "192.168.1.1"); in main()
104 printk("No address found, adding %s at id %d\n", buf, in main()
106 (void)nvs_write(&fs, ADDRESS_ID, &buf, strlen(buf)+1); in main()
146 rc = nvs_read(&fs, STRING_ID, &buf, sizeof(buf)); in main()
150 STRING_ID, buf); in main()
160 strcpy(buf, "DATA"); in main()
161 (void)nvs_write(&fs, STRING_ID, &buf, strlen(buf) + 1); in main()
/samples/bluetooth/hci_uart_3wire/src/
A Dmain.c214 if (!buf) { in process_unack()
222 net_buf_unref(buf); in process_unack()
381 struct net_buf *buf; in h5_process_complete_packet() local
399 buf = h5.rx_buf; in h5_process_complete_packet()
404 net_buf_unref(buf); in h5_process_complete_packet()
412 hexdump("=> ", buf->data, buf->len); in h5_process_complete_packet()
568 LOG_DBG("buf %p type %u len %u", buf, buf->data[0], buf->len); in h5_queue()
582 struct net_buf *buf; in process_events() local
618 h5_send(buf->data, type, buf->len); in process_events()
693 hexdump("=> ", buf->data, buf->len); in rx_thread()
[all …]
/samples/bluetooth/mesh/src/
A Dmain.c122 net_buf_simple_add_u8(&buf, !onoff.val); in onoff_status_send()
123 net_buf_simple_add_u8(&buf, onoff.val); in onoff_status_send()
126 net_buf_simple_add_u8(&buf, onoff.val); in onoff_status_send()
155 struct net_buf_simple *buf) in gen_onoff_get() argument
163 struct net_buf_simple *buf) in gen_onoff_set_unack() argument
170 if (buf->len) { in gen_onoff_set_unack()
206 struct net_buf_simple *buf) in gen_onoff_set() argument
225 struct net_buf_simple *buf) in gen_onoff_status() argument
229 if (buf->len) { in gen_onoff_status()
319 net_buf_simple_add_u8(&buf, val); in gen_onoff_send()
[all …]
/samples/boards/bbc/microbit/line_follower_robot/src/
A Dmain.c46 uint8_t buf[3]; in motor_control() local
49 buf[0] = 0x00U; in motor_control()
51 buf[0] = 0x02U; in motor_control()
55 buf[1] = 0x01U; in motor_control()
56 buf[2] = (uint8_t)(speed * (-1)); in motor_control()
58 buf[1] = 0x00U; in motor_control()
59 buf[2] = (uint8_t)speed; in motor_control()
62 i2c_write_dt(&motorctl, buf, sizeof(buf)); in motor_control()
/samples/net/ipv4_autoconf/src/
A Dmain.c44 char buf[NET_IPV4_ADDR_LEN]; in handler() local
53 buf, sizeof(buf))); in handler()
57 buf, sizeof(buf))); in handler()
/samples/drivers/peci/src/
A Dmain.c44 packet.tx_buffer.buf = NULL; in peci_ping()
46 packet.rx_buffer.buf = NULL; in peci_ping()
72 packet.tx_buffer.buf = peci_req_buf; in peci_get_tjmax()
74 packet.rx_buffer.buf = peci_resp_buf; in peci_get_tjmax()
85 printk("%02x\n", packet.rx_buffer.buf[i]); in peci_get_tjmax()
88 peci_resp = packet.rx_buffer.buf[0]; in peci_get_tjmax()
95 *tjmax = packet.rx_buffer.buf[3]; in peci_get_tjmax()
109 packet.tx_buffer.buf = NULL; in peci_get_temp()
111 packet.rx_buffer.buf = peci_resp_buf; in peci_get_temp()
126 printk("%02x\n", packet.rx_buffer.buf[1]); in peci_get_temp()
[all …]
/samples/boards/nordic/battery/src/
A Dmain.c36 static char buf[16]; /* ...HH:MM:SS.MMM */ in now_str() local
50 snprintf(buf, sizeof(buf), "%u:%02u:%02u.%03u", in now_str()
52 return buf; in now_str()
/samples/subsys/usb/webusb/src/
A Dsfunc.c69 struct net_buf *buf, int err) in sfunc_request_handler() argument
86 net_buf_reset(buf); in sfunc_request_handler()
93 usbd_ep_buf_free(uds_ctx, buf); in sfunc_request_handler()
97 usbd_ep_buf_free(uds_ctx, buf); in sfunc_request_handler()
119 struct net_buf *buf = NULL; in sfunc_buf_alloc() local
130 net_buf_reset(buf); in sfunc_buf_alloc()
131 if (!buf) { in sfunc_buf_alloc()
135 bi = udc_get_buf_info(buf); in sfunc_buf_alloc()
138 return buf; in sfunc_buf_alloc()
145 struct net_buf *buf; in sfunc_enable() local
[all …]
/samples/bluetooth/hci_vs_scan_req/src/
A Dmain.c65 struct net_buf *buf; in enable_legacy_adv_scan_request_event() local
68 buf = bt_hci_cmd_alloc(K_FOREVER); in enable_legacy_adv_scan_request_event()
69 if (!buf) { in enable_legacy_adv_scan_request_event()
74 cp = net_buf_add(buf, sizeof(*cp)); in enable_legacy_adv_scan_request_event()
77 err = bt_hci_cmd_send(BT_HCI_OP_VS_SET_SCAN_REQ_REPORTS, buf); in enable_legacy_adv_scan_request_event()
84 static bool vs_scanned(struct net_buf_simple *buf) in vs_scanned() argument
89 vs = net_buf_simple_pull_mem(buf, sizeof(*vs)); in vs_scanned()
90 evt = (void *)buf->data; in vs_scanned()
/samples/net/sockets/net_mgmt/src/
A Dmain.c79 char *buf; in get_ip_addr() local
81 buf = net_addr_ntop(family, hdr->nm_msg, ipaddr, len); in get_ip_addr()
82 if (!buf) { in get_ip_addr()
86 return buf; in get_ip_addr()
99 uint8_t buf[MAX_BUF_LEN]; in listener() local
126 memset(buf, 0, sizeof(buf)); in listener()
129 ret = recvfrom(fd, buf, sizeof(buf), 0, in listener()
136 hdr = (struct net_mgmt_msghdr *)buf; in listener()

Completed in 91 milliseconds

1234567