Home
last modified time | relevance | path

Searched refs:len (Results 201 – 225 of 2148) sorted by relevance

12345678910>>...86

/Zephyr-latest/tests/bsim/bluetooth/mesh/src/
Dmesh_test.c36 size_t len = buf->len + BT_MESH_MODEL_OP_LEN(TEST_MSG_OP_1); in msg_rx() local
41 if (buf->len) { in msg_rx()
52 LOG_INF("\tlen: %d bytes", len); in msg_rx()
58 for (int i = 1; buf->len; i++) { in msg_rx()
72 msg->len = len; in msg_rx()
84 LOG_INF("\tlen: %d bytes", buf->len); in data_rx()
91 data_cb(buf->data, buf->len); in data_rx()
346 int bt_mesh_test_recv(uint16_t len, uint16_t dst, const uint8_t *uuid, k_timeout_t timeout) in bt_mesh_test_recv() argument
354 if (len != msg->len) { in bt_mesh_test_recv()
355 LOG_ERR("Recv: Invalid message length (%u, expected %u)", msg->len, len); in bt_mesh_test_recv()
[all …]
/Zephyr-latest/tests/bsim/bluetooth/ll/edtt/gatt_test_app/src/gatt/
Dservice_b_3_1.c46 uint16_t len, uint16_t offset) in read_value_v6() argument
50 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_value_v6()
69 uint16_t len, uint16_t offset, uint8_t flags) in write_value_v6() argument
76 if (offset + len > sizeof(value_v6_value)) { in write_value_v6()
80 memcpy(value + offset, buf, len); in write_value_v6()
82 return len; in write_value_v6()
Dservice_b_3_2.c48 uint16_t len, uint16_t offset) in read_value_v6() argument
52 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_value_v6()
71 uint16_t len, uint16_t offset, uint8_t flags) in write_value_v6() argument
78 if (offset + len > sizeof(value_v6_value)) { in write_value_v6()
82 memcpy(value + offset, buf, len); in write_value_v6()
84 return len; in write_value_v6()
177 ind_params.len = sizeof(value_v6_value); in service_b_3_2_value_v6_indicate()
Dservice_b_3_3.c48 uint16_t len, uint16_t offset) in read_value_v6() argument
52 return bt_gatt_attr_read(conn, attr, buf, len, offset, value, in read_value_v6()
71 uint16_t len, uint16_t offset, uint8_t flags) in write_value_v6() argument
77 if (offset + len > sizeof(value_v6_value)) in write_value_v6()
80 memcpy(value + offset, buf, len); in write_value_v6()
82 return len; in write_value_v6()
175 ind_params.len = sizeof(value_v6_value); in service_b_3_3_value_v6_indicate()
/Zephyr-latest/tests/subsys/settings/fcb/src/
Dsettings_test_compress_deleted.c31 int c4_handle_set(const char *name, size_t len, settings_read_cb read_cb,
42 int c4_handle_set(const char *name, size_t len, settings_read_cb read_cb, in c4_handle_set() argument
67 int len; in check_compressed_cb() local
69 len = entry_ctx->loc.fe_data_len; in check_compressed_cb()
70 if (len >= sizeof(buf)) { in check_compressed_cb()
71 len = sizeof(buf) - 1; in check_compressed_cb()
75 FCB_ENTRY_FA_DATA_OFF(entry_ctx->loc), buf, len); in check_compressed_cb()
80 buf[len] = '\0'; in check_compressed_cb()
/Zephyr-latest/subsys/shell/backends/
Dshell_dummy.c68 if (sh_dummy->len + store_cnt >= sizeof(sh_dummy->buf)) { in write()
69 store_cnt = sizeof(sh_dummy->buf) - sh_dummy->len - 1; in write()
71 memcpy(sh_dummy->buf + sh_dummy->len, data, store_cnt); in write()
72 sh_dummy->len += store_cnt; in write()
125 sh_dummy->buf[sh_dummy->len] = '\0'; in shell_backend_dummy_get_output()
126 *sizep = sh_dummy->len; in shell_backend_dummy_get_output()
127 sh_dummy->len = 0; in shell_backend_dummy_get_output()
137 sh_dummy->len = 0; in shell_backend_dummy_clear_output()
/Zephyr-latest/drivers/bluetooth/hci/
Dapollox_blue.h40 typedef int (*spi_transmit_fun)(uint8_t *data, uint16_t len);
61 int bt_apollo_spi_send(uint8_t *data, uint16_t len, bt_spi_transceive_fun transceive);
72 int bt_apollo_spi_rcv(uint8_t *data, uint16_t *len, bt_spi_transceive_fun transceive);
106 bool bt_apollo_vnd_rcv_ongoing(uint8_t *data, uint16_t len);
/Zephyr-latest/lib/crc/
Dcrc32_sw.c9 uint32_t crc32_ieee(const uint8_t *data, size_t len) in crc32_ieee() argument
11 return crc32_ieee_update(0x0, data, len); in crc32_ieee()
14 uint32_t crc32_ieee_update(uint32_t crc, const uint8_t *data, size_t len) in crc32_ieee_update() argument
26 for (size_t i = 0; i < len; i++) { in crc32_ieee_update()
/Zephyr-latest/subsys/bluetooth/host/classic/
Dsdp.c224 uint16_t param_len = buf->len; in bt_sdp_send()
280 if (buf->len < 1) { in parse_data_elem()
301 if (buf->len < size_field_len) { in parse_data_elem()
325 if (buf->len < data_elem->data_size) { in parse_data_elem()
517 if (buf->len < data_elem.data_size) { in find_services()
603 if (buf->len < 3) { in sdp_svc_search_req()
632 if (buf->len < cont_state_size) { in sdp_svc_search_req()
667 if ((MIN(SDP_MTU, sdp->chan.tx.mtu) - resp_buf->len) < in sdp_svc_search_req()
704 LOG_DBG("Sending response, len %u", resp_buf->len); in sdp_svc_search_req()
863 sad->rsp_buf->len - sizeof(struct bt_sdp_hdr); in select_attrs()
[all …]
/Zephyr-latest/modules/mbedtls/
Dzephyr_entropy.c34 int mbedtls_hardware_poll(void *data, unsigned char *output, size_t len, in mbedtls_hardware_poll() argument
38 uint16_t request_len = len > UINT16_MAX ? UINT16_MAX : len; in mbedtls_hardware_poll()
42 if (output == NULL || olen == NULL || len == 0) { in mbedtls_hardware_poll()
46 ret = get_random_data(output, len, true); in mbedtls_hardware_poll()
/Zephyr-latest/drivers/spi/
Dspi_litex_common.h32 static inline void litex_spi_tx_put(uint8_t len, uint32_t *txd, const uint8_t *tx_buf) in litex_spi_tx_put() argument
34 switch (len) { in litex_spi_tx_put()
50 static inline void litex_spi_rx_put(uint8_t len, uint32_t *rxd, uint8_t *rx_buf) in litex_spi_rx_put() argument
52 switch (len) { in litex_spi_rx_put()
/Zephyr-latest/tests/net/utils/src/
Dmain.c431 int len; in ZTEST() member
437 .len = sizeof("192.0.2.1:80") - 1, in ZTEST()
452 .len = sizeof("192.0.2.2") - 1, in ZTEST()
467 .len = sizeof("192.0.2.3/foobar") - 8, in ZTEST()
482 .len = sizeof("255.255.255.255:0") - 1, in ZTEST()
497 .len = sizeof("127.0.0.42:65535") - 1, in ZTEST()
512 .len = sizeof("192.0.2.3:80/foobar") - 1, in ZTEST()
517 .len = sizeof("192.168.1.1:65536") - 1, in ZTEST()
522 .len = sizeof("192.0.2.3") - 1, in ZTEST()
537 .len = sizeof("192.0.2.3:80") - 1, in ZTEST()
[all …]
/Zephyr-latest/tests/lib/spsc_pbuf/src/
Dmain.c13 #define TLEN(len) ROUND_UP(HDR_LEN + len, sizeof(uint32_t)) argument
116 static int check_buffer(char *buf, uint16_t len, char exp) in check_buffer() argument
118 for (uint16_t i = 0; i < len; i++) { in check_buffer()
128 uint16_t len, in packet_write() argument
137 rv = spsc_pbuf_alloc(pb, len, &buf); in packet_write()
268 uint16_t len; in ZTEST() local
287 len = spsc_pbuf_claim(pb, &buf); in ZTEST()
288 zassert_equal(len1, len); in ZTEST()
289 spsc_pbuf_free(pb, len); in ZTEST()
293 len = spsc_pbuf_claim(pb, &buf); in ZTEST()
[all …]
/Zephyr-latest/tests/bsim/bluetooth/host/l2cap/reassembly/peer/src/
Dpeer.c145 LOG_HEXDUMP_ERR(buf->data, buf->len, "HCI META EVT"); in handle_meta_event()
186 LOG_HEXDUMP_ERR(buf->data, buf->len, "payload"); in handle_att()
200 LOG_DBG("Packet for CID %u len %u", cid, buf->len); in handle_l2cap()
201 LOG_HEXDUMP_DBG(buf->data, buf->len, "l2cap"); in handle_l2cap()
204 TEST_ASSERT(buf->len == hdr->len, "buflen = %d != hdrlen %d", in handle_l2cap()
205 buf->len, hdr->len); in handle_l2cap()
216 uint16_t len, handle; in handle_acl() local
220 len = sys_le16_to_cpu(hdr->len); in handle_acl()
229 LOG_DBG("ACL: conn %d len %d flags %d", handle, len, flags); in handle_acl()
230 LOG_HEXDUMP_DBG(buf->data, buf->len, "HCI ACL"); in handle_acl()
[all …]
/Zephyr-latest/drivers/flash/
Dflash_sam.c55 static bool sam_flash_validate_offset_len(off_t offset, size_t len) in sam_flash_validate_offset_len() argument
61 if ((offset + len) < len) { in sam_flash_validate_offset_len()
137 static bool sam_flash_section_is_within_area(const struct device *dev, off_t offset, size_t len) in sam_flash_section_is_within_area() argument
141 if ((offset + ((off_t)len)) < offset) { in sam_flash_section_is_within_area()
145 if ((offset >= 0) && ((offset + len) <= config->area_size)) { in sam_flash_section_is_within_area()
150 (size_t)offset, (size_t)(offset + len), (size_t)config->area_size); in sam_flash_section_is_within_area()
156 off_t offset, size_t len) in sam_flash_section_is_aligned_with_write_block_size() argument
161 sam_flash_aligned(len, config->parameters.write_block_size)) { in sam_flash_section_is_aligned_with_write_block_size()
166 (size_t)offset, (size_t)(offset + len), config->parameters.write_block_size); in sam_flash_section_is_aligned_with_write_block_size()
172 size_t len) in sam_flash_section_is_aligned_with_pages() argument
[all …]
Dflash_stm32wb0x.c109 off_t offset, uint32_t len) in is_valid_flash_range() argument
115 return !u32_add_overflow(offset, len, &offset_plus_len) in is_valid_flash_range()
128 off_t offset, uint32_t len) in is_writeable_flash_range() argument
131 || (len % WRITE_BLOCK_SIZE) != 0) { in is_writeable_flash_range()
135 return is_valid_flash_range(dev, offset, len); in is_writeable_flash_range()
139 off_t offset, uint32_t len) in is_erasable_flash_range() argument
142 || (len % ERASE_BLOCK_SIZE) != 0) { in is_erasable_flash_range()
146 return is_valid_flash_range(dev, offset, len); in is_erasable_flash_range()
322 void *buffer, size_t len) in flash_wb0x_read() argument
324 if (!len) { in flash_wb0x_read()
[all …]
/Zephyr-latest/tests/subsys/canbus/isotp/implementation/src/
Dmain.c72 zassert_equal(buf->len, DATA_SIZE_SF, "Data length (%d) should be %d.", in get_sf_net()
73 buf->len, DATA_SIZE_SF); in get_sf_net()
75 ret = memcmp(random_data, buf->data, buf->len); in get_sf_net()
77 memset(buf->data, 0, buf->len); in get_sf_net()
97 void print_hex(const uint8_t *ptr, size_t len) in print_hex() argument
99 while (len--) { in print_hex()
105 size_t len) in send_test_data() argument
109 ret = isotp_send(&send_ctx, can_dev, data, len, &rx_addr, &tx_addr, in send_test_data()
118 ret = memcmp(data, frag->data, frag->len); in check_frag()
121 print_hex(data, frag->len); in check_frag()
[all …]
/Zephyr-latest/subsys/net/lib/coap/
Dcoap.c69 uint16_t len);
85 uint16_t len) in encode_buffer() argument
87 memcpy(cpkt->data + offset, data, len); in encode_buffer()
88 cpkt->offset += len; in encode_buffer()
144 static inline bool append(struct coap_packet *cpkt, const uint8_t *data, uint16_t len) in append() argument
146 if (data == NULL || !enough_space(cpkt, len)) { in append()
150 encode_buffer(cpkt, cpkt->offset, data, len); in append()
155 static inline bool insert(struct coap_packet *cpkt, const uint8_t *data, uint16_t len, in insert() argument
158 if (data == NULL || !enough_space(cpkt, len)) { in insert()
162 memmove(&cpkt->data[offset + len], &cpkt->data[offset], cpkt->offset - offset); in insert()
[all …]
/Zephyr-latest/subsys/net/lib/lwm2m/
Dlwm2m_util.c24 int lwm2m_float_to_b32(double *in, uint8_t *b32, size_t len) in lwm2m_float_to_b32() argument
31 if (len != 4) { in lwm2m_float_to_b32()
37 memset(b32, 0, len); in lwm2m_float_to_b32()
82 memset(b32, 0, len); in lwm2m_float_to_b32()
105 int lwm2m_float_to_b64(double *in, uint8_t *b64, size_t len) in lwm2m_float_to_b64() argument
113 if (len != 8) { in lwm2m_float_to_b64()
119 memset(b64, 0, len); in lwm2m_float_to_b64()
164 memset(b64, 0, len); in lwm2m_float_to_b64()
191 int lwm2m_b32_to_float(uint8_t *b32, size_t len, double *out) in lwm2m_b32_to_float() argument
197 if (len != 4) { in lwm2m_b32_to_float()
[all …]
/Zephyr-latest/subsys/canbus/isotp/
Disotp.c110 uint32_t len; in receive_get_ff_length() local
113 len = ((pci & ISOTP_PCI_FF_DL_UPPER_MASK) << 8) | net_buf_pull_u8(buf); in receive_get_ff_length()
116 if (!len) { in receive_get_ff_length()
117 len = net_buf_pull_be32(buf); in receive_get_ff_length()
120 return len; in receive_get_ff_length()
125 uint8_t len = net_buf_pull_u8(buf) & ISOTP_PCI_SF_DL_MASK; in receive_get_sf_length() local
128 if (IS_ENABLED(CONFIG_CAN_FD_MODE) && fdf && !len) { in receive_get_sf_length()
129 len = net_buf_pull_u8(buf); in receive_get_sf_length()
132 return len; in receive_get_sf_length()
172 static inline struct net_buf *receive_alloc_buffer_chain(uint32_t len) in receive_alloc_buffer_chain() argument
[all …]
/Zephyr-latest/subsys/mgmt/mcumgr/transport/src/
Dsmp_reassembly.c33 int smp_reassembly_collect(struct smp_transport *smpt, const void *buf, uint16_t len) in smp_reassembly_collect() argument
40 if (len >= sizeof(struct smp_hdr)) { in smp_reassembly_collect()
51 if (len > MCUMGR_TRANSPORT_NETBUF_SIZE || in smp_reassembly_collect()
56 if (len > expected) { in smp_reassembly_collect()
73 if (smpt->__reassembly.expected >= len) { in smp_reassembly_collect()
74 net_buf_add_mem(smpt->__reassembly.current, buf, len); in smp_reassembly_collect()
75 smpt->__reassembly.expected -= len; in smp_reassembly_collect()
/Zephyr-latest/tests/drivers/uart/uart_async_rx/src/
Dmain.c16 static void mem_fill(uint8_t *buf, uint8_t init, size_t len) in mem_fill() argument
18 for (size_t i = 0; i < len; i++) { in mem_fill()
23 static bool mem_check(uint8_t *buf, uint8_t init, size_t len) in mem_check() argument
25 for (size_t i = 0; i < len; i++) { in mem_check()
165 uint32_t len = MAX(1, MIN(uart_async_rx_get_buf_len(async_rx), r & 0x7)); in producer_no_chunks() local
169 for (int i = 0; i < len; i++) { in producer_no_chunks()
173 uart_async_rx_on_rdy(async_rx, test_data->curr_buf, len); in producer_no_chunks()
206 size_t len; in consumer() local
210 len = uart_async_rx_data_claim(async_rx, &buf, claim_len); in consumer()
212 if (len == 0) { in consumer()
[all …]
/Zephyr-latest/tests/net/ppp/driver/src/
Dmain.c185 if (memcmp(expecting + pos, buf->data, buf->len)) { in ppp_l2_recv()
187 buf->len, in ppp_l2_recv()
189 LOG_HEXDUMP_DBG(buf->data, buf->len, in ppp_l2_recv()
195 pos += buf->len; in ppp_l2_recv()
278 crc = crc16_ccitt(0xffff, buf->data, buf->len); in check_fcs()
283 crc = crc16_ccitt(crc, buf->data, buf->len); in check_fcs()
315 static void ppp_verify_fcs(uint8_t *buf, int len) in ppp_verify_fcs() argument
323 pkt = net_pkt_alloc_with_buffer(net_iface, len, AF_UNSPEC, 0, K_NO_WAIT); in ppp_verify_fcs()
327 while (ptr < &buf[len]) { in ppp_verify_fcs()
346 net_buf_frag_last(pkt->buffer)->len -= 1; in ppp_verify_fcs()
[all …]
/Zephyr-latest/subsys/bluetooth/services/nus/
Dnus.c13 const void *buf, uint16_t len, uint16_t offset, uint8_t flags) in nus_bt_chr_write() argument
23 listener->received(conn, buf, len, listener->ctx); in nus_bt_chr_write()
27 return len; in nus_bt_chr_write()
68 uint16_t len) in bt_nus_inst_send() argument
70 if (!data || !len) { in bt_nus_inst_send()
82 return bt_gatt_notify(conn, &instance->svc->attrs[1], data, len); in bt_nus_inst_send()
/Zephyr-latest/lib/utils/
Dcobs.c16 size_t max_encoded_size = cobs_max_encoded_len(src->len, flags); in cobs_encode()
29 while (src->len > 0) { in cobs_encode()
42 if (code == 0xFF && (src->len - 1 >= 0)) { in cobs_encode()
72 while (src->len > 0) { in cobs_decode()
81 if (src->len < (offset - 1)) { in cobs_decode()
98 if (offset != 0xFF && src->len > 0) { in cobs_decode()

12345678910>>...86