Skip to content

Commit

Permalink
bug fix in use of modbus_serial_connect
Browse files Browse the repository at this point in the history
  • Loading branch information
rscada committed Feb 22, 2014
1 parent 39425ca commit 232f750
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/modbus-serial-holding-register.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void
usage(char *program_name)
{
printf("usage: %s DEVICE COMMAND ADDRESS [RANGE] [VALUE]\n", program_name);
printf("\tHOST = ip address or FQDN\n");
printf("\DEVICE = a TTY device\n");
printf("\tCOMMAND = read | write\n");
printf("\tADDRESS = 0x0000 - 0xFFFF (register address)\n");
printf("\tRANGE = 0x0000 - 0xFFFF (for command = read)\n");
Expand Down Expand Up @@ -79,7 +79,7 @@ main(int argc, char **argv)
}

// setup serial connection
if ((handle = modbus_serial_connect(device, baudrate)) != 0)
if ((handle = modbus_serial_connect(device, baudrate)) == NULL)
{
printf("%s: modbus_serial_connect failed: %s.\n", __PRETTY_FUNCTION__, modbus_error_str);
return 0;
Expand Down

0 comments on commit 232f750

Please sign in to comment.