Commit graph

6 commits

Author SHA1 Message Date
Parthiban Nallathambi 2c4fb882bb modbus: use macro for function code for input register
use MODBUS_FC04_IN_REG_RD for input register reading function code 4.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2023-08-16 14:58:47 +02:00
Gerard Marull-Paretas 5113c1418d subsystems: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all subsystems code to
the new prefix <zephyr/...>. Note that the conversion has been scripted,
refer to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-09 12:07:35 +02:00
Johann Fischer a42c51654b modbus: fix untrusted loop bound in modbus client
Use size_t type where it makes sense and
check if the buffer is large enough before it is used.

Fixes: #33786
Fixes: #33795

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-05-05 11:33:56 +02:00
Johann Fischer 0bf4916efd modbus: move some RX/TX ADU related code to the core
Let the core call the modbus_tx_adu() to make
the process more comprehensible.
Move tx-wait-for-rx handling outside of client code.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer e3c630d25f modbus: rename internal designations and do few minor fixups
Prefix internal functions and structs with modbus_.
Use unit_id consistently instead of node_addr.
Fix mbm_ remainder and rename to mbc_.
Rename struct modbus_frame to modbus_adu since
ADU is closer to what the structure represents.

Let the compiler/linker do the job and
remove ifdef around mbc_validate_fc03fp_response().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer 9792a6c43e modbus: rename mb_rtu_ to modbus_
Rename mb_rtu_ to modbus_.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Renamed from subsys/modbus/mb_rtu_client.c (Browse further)