1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

PlutoSDR: print error string from libiio in console message

This commit is contained in:
f4exb 2017-10-09 00:12:15 +02:00
parent 49db1b2273
commit ca48070c84

View File

@ -150,6 +150,7 @@ void DevicePlutoSDRBox::set_params(DeviceType devType,
if (ret < 0)
{
std::string item;
char errstr[256];
switch (type)
{
@ -166,7 +167,8 @@ void DevicePlutoSDRBox::set_params(DeviceType devType,
item = "unknown";
break;
}
std::cerr << "DevicePlutoSDRBox::set_params: Unable to write " << item << " attribute " << key << "=" << val << ": " << ret << std::endl;
iio_strerror(-ret, errstr, 255);
std::cerr << "DevicePlutoSDRBox::set_params: Unable to write " << item << " attribute " << key << "=" << val << ": " << errstr << " (" << ret << ") " << std::endl;
}
else
{