Valerio De Benedetto
98814d2a66
Formatting
2022-12-28 15:05:56 +01:00
Valerio De Benedetto
f2b6ddda71
Fix to data pointer type of raw_pdu functions
2022-12-28 14:10:06 +01:00
Valerio De Benedetto
fd101fe77f
Various fixes to NMBS_SERVER_* defines handling
2022-07-25 15:17:47 +02:00
Valerio De Benedetto
c12ba4b8a3
Merge branch 'callback-arg'
...
# Conflicts:
# nanomodbus.c
# nanomodbus.h
2022-07-25 12:59:40 +02:00
jonath.re@gmail.com
80fa8ef4ae
Send platform argument to nmbs_callbacks
...
This is useful for the same reasons as the arg is useful in the platform callbacks.
2022-07-22 19:19:04 +02:00
jonath.re@gmail.com
17aa0ca226
Support disabling individual server callbacks
...
This helps reduce code size for systems that do not implement the full
set of function codes supported by the library.
2022-07-22 17:14:32 +02:00
Valerio De Benedetto
037de71d9b
Returning NMBS_ERROR_INVALID_UNIT_ID in case of invalid unit ID in response
2022-06-26 11:08:16 +02:00
Valerio De Benedetto
30c7ce3854
Moved nmbs_crc_calc() declaration
2022-06-26 09:26:07 +02:00
Valerio De Benedetto
4b613aa03d
Merge pull request #13 from jonathangjertsen/expose-crc
...
Expose the function that calculates CRC
2022-06-26 09:17:27 +02:00
jonath.re@gmail.com
f22b06082e
Expose the function that calculates CRC
...
Having access to this function is useful in a variety of cases:
- hand-crafting PDUs for unit tests
- implementing extensions of the protocol
- reusing the code for other purposes (e.g. firmware integrity check)
2022-06-25 17:17:34 +02:00
Jonathan Reichelt Gjertsen
53a6a64f9b
Update wording in comment for nmbs_client_create and nmbs_server_create
2022-06-24 19:06:37 +02:00
Jonathan Reichelt Gjertsen
3a1170b925
Document that the platform configuration and callbacks can be discarded after initialization
...
`nmbs_client_create` accepts a `const nmbs_platform_conf* platform_conf` with configuration. Without reading the source code, it is not clear whether or not the object pointed to by `platform_conf` can be declared on the stack, or if it needs to be kept alive for the duration of the program (as would be the case if the implementation simply kept a pointer to the configuration instead of copying it by value). This PR adds an assurance that it is OK to discard the platform configuration after calling `nmbs_client_create`. Same idea for `nmbs_server_create`.
2022-06-07 19:29:04 +02:00
Valerio De Benedetto
a8bf7428cc
Updated docstrings
2022-06-02 11:59:45 +02:00
Valerio De Benedetto
83fb04392b
Fixes to integer types
2022-06-02 11:52:10 +02:00
Valerio De Benedetto
b6fee48160
Switch to multibyte transport read/write funcs, removed sleep
2022-06-02 10:53:32 +02:00
Valerio De Benedetto
afcdae0ec8
Formatting
2022-05-12 19:29:51 +02:00
Valerio De Benedetto
271f689771
Added NMBS_ERROR_CRC and NMBS_ERROR_INVALID_TCP_MBAP nmbs_error
2022-05-12 19:28:50 +02:00
Jonathan Reichelt Gjertsen
8433fa047f
Support C++
...
Wrapping the header file in an `extern "C"` block prevents C++ compilers from mangling the function names.
2022-05-10 15:52:56 +02:00
Valerio De Benedetto
ac66269cda
Better docs for platform functions
2022-04-30 13:52:13 +02:00
Valerio De Benedetto
9d2918b3bb
Switch to MIT license
2022-04-30 13:03:36 +02:00
Valerio De Benedetto
5358abde7b
Support to NMBS_CLIENT_DISABLED and NMBS_SERVER_DISABLED defines
2022-04-24 13:53:40 +02:00
Valerio De Benedetto
ee6dd565d4
Added license headers
2022-01-25 16:35:19 +01:00
Valerio De Benedetto
1d0321b285
Project rename
2022-01-25 00:37:54 +01:00