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
commit 3386f0a419
3 changed files with 5 additions and 2 deletions

View File

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

View File

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

View File

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