C++: Expose device serial number and connection ID.
This commit is contained in:
parent
4c7c4194cb
commit
d1075e5acf
|
@ -448,6 +448,11 @@ string Device::description()
|
||||||
if (part.length() > 0)
|
if (part.length() > 0)
|
||||||
s << part;
|
s << part;
|
||||||
|
|
||||||
|
if (serial_number().length() > 0)
|
||||||
|
s << serial_number();
|
||||||
|
else
|
||||||
|
s << connection_id();
|
||||||
|
|
||||||
return s.str();
|
return s.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,6 +471,16 @@ string Device::version()
|
||||||
return valid_string(_structure->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>> Device::channels()
|
||||||
{
|
{
|
||||||
vector<shared_ptr<Channel>> result;
|
vector<shared_ptr<Channel>> result;
|
||||||
|
|
|
@ -354,6 +354,10 @@ public:
|
||||||
string model();
|
string model();
|
||||||
/** Version string for this device. */
|
/** Version string for this device. */
|
||||||
string version();
|
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. */
|
/** List of the channels available on this device. */
|
||||||
vector<shared_ptr<Channel> > channels();
|
vector<shared_ptr<Channel> > channels();
|
||||||
/** Channel groups available on this device, indexed by name. */
|
/** Channel groups available on this device, indexed by name. */
|
||||||
|
|
Loading…
Reference in New Issue