Improved readout by secondary address
- save 1 REQ_UD2 by selecting instead of probing seconday address
This commit is contained in:
@ -72,23 +72,23 @@ main(int argc, char **argv)
|
||||
{
|
||||
// secondary addressing
|
||||
|
||||
int probe_ret;
|
||||
int ret;
|
||||
|
||||
probe_ret = mbus_probe_secondary_address(handle, addr_str, matching_addr);
|
||||
ret = mbus_select_secondary_address(handle, addr_str);
|
||||
|
||||
if (probe_ret == MBUS_PROBE_COLLISION)
|
||||
if (ret == MBUS_PROBE_COLLISION)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The address mask [%s] matches more than one device.\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_NOTHING)
|
||||
else if (ret == MBUS_PROBE_NOTHING)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: The selected secondary address does not match any device [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
else if (probe_ret == MBUS_PROBE_ERROR)
|
||||
else if (ret == MBUS_PROBE_ERROR)
|
||||
{
|
||||
fprintf(stderr, "%s: Error: Failed to probe secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
fprintf(stderr, "%s: Error: Failed to select secondary address [%s].\n", __PRETTY_FUNCTION__, addr_str);
|
||||
return 1;
|
||||
}
|
||||
// else MBUS_PROBE_SINGLE
|
||||
|
Reference in New Issue
Block a user