Replaced magic resultcodes from mbus_recv_frame with defines

This commit is contained in:
Stefan Wahren
2012-07-11 23:33:52 +02:00
parent ff37c4af8c
commit e6a52f97ea
11 changed files with 43 additions and 33 deletions

View File

@ -65,13 +65,13 @@ main(int argc, char **argv)
ret = mbus_recv_frame(handle, &reply);
if (ret == -3)
if (ret == MBUS_RECV_RESULT_TIMEOUT)
{
printf("No reply from device with secondary address %s: %s\n", argv[3], mbus_error_str());
return 1;
}
if (ret == -2)
if (ret == MBUS_RECV_RESULT_INVALID)
{
printf("Invalid reply from %s: The address address probably match more than one device: %s\n", argv[3], mbus_error_str());
return 1;
@ -85,7 +85,7 @@ main(int argc, char **argv)
return 1;
}
if (mbus_recv_frame(handle, &reply) != 0)
if (mbus_recv_frame(handle, &reply) != MBUS_RECV_RESULT_OK)
{
printf("Failed to recieve reply from selected secondary device: %s\n", mbus_error_str());
return 1;