Home
last modified time | relevance | path

Searched refs:len (Results 76 – 100 of 2148) sorted by relevance

12345678910>>...86

/Zephyr-latest/tests/lib/cbprintf_package/src/
Dmain.c41 static void dump(const char *desc, uint8_t *package, size_t len) in dump() argument
44 for (size_t i = 0; i < len; i++) { in dump()
51 uint8_t *package, size_t len) in unpack() argument
72 int len = rc; \
75 rt_package[len + ALIGN_OFFSET]; \
76 memset(rt_package, 0, len + ALIGN_OFFSET); \
78 rc = cbprintf_package(pkg, len, 0, fmt, __VA_ARGS__); \
79 zassert_equal(rc, len, "cbprintf_package() returned %d, expected %d", \
80 rc, len); \
81 dump("runtime", pkg, len); \
[all …]
/Zephyr-latest/tests/bsim/bluetooth/audio/src/
Dbap_common.h68 void print_hex(const uint8_t *ptr, size_t len);
75 static inline bool valid_metadata_type(uint8_t type, uint8_t len) in valid_metadata_type() argument
80 if (len != 2) { in valid_metadata_type()
86 if (len != BT_AUDIO_LANG_SIZE) { in valid_metadata_type()
92 if (len != 1) { in valid_metadata_type()
99 if (len < 1) { in valid_metadata_type()
105 if (len < 2) { in valid_metadata_type()
/Zephyr-latest/drivers/mipi_dsi/
Dmipi_dsi.c13 void *buf, size_t len) in mipi_dsi_generic_read() argument
18 .rx_len = len, in mipi_dsi_generic_read()
43 const void *buf, size_t len) in mipi_dsi_generic_write() argument
47 .tx_len = len in mipi_dsi_generic_write()
50 switch (len) { in mipi_dsi_generic_write()
72 uint8_t cmd, void *buf, size_t len) in mipi_dsi_dcs_read() argument
78 .rx_len = len in mipi_dsi_dcs_read()
85 uint8_t cmd, const void *buf, size_t len) in mipi_dsi_dcs_write() argument
90 .tx_len = len in mipi_dsi_dcs_write()
93 switch (len) { in mipi_dsi_dcs_write()
/Zephyr-latest/subsys/net/lib/sockets/
Dsockets_misc.c12 int z_impl_zsock_gethostname(char *buf, size_t len) in z_impl_zsock_gethostname() argument
16 strncpy(buf, p, len); in z_impl_zsock_gethostname()
22 static inline int z_vrfy_zsock_gethostname(char *buf, size_t len) in z_vrfy_zsock_gethostname() argument
24 K_OOPS(K_SYSCALL_MEMORY_WRITE(buf, len)); in z_vrfy_zsock_gethostname()
25 return z_impl_zsock_gethostname(buf, len); in z_vrfy_zsock_gethostname()
/Zephyr-latest/drivers/sensor/st/stmemsc/
Dstmemsc_i3c.c13 uint8_t reg_addr, uint8_t *value, uint8_t len) in stmemsc_i3c_read() argument
17 return i3c_burst_read(target, reg_addr, value, len); in stmemsc_i3c_read()
21 uint8_t reg_addr, uint8_t *value, uint8_t len) in stmemsc_i3c_write() argument
26 __ASSERT_NO_MSG(len <= sizeof(buf) - 1); in stmemsc_i3c_write()
29 memcpy(&buf[1], value, len); in stmemsc_i3c_write()
31 return i3c_write(target, buf, len + 1); in stmemsc_i3c_write()
/Zephyr-latest/subsys/mgmt/osdp/src/
Dosdp_phy.c159 int len, int max_len) in osdp_phy_packet_finalize() argument
165 if ((unsigned long)len <= sizeof(struct osdp_packet_header)) { in osdp_phy_packet_finalize()
178 len -= 1; in osdp_phy_packet_finalize()
189 pkt->len_lsb = BYTE_0(len + 2); in osdp_phy_packet_finalize()
190 pkt->len_msb = BYTE_1(len + 2); in osdp_phy_packet_finalize()
207 data_len = len - (sizeof(struct osdp_packet_header) + in osdp_phy_packet_finalize()
209 len -= data_len; in osdp_phy_packet_finalize()
219 len += osdp_encrypt_data(pd, is_cp_mode(pd), data, data_len); in osdp_phy_packet_finalize()
222 if (len + 4 > max_len) { in osdp_phy_packet_finalize()
227 pkt->len_lsb = BYTE_0(len + 2 + 4); in osdp_phy_packet_finalize()
[all …]
Dosdp_common.c22 void osdp_dump(const char *head, uint8_t *buf, int len) in osdp_dump() argument
24 LOG_HEXDUMP_DBG(buf, len, head); in osdp_dump()
27 uint16_t osdp_compute_crc16(const uint8_t *buf, size_t len) in osdp_compute_crc16() argument
29 return crc16_itu_t(0x1D0F, buf, len); in osdp_compute_crc16()
51 void osdp_encrypt(uint8_t *key, uint8_t *iv, uint8_t *data, int len) in osdp_encrypt() argument
61 .in_len = len, in osdp_encrypt()
63 .out_len = len in osdp_encrypt()
98 void osdp_decrypt(uint8_t *key, uint8_t *iv, uint8_t *data, int len) in osdp_decrypt() argument
108 .in_len = len, in osdp_decrypt()
110 .out_len = len in osdp_decrypt()
[all …]
/Zephyr-latest/subsys/settings/src/
Dsettings_line.c18 int (*read_cb)(void *ctx, off_t off, char *buf, size_t *len);
19 int (*write_cb)(void *ctx, off_t off, char const *buf, size_t len);
129 entry_ctx->seek += entry_ctx->len; /* to begin of next line */ in settings_next_line_ctx()
131 entry_ctx->len = 0; /* ask read handler to ignore len */ in settings_next_line_ctx()
142 entry_ctx->len = readout; in settings_next_line_ctx()
176 size_t rem_size, len; in settings_line_raw_read_until() local
201 len = read_size - off; in settings_line_raw_read_until()
202 len = MIN(rem_size, len); in settings_line_raw_read_until()
206 pend = memchr(&temp_buf[off], *until_char, len); in settings_line_raw_read_until()
208 len = pend - &temp_buf[off]; in settings_line_raw_read_until()
[all …]
/Zephyr-latest/drivers/flash/
Dflash_ambiq.c58 static bool flash_ambiq_valid_range(off_t offset, size_t len) in flash_ambiq_valid_range() argument
60 if ((offset < 0) || offset >= SOC_NV_FLASH_SIZE || (SOC_NV_FLASH_SIZE - offset) < len) { in flash_ambiq_valid_range()
67 static int flash_ambiq_read(const struct device *dev, off_t offset, void *data, size_t len) in flash_ambiq_read() argument
71 if (!flash_ambiq_valid_range(offset, len)) { in flash_ambiq_read()
75 if (len == 0) { in flash_ambiq_read()
79 memcpy(data, (uint8_t *)(SOC_NV_FLASH_ADDR + offset), len); in flash_ambiq_read()
84 static int flash_ambiq_write(const struct device *dev, off_t offset, const void *data, size_t len) in flash_ambiq_write() argument
96 if (!flash_ambiq_valid_range(offset, len) || in flash_ambiq_write()
98 (len & (FLASH_WRITE_BLOCK_SIZE - 1))) { in flash_ambiq_write()
102 if (len == 0) { in flash_ambiq_write()
[all …]
Dsoc_flash_nrf_mram.c40 static uintptr_t validate_and_map_addr(off_t offset, size_t len, bool must_align) in validate_and_map_addr() argument
42 if (unlikely(offset < 0 || offset >= MRAM_SIZE || len > MRAM_SIZE - offset)) { in validate_and_map_addr()
43 LOG_ERR("invalid offset: %ld:%zu", offset, len); in validate_and_map_addr()
50 unlikely((addr % WRITE_BLOCK_SIZE) != 0 || (len % WRITE_BLOCK_SIZE) != 0)) { in validate_and_map_addr()
51 LOG_ERR("invalid alignment: %p:%zu", (void *)addr, len); in validate_and_map_addr()
85 static int nrf_mram_read(const struct device *dev, off_t offset, void *data, size_t len) in nrf_mram_read() argument
89 const uintptr_t addr = validate_and_map_addr(offset, len, false); in nrf_mram_read()
95 LOG_DBG("read: %p:%zu", (void *)addr, len); in nrf_mram_read()
97 memcpy(data, (void *)addr, len); in nrf_mram_read()
102 static int nrf_mram_write(const struct device *dev, off_t offset, const void *data, size_t len) in nrf_mram_write() argument
[all …]
/Zephyr-latest/tests/subsys/fs/zms/src/
Dmain.c108 size_t len; in execute_long_pattern_write() local
110 len = zms_read(fs, id, rd_buf, sizeof(rd_buf)); in execute_long_pattern_write()
111 zassert_true(len == -ENOENT, "zms_read unexpected failure: %d", len); in execute_long_pattern_write()
118 len = zms_write(fs, id, wr_buf, sizeof(wr_buf)); in execute_long_pattern_write()
119 zassert_true(len == sizeof(wr_buf), "zms_write failed: %d", len); in execute_long_pattern_write()
121 len = zms_read(fs, id, rd_buf, sizeof(rd_buf)); in execute_long_pattern_write()
122 zassert_true(len == sizeof(rd_buf), "zms_read unexpected failure: %d", len); in execute_long_pattern_write()
162 size_t len; in ZTEST_F() local
182 len = zms_write(&fixture->fs, TEST_DATA_ID, wr_buf_1, sizeof(wr_buf_1)); in ZTEST_F()
183 zassert_true(len == sizeof(wr_buf_1), "zms_write failed: %d", len); in ZTEST_F()
[all …]
/Zephyr-latest/drivers/console/
Dipm_console.c22 static size_t len; in console_out() local
25 if (c != '\n' && len < sizeof(buf)) { in console_out()
26 buf[len++] = c; in console_out()
30 ret = ipm_send(ipm_dev, 1, len, buf, len); in console_out()
36 len = 0; in console_out()
40 buf[len++] = c; in console_out()
/Zephyr-latest/tests/bsim/bluetooth/host/gatt/general/src/
Dgatt_server_test.c74 void *buf, uint16_t len, uint16_t offset) in read_test_chrc() argument
76 return bt_gatt_attr_read(conn, attr, buf, len, offset, in read_test_chrc()
82 const void *buf, uint16_t len, in write_test_chrc() argument
85 printk("chrc len %u offset %u\n", len, offset); in write_test_chrc()
87 if (len > sizeof(chrc_data)) { in write_test_chrc()
90 } else if (offset + len > sizeof(chrc_data)) { in write_test_chrc()
100 (void)memcpy(chrc_data + offset, buf, len); in write_test_chrc()
102 return len; in write_test_chrc()
107 void *buf, uint16_t len, uint16_t offset) in read_long_test_chrc() argument
109 return bt_gatt_attr_read(conn, attr, buf, len, offset, in read_long_test_chrc()
[all …]
/Zephyr-latest/tests/subsys/settings/fcb/src/
Dsettings_test_fcb.c30 int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb,
37 int c2_handle_set(const char *name, size_t len, settings_read_cb read_cb,
43 int c3_handle_set(const char *name, size_t len, settings_read_cb read_cb,
96 int c1_handle_set(const char *name, size_t len, settings_read_cb read_cb, in c1_handle_set() argument
117 val_len = len; in c1_handle_set()
219 int len; in c2_var_find() local
222 len = strlen(name); in c2_var_find()
223 zassert_true(len > 6, "string type expected"); in c2_var_find()
236 int len; in c2_handle_get() local
241 len = settings_name_next(name, &next); in c2_handle_get()
[all …]
/Zephyr-latest/samples/bluetooth/eddystone/src/
Dmain.c172 void *buf, uint16_t len, uint16_t offset) in read_caps() argument
176 return bt_gatt_attr_read(conn, attr, buf, len, offset, caps, in read_caps()
181 void *buf, uint16_t len, uint16_t offset) in read_slot() argument
183 return bt_gatt_attr_read(conn, attr, buf, len, offset, in read_slot()
189 uint16_t len, uint16_t offset, uint8_t flags) in write_slot() argument
193 if (offset + len > sizeof(value)) { in write_slot()
197 memcpy(&value, buf, len); in write_slot()
205 return len; in write_slot()
210 void *buf, uint16_t len, uint16_t offset) in read_tx_power() argument
218 return bt_gatt_attr_read(conn, attr, buf, len, offset, &slot->tx_power, in read_tx_power()
[all …]
/Zephyr-latest/tests/subsys/fs/multi-fs/src/
Dtest_ram_backend.c22 size_t len) in test_flash_ram_erase() argument
25 off_t end_offset = offset + len; in test_flash_ram_erase()
28 zassert_true(offset + len <= TEST_PARTITION_SIZE, in test_flash_ram_erase()
41 const void *data, size_t len) in test_flash_ram_write() argument
44 zassert_true(offset + len <= TEST_PARTITION_SIZE, in test_flash_ram_write()
47 memcpy(rambuf + offset, data, len); in test_flash_ram_write()
54 size_t len) in test_flash_ram_read() argument
57 zassert_true(offset + len <= TEST_PARTITION_SIZE, in test_flash_ram_read()
60 memcpy(data, rambuf + offset, len); in test_flash_ram_read()
/Zephyr-latest/modules/hal_nordic/nrf_802154/serialization/platform/
Dnrf_802154_spinel_backend_ipc.c41 static void endpoint_received(const void *data, size_t len, void *priv) in endpoint_received() argument
43 LOG_DBG("Received message of %u bytes.", len); in endpoint_received()
45 nrf_802154_spinel_encoded_packet_received(data, len); in endpoint_received()
106 uint32_t len; member
119 static nrf_802154_ser_err_t spinel_packet_from_thread_send(const uint8_t *data, uint32_t len) in spinel_packet_from_thread_send() argument
126 LOG_DBG("Scheduling %u bytes for send thread", len); in spinel_packet_from_thread_send()
131 buf->len = len; in spinel_packet_from_thread_send()
132 memcpy(buf->data, data, len); in spinel_packet_from_thread_send()
135 return (nrf_802154_ser_err_t)len; in spinel_packet_from_thread_send()
144 uint32_t expected_ret = buf->len; in spinel_packet_send_thread_fn()
[all …]
/Zephyr-latest/drivers/eeprom/
Deeprom_shell.c37 size_t len; in cmd_read() local
43 len = strtoul(argv[args_indx.length], NULL, 0); in cmd_read()
51 shell_print(sh, "Reading %zu bytes from EEPROM, offset %zu...", len, in cmd_read()
54 for (upto = 0; upto < len; upto += pending) { in cmd_read()
57 pending = MIN(len - upto, SHELL_HEXDUMP_BYTES_IN_LINE); in cmd_read()
79 size_t len; in cmd_write() local
84 len = argc - args_indx.data; in cmd_write()
86 if (len > sizeof(wr_buf)) { in cmd_write()
92 for (i = 0; i < len; i++) { in cmd_write()
107 shell_print(sh, "Writing %zu bytes to EEPROM...", len); in cmd_write()
[all …]
Deeprom_stm32.c26 size_t len) in eeprom_stm32_read() argument
31 if (!len) { in eeprom_stm32_read()
35 if ((offset + len) > config->size) { in eeprom_stm32_read()
42 while (len) { in eeprom_stm32_read()
47 len--; in eeprom_stm32_read()
56 const void *buf, size_t len) in eeprom_stm32_write() argument
62 if (!len) { in eeprom_stm32_write()
66 if ((offset + len) > config->size) { in eeprom_stm32_write()
75 while (len) { in eeprom_stm32_write()
88 len--; in eeprom_stm32_write()
/Zephyr-latest/drivers/bluetooth/hci/
Dhci_stm32wba.c99 static struct net_buf *treat_evt(const uint8_t *data, size_t len) in treat_evt() argument
106 if (len < sizeof(hdr)) { in treat_evt()
115 len -= sizeof(hdr); in treat_evt()
117 if (len != hdr.len) { in treat_evt()
119 LOG_ERR("len: %d, hdr.len: %d\n", len, hdr.len); in treat_evt()
122 LOG_DBG("len %u", hdr.len); in treat_evt()
139 if (buf_tailroom < len) { in treat_evt()
140 LOG_ERR("Not enough space in buffer %zu/%zu", len, buf_tailroom); in treat_evt()
145 net_buf_add_mem(buf, data, len); in treat_evt()
150 static struct net_buf *treat_acl(const uint8_t *data, size_t len, in treat_acl() argument
[all …]
/Zephyr-latest/tests/lib/sprintf/src/
Dmain.c396 int tvsnprintf(char *s, size_t len, const char *format, ...) in tvsnprintf() argument
402 r = vsnprintf(s, len, format, vargs); in tvsnprintf()
421 int len; in ZTEST() local
426 len = tvsnprintf(buffer, 0, "%x", DEADBEEF); in ZTEST()
427 zassert_true((len == strlen(DEADBEEF_LHEX_STR)), in ZTEST()
429 strlen(DEADBEEF_LHEX_STR), len); in ZTEST()
436 len = tvsnprintf(buffer, 4, "%x", DEADBEEF); in ZTEST()
437 zassert_true((len == strlen(DEADBEEF_LHEX_STR)), in ZTEST()
439 strlen(DEADBEEF_LHEX_STR), len); in ZTEST()
476 int len; in ZTEST() local
[all …]
/Zephyr-latest/drivers/sensor/tdk/icm42605/
Dicm42605_spi.c20 .len = 1, in inv_spi_single_write()
24 .len = 1, in inv_spi_single_write()
41 int inv_spi_read(const struct spi_dt_spec *bus, uint8_t reg, uint8_t *data, size_t len) in inv_spi_read() argument
50 .len = 1, in inv_spi_read()
60 .len = 1, in inv_spi_read()
64 .len = len, in inv_spi_read()
/Zephyr-latest/subsys/net/lib/mqtt_sn/
Dmqtt_sn_decoder.c40 size_t buflen = buf->len; in decode_payload_length()
88 dest->size = buf->len; in decode_data()
89 dest->data = net_buf_simple_pull_mem(buf, buf->len); in decode_data()
94 if (buf->len) { in decode_empty_message()
104 if (buf->len != 3) { in decode_msg_advertise()
116 if (buf->len != 1) { in decode_msg_searchgw()
127 if (buf->len < 1) { in decode_msg_gwinfo()
133 if (buf->len) { in decode_msg_gwinfo()
144 if (buf->len != 1) { in decode_msg_connack()
165 if (buf->len < 5) { in decode_msg_register()
[all …]
/Zephyr-latest/subsys/net/ip/
Dnet_context.c1118 net_if_get_link_addr(iface)->len; in net_context_bind()
1549 __maybe_unused static int get_bool_option(bool option, int *value, size_t *len) in get_bool_option() argument
1555 if (len != NULL) { in get_bool_option()
1556 if (*len != sizeof(int)) { in get_bool_option()
1560 *len = sizeof(int); in get_bool_option()
1568 __maybe_unused static int get_uint8_option(uint8_t option, uint8_t *value, size_t *len) in get_uint8_option() argument
1576 if (len != NULL) { in get_uint8_option()
1577 *len = sizeof(uint8_t); in get_uint8_option()
1583 __maybe_unused static int get_uint16_option(uint16_t option, int *value, size_t *len) in get_uint16_option() argument
1591 if (len != NULL) { in get_uint16_option()
[all …]
/Zephyr-latest/drivers/sensor/st/iis2dh/
Diis2dh_spi.c24 static int iis2dh_spi_read(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t len) in iis2dh_spi_read() argument
30 .len = 2, in iis2dh_spi_read()
39 .len = 1, in iis2dh_spi_read()
43 .len = len, in iis2dh_spi_read()
58 static int iis2dh_spi_write(const struct device *dev, uint8_t reg, uint8_t *data, uint16_t len) in iis2dh_spi_write() argument
65 .len = 1, in iis2dh_spi_write()
69 .len = len, in iis2dh_spi_write()

12345678910>>...86