replace magic number with define
This commit is contained in:
@ -146,7 +146,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
|
@ -95,7 +95,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
|
@ -112,7 +112,7 @@ main(int argc, char **argv)
|
||||
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -106,7 +106,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
address = 253;
|
||||
address = MBUS_ADDRESS_NETWORK_LAYER;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -95,7 +95,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
fprintf(stderr, "Failed to send M-Bus request frame.\n");
|
||||
return 1;
|
||||
|
@ -80,7 +80,7 @@ main(int argc, char **argv)
|
||||
|
||||
if (mbus_frame_type(&reply) == MBUS_FRAME_TYPE_ACK)
|
||||
{
|
||||
if (mbus_send_request_frame(handle, 253) == -1)
|
||||
if (mbus_send_request_frame(handle, MBUS_ADDRESS_NETWORK_LAYER) == -1)
|
||||
{
|
||||
printf("Failed to send request to selected secondary device: %s\n", mbus_error_str());
|
||||
return 1;
|
||||
|
Reference in New Issue
Block a user