Skip to content

Commit

Permalink
modbus_server.c: Add print of modbus address
Browse files Browse the repository at this point in the history
Log which incoming address the Modbus request has (but still act on all
incoming requests) in server mode. This allows for better testing
functionality when using the application in server mode.

Signed-off-by: Joakim Roubert <joakim.roubert@gmail.com>
  • Loading branch information
d97jro committed Dec 16, 2024
1 parent e2de73d commit 822e8a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"vendor": "Axis Communications AB",
"embeddedSdkVersion": "3.0",
"runMode": "respawn",
"version": "1.2.3"
"version": "1.2.4"
},
"configuration": {
"settingPage": "config.html",
Expand Down
2 changes: 2 additions & 0 deletions modbus_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ static void *run_modbus_server(void *run)
rlen);
break;
}
guint16 address = (req[8] << 8) | req[9];
LOG_I("%s/%s: Received request on address %d", __FILE__, __FUNCTION__, address);
if (MODBUS_FC_WRITE_SINGLE_COIL == req[7])
{
LOG_I(
Expand Down

0 comments on commit 822e8a9

Please sign in to comment.