Commit Graph

72 Commits

Author SHA1 Message Date
Valerio De Benedetto
979f66fac0 Changes to nmbs_bitfield after merge 2025-06-26 23:37:48 +02:00
Spencer Oliver
d3ac9c1696 coils: ability to configure number of supported coils
No change to current default behaviour of allocating 2000 coils.
However memory usage can be reduced by defining NMBS_MAX_COILS.
2025-05-10 16:54:09 +01:00
Valerio De Benedetto
546040c448 recv_write_single_register_res() instead of recv_write_multiple_registers_res() 2025-04-27 13:05:14 +02:00
Valerio De Benedetto
730cdaa7bf constS 2025-01-15 21:31:41 +01:00
Carl Friess
c81ad17305 Ignore invalid function codes sent to other servers 2024-12-13 16:59:13 +01:00
Valerio De Benedetto
9b93660e81 Removed redundant length check in handle_write_file_record() 2024-12-12 22:31:51 +01:00
Valerio De Benedetto
cfc1dd00c8 Merge remote-tracking branch 'DanielMartensson/master' 2024-12-08 11:54:58 +01:00
Valerio De Benedetto
a6f61b67b4 Better handling of received TCP messages, better flushing on error 2024-12-08 11:20:15 +01:00
Valerio De Benedetto
228f11e36d Fix to read file record response length 2024-12-08 11:17:06 +01:00
Daniel Mårtensson
c34c651a4d
_MSC_VER support for C 2024-11-24 23:38:41 +01:00
Valerio De Benedetto
5729bafbbd Formatting after merge 2024-09-20 14:12:36 +02:00
Stefan Becker
ed53826382 Improve dead code flagging
- nanomodbus.c: silence GCC -Wunused-function warnings
- nanomodbus.h: fix compilation errors when only READ_WRITE_REGISTER
  function is included
2024-09-20 14:12:12 +02:00
Valerio De Benedetto
8fafaa3bfe New *_create() APIs 2024-07-24 17:48:17 +02:00
SENTRY\bryan.flannery
599efd327c Made default case for unknown functions reply to client. 2024-06-21 10:31:42 -05:00
Valerio De Benedetto
f0a4374ac5 Fix to server FC handler define 2024-06-14 16:17:48 +02:00
Valerio De Benedetto
d7ecb2ce8c Merge remote-tracking branch 'refs/remotes/dervomsee/patch-1' 2024-04-11 13:23:43 +02:00
Valerio De Benedetto
363e7f7480 Minor fixes for clangd warnings 2024-04-11 12:46:24 +02:00
dervomsee
cc325134b0
add/delete some spaces 2024-04-10 11:49:22 +02:00
dervomsee
3c736c7185
Add NMBS_CLIENT_DISABLED/NMBS_SERVER_DISABLED #ifndef to sections, that are client/server specific. 2024-04-10 11:47:22 +02:00
Valerio De Benedetto
a25ee5781a FC 43 / 14 Read Device Identification 2024-02-10 03:13:28 +01:00
Valerio De Benedetto
dccaa4f432 WIP FC 43 / 14 Read Device Identification 2024-02-10 02:47:31 +01:00
Valerio De Benedetto
0234a563c1 Fixes to potential buffer overflows on received data 2024-02-08 11:31:48 +01:00
Valerio De Benedetto
dde2653cb8 WIP buffer overflow on received data 2024-02-08 10:00:50 +01:00
Ali Moallem
8518842709 Fix callback argument in nanomodbus.c 2023-12-06 10:09:46 +03:30
Hossein.M
8aca15dfc9 Add argument for callbacks structure 2023-12-06 10:03:29 +03:30
Valerio De Benedetto
7550fe9587 Fixes after FC23 merge 2023-08-14 20:50:49 +02:00
maxlemo
e3b13ccdd1 adds fc23 server code 2023-08-02 11:11:14 -04:00
maxlemo
5991219763 add fc23 2023-08-02 10:57:17 -04:00
Vyacheslav Verkhovin
8dafc721fa Add registers count checking for file_read and file_write operations
MODBUS Application Protocol Specification does not require it explicitly
but without this checking PDU of a request or response may exceed 253 bytes.
2023-07-14 00:54:49 +07:00
Valerio De Benedetto
bd302660b6 Merge remote-tracking branch 'arhiv6/file_record' 2023-07-13 09:04:27 +02:00
Valerio De Benedetto
e3456986b5 Using VLA where possible 2023-07-11 14:07:55 +02:00
Arne Hoch
b884081eff FIX incorrect calculation of payload bytes 2023-07-11 13:52:42 +02:00
Vyacheslav Verkhovin
d391300654 Fixed function handle_read_file_record() logic according to specification
According to MODBUS specification we must finish checking all checks
before starting processing subrequests.
2023-07-06 19:43:20 +07:00
Valerio De Benedetto
ae6a93c963 Changes for SDCC 3.9.0 compatibility, part 2 2023-07-06 08:14:25 +02:00
Valerio De Benedetto
a08d59c5f0 Changes for SDCC 3.9.0 compatibility 2023-07-03 16:47:26 +02:00
Valerio De Benedetto
2e36f024bc Various fixes 2023-06-30 10:49:05 +02:00
Vyacheslav Verkhovin
e5b51cc4e7 Add File Records functions
Add both File Records functions (0x14 Read and 0x15 Write) for Client
and Server roles. Also, add a little tests and example.

Resolves: [#1] and [#24]
2023-06-30 10:11:32 +07:00
Valerio De Benedetto
2da601fd80 RTU unit_id in server callbacks 2023-06-26 13:18:24 +02:00
Valerio De Benedetto
44f3191735 Minor fixes 2023-06-01 18:29:23 +02:00
Valerio De Benedetto
0d6a5274f3 Various fixes 2023-05-25 12:16:17 +02:00
Valerio De Benedetto
f8f8fd00b1 Handling foreign RTU messages 2023-05-16 16:38:04 +02:00
Jan Weiß
f7dfbd94ab Fix Clang static analyser nit: zero out nmbs_bitfield structs. 2023-04-17 18:44:59 +02:00
Valerio De Benedetto
920d25858d Rename of DEBUG() macro to NMBS_DEBUG_PRINT() 2023-03-15 15:12:33 +01:00
Valerio De Benedetto
8493fc5267 Refactoring of NMBS_*_DISABLED defines 2023-03-15 15:08:18 +01:00
Valerio De Benedetto
f70fbd5260 Endianness-independent code 2023-03-13 12:30:32 +01:00
Valerio De Benedetto
98814d2a66 Formatting 2022-12-28 15:05:56 +01:00
Valerio De Benedetto
c654babb52 clang-tidy 2022-12-28 15:02:51 +01:00
Valerio De Benedetto
f2b6ddda71 Fix to data pointer type of raw_pdu functions 2022-12-28 14:10:06 +01:00
Antonio Aguilera
fa02201710 Fix Wswitch-enum and Wcast-qual compiler warnings
The function nmbs_strerror does not handle the error code
NMBS_ERROR_INVALID_UNIT_ID inside the switch statement, which triggers
the GCC/Clang Wswitch-enum warning. Adding a new case inside the switch
statement solves this warning.

There is a cast from a const void pointer to an uint8_t pointer inside
the function nmbs_send_raw_pdu, which triggers the GCC/Clang Wcast-qual
warning. Adding the missing const qualifier solves this warning.
2022-12-27 20:42:36 +01:00
jonath.re@gmail.com
70c75cb2db Convert get_ and put_ to functions
This shaves off about 1 kB of flash usage from my client application.
It is also more type safe, which is nice.
2022-07-29 12:19:42 +02:00