Home
last modified time | relevance | path

Searched refs:adu (Results 1 – 6 of 6) sorted by relevance

/Zephyr-Core-3.6.0/subsys/modbus/
Dmodbus_raw.c51 int modbus_raw_submit_rx(const int iface, const struct modbus_adu *adu) in modbus_raw_submit_rx() argument
67 ctx->rx_adu.trans_id = adu->trans_id; in modbus_raw_submit_rx()
68 ctx->rx_adu.proto_id = adu->proto_id; in modbus_raw_submit_rx()
69 ctx->rx_adu.length = adu->length; in modbus_raw_submit_rx()
70 ctx->rx_adu.unit_id = adu->unit_id; in modbus_raw_submit_rx()
71 ctx->rx_adu.fc = adu->fc; in modbus_raw_submit_rx()
72 memcpy(ctx->rx_adu.data, adu->data, in modbus_raw_submit_rx()
73 MIN(adu->length, sizeof(ctx->rx_adu.data))); in modbus_raw_submit_rx()
79 void modbus_raw_put_header(const struct modbus_adu *adu, uint8_t *header) in modbus_raw_put_header() argument
81 uint16_t length = MIN(adu->length, CONFIG_MODBUS_BUFFER_SIZE); in modbus_raw_put_header()
[all …]
/Zephyr-Core-3.6.0/tests/subsys/modbus/src/
Dtest_modbus_raw.c19 int server_raw_cb(const int iface, const struct modbus_adu *adu, in server_raw_cb() argument
24 tmp_adu.trans_id = adu->trans_id; in server_raw_cb()
25 tmp_adu.proto_id = adu->proto_id; in server_raw_cb()
26 tmp_adu.length = adu->length; in server_raw_cb()
27 tmp_adu.unit_id = adu->unit_id; in server_raw_cb()
28 tmp_adu.fc = adu->fc; in server_raw_cb()
29 memcpy(tmp_adu.data, adu->data, in server_raw_cb()
30 MIN(adu->length, sizeof(tmp_adu.data))); in server_raw_cb()
42 int client_raw_cb(const int iface, const struct modbus_adu *adu, in client_raw_cb() argument
50 tmp_adu.trans_id = adu->trans_id; in client_raw_cb()
[all …]
Dtest_modbus.h50 int client_raw_cb(const int iface, const struct modbus_adu *adu,
52 int server_raw_cb(const int iface, const struct modbus_adu *adu,
/Zephyr-Core-3.6.0/samples/subsys/modbus/tcp_server/src/
Dmain.c163 static int server_raw_cb(const int iface, const struct modbus_adu *adu, in server_raw_cb() argument
168 tmp_adu.trans_id = adu->trans_id; in server_raw_cb()
169 tmp_adu.proto_id = adu->proto_id; in server_raw_cb()
170 tmp_adu.length = adu->length; in server_raw_cb()
171 tmp_adu.unit_id = adu->unit_id; in server_raw_cb()
172 tmp_adu.fc = adu->fc; in server_raw_cb()
173 memcpy(tmp_adu.data, adu->data, in server_raw_cb()
174 MIN(adu->length, CONFIG_MODBUS_BUFFER_SIZE)); in server_raw_cb()
214 static int modbus_tcp_reply(int client, struct modbus_adu *adu) in modbus_tcp_reply() argument
218 modbus_raw_put_header(adu, header); in modbus_tcp_reply()
[all …]
/Zephyr-Core-3.6.0/include/zephyr/modbus/
Dmodbus.h409 typedef int (*modbus_raw_cb_t)(const int iface, const struct modbus_adu *adu,
572 int modbus_raw_submit_rx(const int iface, const struct modbus_adu *adu);
581 void modbus_raw_put_header(const struct modbus_adu *adu, uint8_t *header);
589 void modbus_raw_get_header(struct modbus_adu *adu, const uint8_t *header);
598 void modbus_raw_set_server_failure(struct modbus_adu *adu);
612 int modbus_raw_backend_txn(const int iface, struct modbus_adu *adu);
/Zephyr-Core-3.6.0/samples/subsys/modbus/tcp_gateway/src/
Dmain.c46 static int modbus_tcp_reply(int client, struct modbus_adu *adu) in modbus_tcp_reply() argument
50 modbus_raw_put_header(adu, header); in modbus_tcp_reply()
55 if (send(client, adu->data, adu->length, 0) < 0) { in modbus_tcp_reply()