/Zephyr-latest/tests/lib/ringbuffer/src/ |
D | concurrent.c | 104 uint32_t len; in produce_cpy() local 114 len = ring_buf_put(&ringbuf, buf, sizeof(buf)); in produce_cpy() 115 cnt -= (sizeof(buf) - len); in produce_cpy() 124 uint32_t len; in consume_cpy() local 130 len = ring_buf_get(&ringbuf, buf, sizeof(buf)); in consume_cpy() 131 for (int i = 0; i < len; i++) { in consume_cpy() 186 uint32_t len; in produce() local 193 len = ring_buf_put_claim(&ringbuf, &data, wr); in produce() 194 if (len == 0) { in produce() 195 len = ring_buf_put_claim(&ringbuf, &data, wr); in produce() [all …]
|
/Zephyr-latest/lib/net_buf/ |
D | buf_simple.c | 38 buf->len = size; in net_buf_simple_init_with_data() 44 __ASSERT_NO_MSG(buf->len == 0U); in net_buf_simple_reserve() 56 void *net_buf_simple_add(struct net_buf_simple *buf, size_t len) in net_buf_simple_add() argument 60 NET_BUF_SIMPLE_DBG("buf %p len %zu", buf, len); in net_buf_simple_add() 62 __ASSERT_NO_MSG(net_buf_simple_tailroom(buf) >= len); in net_buf_simple_add() 64 buf->len += len; in net_buf_simple_add() 69 size_t len) in net_buf_simple_add_mem() argument 71 NET_BUF_SIMPLE_DBG("buf %p len %zu", buf, len); in net_buf_simple_add_mem() 73 return memcpy(net_buf_simple_add(buf, len), mem, len); in net_buf_simple_add_mem() 172 void *net_buf_simple_remove_mem(struct net_buf_simple *buf, size_t len) in net_buf_simple_remove_mem() argument [all …]
|
/Zephyr-latest/subsys/bluetooth/mesh/ |
D | sol_pdu_rpl_cli.c | 22 uint8_t *len; member 31 uint8_t len = 0; in handle_status() local 35 if (buf->len > 3) { in handle_status() 46 if (buf->len == 0) { in handle_status() 50 len = net_buf_simple_pull_u8(buf); in handle_status() 52 if (len < 2) { in handle_status() 58 primary, len); in handle_status() 66 if (param->len) { in handle_status() 67 *param->len = len; in handle_status() 74 cli->srpl_status(cli, ctx->addr, primary, len); in handle_status() [all …]
|
/Zephyr-latest/tests/subsys/usb/os_desc/src/ |
D | usb_osdesc.c | 92 int32_t len = 0; in test_handle_os_desc() local 99 ret = usb_handle_os_desc(&setup, &len, &data); in test_handle_os_desc() 101 TC_PRINT("%s: ret %d len %u data %p\n", __func__, ret, len, data); in test_handle_os_desc() 104 zassert_equal(len, sizeof(msosv1_string_descriptor), "Wrong length"); in test_handle_os_desc() 105 zassert_true(!memcmp(data, &msosv1_string_descriptor, len), in test_handle_os_desc() 112 int32_t len = 0; in test_handle_os_desc_feature() local 119 ret = usb_handle_os_desc_feature(&setup, &len, &data); in test_handle_os_desc_feature() 121 TC_PRINT("%s: ret %d len %u data %p\n", __func__, ret, len, data); in test_handle_os_desc_feature() 124 zassert_equal(len, sizeof(msosv1_compatid_descriptor), "Wrong length"); in test_handle_os_desc_feature() 125 zassert_true(!memcmp(data, &msosv1_compatid_descriptor, len), in test_handle_os_desc_feature()
|
/Zephyr-latest/tests/bluetooth/classic/sdp_c/src/ |
D | sdp_client.c | 126 if ((result == NULL) || (result->resp_buf == NULL) || (result->resp_buf->len == 0)) { in sdp_discover_func() 158 for (uint16_t i = 0; i < result->resp_buf->len; i++) { in sdp_discover_func() 174 size_t len; in cmd_ssa_discovery() local 178 len = strlen(argv[1]); in cmd_ssa_discovery() 180 if (len == (BT_UUID_SIZE_16 * 2)) { in cmd_ssa_discovery() 184 hex2bin(argv[1], len, (uint8_t *)&val, sizeof(val)); in cmd_ssa_discovery() 187 } else if (len == (BT_UUID_SIZE_32 * 2)) { in cmd_ssa_discovery() 191 hex2bin(argv[1], len, (uint8_t *)&val, sizeof(val)); in cmd_ssa_discovery() 194 } else if (len == (BT_UUID_SIZE_128 * 2)) { in cmd_ssa_discovery() 196 hex2bin(argv[1], len, &sdp_discover_uuid.u128.val[0], in cmd_ssa_discovery() [all …]
|
/Zephyr-latest/tests/kernel/pipe/pipe_api/src/ |
D | stress.c | 26 const size_t len = WRITE_LEN; in ZTEST() local 35 while (sent < len) { in ZTEST() 36 rc = k_pipe_write(&pipe, &buf[sent], len - sent, K_FOREVER); in ZTEST() 47 const size_t len = READ_LEN; in ZTEST() local 57 while (sent < len) { in ZTEST() 58 rc = k_pipe_write(&pipe, &buf[sent], len - sent, K_FOREVER); in ZTEST() 63 while (read < len) { in ZTEST() 64 rc = k_pipe_read(&pipe, &buf[read], len - read, K_FOREVER); in ZTEST()
|
/Zephyr-latest/tests/subsys/mgmt/mcumgr/mcumgr_client/src/ |
D | os_gr_stub.c | 36 nb->len = 0; in os_reset_response() 61 zcbor_tstr_encode_ptr(zse, echo_data->value, echo_data->len) && in os_echo_response() 68 nb->len = zse->payload - nb->data; in os_echo_response() 84 zcbor_new_decode_state(zsd, ARRAY_SIZE(zsd), nb->data + sizeof(struct smp_hdr), nb->len, 1, in os_echo_verify() 86 echo_data.len = 0; in os_echo_verify() 89 if (rc || !echo_data.len) { in os_echo_verify() 90 printf("Corrupted data %d or no echo data %d\r\n", rc, echo_data.len); in os_echo_verify() 92 } else if (memcmp(echo_data.value, echo_ptr, echo_data.len)) { in os_echo_verify()
|
/Zephyr-latest/subsys/mgmt/osdp/src/ |
D | osdp.c | 49 static void osdp_handle_in_byte(struct osdp_device *p, uint8_t *buf, int len) in osdp_handle_in_byte() argument 57 ring_buf_put(&p->rx_buf, buf, len); /* put rest */ in osdp_handle_in_byte() 63 ring_buf_put(&p->rx_buf, buf, len); in osdp_handle_in_byte() 68 size_t len; in osdp_uart_isr() local 75 len = uart_fifo_read(dev, buf, sizeof(buf)); in osdp_uart_isr() 76 if (len > 0) { in osdp_uart_isr() 77 osdp_handle_in_byte(p, buf, len); in osdp_uart_isr() 82 len = ring_buf_get(&p->tx_buf, buf, 1); in osdp_uart_isr() 83 if (!len) { in osdp_uart_isr() 98 static int osdp_uart_receive(void *data, uint8_t *buf, int len) in osdp_uart_receive() argument [all …]
|
/Zephyr-latest/drivers/eeprom/ |
D | eeprom_mb85rcxx.c | 59 static size_t mb85rcxx_remaining_len_in_page(const struct device *dev, off_t offset, size_t len) in mb85rcxx_remaining_len_in_page() argument 65 if (rem > len) { in mb85rcxx_remaining_len_in_page() 66 rem = len; in mb85rcxx_remaining_len_in_page() 100 static int mb85rcxx_read(const struct device *dev, off_t offset, void *buf, size_t len) in mb85rcxx_read() argument 109 if (offset + len > cfg->size) { in mb85rcxx_read() 116 while (len) { in mb85rcxx_read() 118 len_in_page = mb85rcxx_remaining_len_in_page(dev, offset, len); in mb85rcxx_read() 128 len -= len_in_page; in mb85rcxx_read() 138 const void *buf, size_t len) in mb85rcxx_i2c_write() argument 144 msgs[0].len = DIV_ROUND_UP(cfg->addr_width, 8); in mb85rcxx_i2c_write() [all …]
|
D | eeprom_mchp_xec.c | 171 uint8_t *buf, size_t len, off_t offset) in eeprom_xec_data_read_32_bytes() argument 174 eeprom_xec_execute_reg_set(regs, len, XEC_EEPROM_EXC_CMD_READ, offset); in eeprom_xec_data_read_32_bytes() 180 eeprom_xec_data_buffer_read(regs, len, buf); in eeprom_xec_data_read_32_bytes() 184 uint8_t *buf, size_t len, off_t offset) in eeprom_xec_data_write_32_bytes() argument 194 if ((sz + len) > XEC_EEPROM_PAGE_SIZE) { in eeprom_xec_data_write_32_bytes() 209 len = (len - rem_bytes); in eeprom_xec_data_write_32_bytes() 213 eeprom_xec_data_buffer_write(regs, len, buf); in eeprom_xec_data_write_32_bytes() 216 eeprom_xec_execute_reg_set(regs, len, XEC_EEPROM_EXC_CMD_WRITE, offset); in eeprom_xec_data_write_32_bytes() 225 size_t len) in eeprom_xec_read() argument 234 if (len == 0) { in eeprom_xec_read() [all …]
|
D | eeprom_at2x.c | 92 size_t len) in eeprom_at2x_read() argument 99 if (!len) { in eeprom_at2x_read() 103 if ((offset + len) > config->size) { in eeprom_at2x_read() 109 while (len) { in eeprom_at2x_read() 110 ret = config->read_fn(dev, offset, pbuf, len); in eeprom_at2x_read() 119 len -= ret; in eeprom_at2x_read() 129 size_t len) in eeprom_at2x_limit_write_count() argument 132 size_t count = len; in eeprom_at2x_limit_write_count() 151 size_t len) in eeprom_at2x_write() argument 163 if (!len) { in eeprom_at2x_write() [all …]
|
/Zephyr-latest/subsys/mgmt/mcumgr/transport/src/ |
D | smp_dummy.c | 70 static int mcumgr_dummy_tx_pkt(const uint8_t *data, int len, 158 int dummy_mcumgr_send_raw(const void *data, int len) in dummy_mcumgr_send_raw() argument 161 MIN(len, (sizeof(smp_send_buffer) - smp_send_pos - 1)); in dummy_mcumgr_send_raw() 182 rc = mcumgr_dummy_tx_pkt(nb->data, nb->len, dummy_mcumgr_send_raw); in smp_dummy_tx_pkt_int() 295 static uint16_t mcumgr_dummy_calc_crc(const uint8_t *data, int len) in mcumgr_dummy_calc_crc() argument 297 return crc16_itu_t(0x0000, data, len); in mcumgr_dummy_calc_crc() 300 static int mcumgr_dummy_parse_op(const uint8_t *buf, int len) in mcumgr_dummy_parse_op() argument 304 if (len < sizeof(op)) { in mcumgr_dummy_parse_op() 320 if (rx_ctxt->nb->len < 2) { in mcumgr_dummy_extract_len() 334 rc = base64_decode(rx_ctxt->nb->data + rx_ctxt->nb->len, in mcumgr_dummy_decode_frag() [all …]
|
/Zephyr-latest/drivers/display/ |
D | display_gc9x01x.c | 46 uint8_t len; member 58 .len = 1U, 63 .len = 1U, 68 .len = 1U, 73 .len = 1U, 78 .len = 1U, 83 .len = 1U, 88 .len = 1U, 93 .len = 1U, 98 .len = 1U, [all …]
|
/Zephyr-latest/drivers/bluetooth/hci/ |
D | hci_nxp.c | 36 uint16_t len; member 232 static struct net_buf *bt_evt_recv(uint8_t *data, size_t len) in bt_evt_recv() argument 245 if (len < BT_HCI_EVT_HDR_SIZE) { in bt_evt_recv() 249 if ((len - BT_HCI_EVT_HDR_SIZE) != payload_len) { in bt_evt_recv() 261 if (len > space_in_buffer) { in bt_evt_recv() 263 evt_hdr, len, space_in_buffer); in bt_evt_recv() 268 net_buf_add_mem(buf, data, len); in bt_evt_recv() 281 static struct net_buf *bt_acl_recv(uint8_t *data, size_t len) in bt_acl_recv() argument 287 if (len < BT_HCI_ACL_HDR_SIZE) { in bt_acl_recv() 292 if ((len - BT_HCI_ACL_HDR_SIZE) != payload_len) { in bt_acl_recv() [all …]
|
/Zephyr-latest/samples/bluetooth/peripheral/src/ |
D | main.c | 51 void *buf, uint16_t len, uint16_t offset) in read_vnd() argument 55 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_vnd() 60 const void *buf, uint16_t len, uint16_t offset, in write_vnd() argument 65 if (offset + len > VND_MAX_LEN) { in write_vnd() 69 memcpy(value + offset, buf, len); in write_vnd() 70 value[offset + len] = 0; in write_vnd() 72 return len; in write_vnd() 108 uint16_t len, uint16_t offset, uint8_t flags) in write_long_vnd() argument 116 if (offset + len > VND_LONG_MAX_LEN) { in write_long_vnd() 120 memcpy(value + offset, buf, len); in write_long_vnd() [all …]
|
/Zephyr-latest/drivers/flash/ |
D | flash_stm32.c | 48 uint32_t len, bool write) in flash_stm32_valid_range() argument 50 if (write && !flash_stm32_valid_write(offset, len)) { in flash_stm32_valid_range() 53 return flash_stm32_range_exists(dev, offset, len); in flash_stm32_valid_range() 109 off_t offset, size_t len) in flash_stm32_flush_caches() argument 116 ARG_UNUSED(len); in flash_stm32_flush_caches() 122 ARG_UNUSED(len); in flash_stm32_flush_caches() 134 + offset), len); in flash_stm32_flush_caches() 140 size_t len) in flash_stm32_read() argument 142 if (!flash_stm32_valid_range(dev, offset, len, false)) { in flash_stm32_read() 144 (long int) offset, len); in flash_stm32_read() [all …]
|
D | flash_hp_ra.c | 50 static bool flash_ra_valid_range(struct flash_hp_ra_data *flash_data, off_t offset, size_t len) in flash_ra_valid_range() argument 55 (flash_data->area_size - offset < len) || (len > UINT32_MAX - offset)) { in flash_ra_valid_range() 62 ((len + offset) > FLASH_HP_CF_DUAL_HIGH_END_ADDRESS) || in flash_ra_valid_range() 63 ((len + offset) > FLASH_HP_CF_DUAL_LOW_END_ADDRESS && in flash_ra_valid_range() 64 (len + offset) < FLASH_HP_BANK2_OFFSET) || in flash_ra_valid_range() 65 (len > UINT32_MAX - offset)) { in flash_ra_valid_range() 71 (flash_data->area_size - offset < len) || (len > UINT32_MAX - offset)) { in flash_ra_valid_range() 78 static int flash_ra_read(const struct device *dev, off_t offset, void *data, size_t len) in flash_ra_read() argument 82 if (!flash_ra_valid_range(flash_data, offset, len)) { in flash_ra_read() 86 if (!len) { in flash_ra_read() [all …]
|
/Zephyr-latest/tests/subsys/usb/bos/src/ |
D | test_bos.c | 173 size_t len = usb_bos_get_length(); in test_usb_bos_macros() local 175 TC_PRINT("length %zu\n", len); in test_usb_bos_macros() 182 LOG_HEXDUMP_DBG((void *)hdr, len, "Header"); in test_usb_bos_macros() 188 zassert_true(len == in test_usb_bos_macros() 193 zassert_true(!memcmp(hdr, &webusb_bos_descriptor, len) || in test_usb_bos_macros() 194 !memcmp(hdr, &webusb_bos_descriptor_2, len), in test_usb_bos_macros() 201 int32_t len = 0; in test_usb_bos() local 209 ret = usb_handle_bos(&setup, &len, &data); in test_usb_bos() 211 TC_PRINT("%s: ret %d len %u data %p\n", __func__, ret, len, data); in test_usb_bos() 214 zassert_equal(len, sizeof(webusb_bos_descriptor), "Wrong length"); in test_usb_bos() [all …]
|
/Zephyr-latest/samples/bluetooth/iso_peripheral/ |
D | README.rst | 42 Incoming data channel 0x20000698 len 1 44 Incoming data channel 0x20000698 len 2 46 Incoming data channel 0x20000698 len 3 48 Incoming data channel 0x20000698 len 4 50 Incoming data channel 0x20000698 len 5 52 Incoming data channel 0x20000698 len 6 54 Incoming data channel 0x20000698 len 7 56 Incoming data channel 0x20000698 len 8 58 Incoming data channel 0x20000698 len 9 60 Incoming data channel 0x20000698 len 10 [all …]
|
/Zephyr-latest/samples/bluetooth/peripheral_hids/src/ |
D | hog.c | 94 uint16_t len, uint16_t offset) in read_info() argument 96 return bt_gatt_attr_read(conn, attr, buf, len, offset, attr->user_data, in read_info() 102 uint16_t len, uint16_t offset) in read_report_map() argument 104 return bt_gatt_attr_read(conn, attr, buf, len, offset, report_map, in read_report_map() 110 uint16_t len, uint16_t offset) in read_report() argument 112 return bt_gatt_attr_read(conn, attr, buf, len, offset, attr->user_data, in read_report() 123 uint16_t len, uint16_t offset) in read_input_report() argument 125 return bt_gatt_attr_read(conn, attr, buf, len, offset, NULL, 0); in read_input_report() 130 const void *buf, uint16_t len, uint16_t offset, in write_ctrl_point() argument 135 if (offset + len > sizeof(ctrl_point)) { in write_ctrl_point() [all …]
|
/Zephyr-latest/tests/subsys/settings/file/src/ |
D | settings_test_file.c | 23 int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb, 67 int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb, in c1_handle_set() argument 76 val_len = len; in c1_handle_set() 85 val_len = len; in c1_handle_set() 94 val_len = len; in c1_handle_set() 145 int fsutil_read_file(const char *path, off_t offset, size_t len, void *dst, in fsutil_read_file() argument 159 r_len = fs_read(&file, dst, len); in fsutil_read_file() 170 int fsutil_write_file(const char *path, const void *data, size_t len) in fsutil_write_file() argument 182 if (fs_write(&file, data, len) != len) { in fsutil_write_file() 210 uint32_t len; in settings_test_file_strstr() local [all …]
|
/Zephyr-latest/samples/boards/nordic/mesh/onoff_level_lighting_vnd_app/src/ |
D | storage.c | 118 ssize_t len = 0; in ps_set() local 126 len = read_cb(cb_arg, &reset_counter, in ps_set() 131 len = read_cb(cb_arg, &ctl->tt, sizeof(ctl->tt)); in ps_set() 135 len = read_cb(cb_arg, &ctl->onpowerup, in ps_set() 140 len = read_cb(cb_arg, &ctl->light->def, in ps_set() 145 len = read_cb(cb_arg, &ctl->temp->def, in ps_set() 150 len = read_cb(cb_arg, &ctl->duv->def, in ps_set() 155 len = read_cb(cb_arg, &ctl->light->last, in ps_set() 160 len = read_cb(cb_arg, &ctl->light->target, in ps_set() 165 len = read_cb(cb_arg, &ctl->temp->target, in ps_set() [all …]
|
/Zephyr-latest/drivers/entropy/ |
D | entropy_smartbond.c | 34 #define RNG_POOL_DEFINE(name, len) uint8_t name[sizeof(struct rng_pool) + (len)] argument 137 static uint16_t rng_pool_get(struct rng_pool *rngp, uint8_t *buf, uint16_t len) in rng_pool_get() argument 157 if (available < len) { in rng_pool_get() 158 len = available; in rng_pool_get() 165 rngp->first_alloc = (first + len) & mask; in rng_pool_get() 168 while (likely(len--)) { in rng_pool_get() 184 len = dst - buf; in rng_pool_get() 185 available = available - len; in rng_pool_get() 190 return len; in rng_pool_get() 271 static int entropy_smartbond_get_entropy(const struct device *dev, uint8_t *buf, uint16_t len) in entropy_smartbond_get_entropy() argument [all …]
|
/Zephyr-latest/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/ |
D | service_b_2_2.c | 62 uint16_t len, uint16_t offset) in read_value_v5() argument 66 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_value_v5() 85 uint16_t len, uint16_t offset, uint8_t flags) in write_value_v5() argument 92 if (offset + len > sizeof(value_v5_value)) { in write_value_v5() 96 memcpy(value + offset, buf, len); in write_value_v5() 98 return len; in write_value_v5() 116 void *buf, uint16_t len, uint16_t offset) in read_des_v5d4__128_bit_uuid() argument 120 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_des_v5d4__128_bit_uuid()
|
D | service_b_2_3.c | 62 uint16_t len, uint16_t offset) in read_value_v5() argument 66 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_value_v5() 85 uint16_t len, uint16_t offset, uint8_t flags) in write_value_v5() argument 92 if (offset + len > sizeof(value_v5_value)) { in write_value_v5() 96 memcpy(value + offset, buf, len); in write_value_v5() 98 return len; in write_value_v5() 116 void *buf, uint16_t len, uint16_t offset) in read_des_v5d4__128_bit_uuid() argument 120 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_des_v5d4__128_bit_uuid()
|