Merge pull request #16 from lategoodbye/master

Bugfixes for serial tools
This commit is contained in:
Robert Johansson
2012-07-13 16:59:51 -07:00
3 changed files with 5 additions and 2 deletions

View File

@ -79,7 +79,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
if (!mbus_connect(handle)) if (mbus_connect(handle) == -1)
{ {
printf("Failed to setup connection to M-bus gateway\n"); printf("Failed to setup connection to M-bus gateway\n");
return 1; return 1;

View File

@ -32,6 +32,9 @@ main(int argc, char **argv)
char *device, *addr_str, *xml_result; char *device, *addr_str, *xml_result;
int address, baudrate = 9600; int address, baudrate = 9600;
memset((void *)&reply, 0, sizeof(mbus_frame));
memset((void *)&reply_data, 0, sizeof(mbus_frame_data));
if (argc == 3) if (argc == 3)
{ {
device = argv[1]; device = argv[1];

View File

@ -108,7 +108,7 @@ main(int argc, char **argv)
return 1; return 1;
} }
if (!mbus_connect(handle)) if (mbus_connect(handle) == -1)
{ {
printf("Failed to setup connection to M-bus gateway\n"); printf("Failed to setup connection to M-bus gateway\n");
return 1; return 1;