This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new d7cf29f02 industry/nxmodbus: Accept 4-byte RTU frames.
d7cf29f02 is described below

commit d7cf29f02120042f9b1e68f28e068e1e9c47ccf0
Author: raiden00pl <[email protected]>
AuthorDate: Sat Oct 10 15:20:49 2026 +0200

    industry/nxmodbus: Accept 4-byte RTU frames.
    
    NXMB_RTU_MIN_FRAME_SIZE was 5, but the shortest valid RTU frame is
    unit_id + fc + 2 CRC bytes = 4 bytes, e.g. a Report Server ID (FC17)
    request. Such requests were dropped and never answered. Set the
    minimum to 4. The ASCII transport already accepts the equivalent
    minimum frame (addr + fc + LRC).
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 industry/nxmodbus/transport/nxmb_serial.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/industry/nxmodbus/transport/nxmb_serial.c 
b/industry/nxmodbus/transport/nxmb_serial.c
index 679e0d597..543ed64a3 100644
--- a/industry/nxmodbus/transport/nxmb_serial.c
+++ b/industry/nxmodbus/transport/nxmb_serial.c
@@ -48,7 +48,9 @@
  * Pre-processor Definitions
  ****************************************************************************/
 
-#define NXMB_RTU_MIN_FRAME_SIZE 5
+/* Minimum wire frame: unit_id + fc + 2 CRC bytes (e.g. FC17 request) */
+
+#define NXMB_RTU_MIN_FRAME_SIZE 4
 
 /* Wire frame: unit_id + fc + data + 2 CRC bytes */
 

Reply via email to