C++: Expose device serial number and connection ID.

This commit is contained in:
Martin Ling 2014-09-30 11:50:07 +01:00
parent 4c7c4194cb
commit d1075e5acf
2 changed files with 19 additions and 0 deletions

View File

@ -448,6 +448,11 @@ string Device::description()
if (part.length() > 0)
s << part;
if (serial_number().length() > 0)
s << serial_number();
else
s << connection_id();
return s.str();
}
@ -466,6 +471,16 @@ string Device::version()
return valid_string(_structure->version);
}
string Device::serial_number()
{
return valid_string(_structure->serial_num);
}
string Device::connection_id()
{
return valid_string(_structure->connection_id);
}
vector<shared_ptr<Channel>> Device::channels()
{
vector<shared_ptr<Channel>> result;

View File

@ -354,6 +354,10 @@ public:
string model();
/** Version string for this device. */
string version();
/** Serial number for this device. */
string serial_number();
/** Connection ID for this device. */
string connection_id();
/** List of the channels available on this device. */
vector<shared_ptr<Channel> > channels();
/** Channel groups available on this device, indexed by name. */