Jacob Siverskog
2954dcf4ed
modbus: fix potential null pointer dereference
...
reorganize code so that null pointer check is done prior to accessing
element.
Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2021-03-24 10:56:06 +02:00
Johann Fischer
f943a5581d
modbus: rework RS-485 transceiver DE,RE GPIO configuration
...
Follow modern way to configure DE,RE GPIO using
struct gpio_dt_spec.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
4ff616b647
modbus: rework interface configuration
...
Use commot parameter structure to configure server
or client interfaces.
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
b132ab556c
modbus: move serial line config outside context
...
Move serial line config outside context.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00
Johann Fischer
3ddb47cc43
modbus: move MODBUS over serial line code to own file
...
Move MODBUS over serial line code to own source file.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-03-19 15:50:21 +01:00