delete entry.second;
}
-string Device::description()
-{
- ostringstream s;
-
- vector<string> parts =
- {vendor(), model(), version(), serial_number()};
-
- for (size_t i = 0; i < parts.size(); i++)
- {
- if (parts[i].length() > 0)
- {
- if (i != 0)
- s << " ";
- s << parts[i];
- }
- }
-
- if (serial_number().length() == 0 && connection_id().length() > 0)
- s << " " << connection_id();
-
- return s.str();
-}
-
string Device::vendor()
{
return valid_string(_structure->vendor);
{
}
-string SessionDevice::description()
-{
- return _parent->_filename;
-}
-
shared_ptr<Device> SessionDevice::get_shared_from_this()
{
return static_pointer_cast<Device>(shared_from_this());
{
}
-string InputDevice::description()
-{
- return "<input data>";
-}
-
shared_ptr<Device> InputDevice::get_shared_from_this()
{
return static_pointer_cast<Device>(shared_from_this());
class SR_API Device : public Configurable
{
public:
- /** Description identifying this device. */
- virtual string description();
/** Vendor name for this device. */
string vendor();
/** Model name for this device. */
public ParentOwned<SessionDevice, Session, struct sr_dev_inst>,
public Device
{
- /** Description identifying this device. */
- string description();
protected:
SessionDevice(struct sr_dev_inst *sdi);
~SessionDevice();
public ParentOwned<InputDevice, Input, struct sr_dev_inst>,
public Device
{
-public:
- /** Description identifying this device. */
- string description();
protected:
InputDevice(shared_ptr<Input> input, struct sr_dev_inst *sdi);
~InputDevice();
%attributeval(sigrok::OutputFormat,
map_string_Option, options, options);
-%attributestring(sigrok::Device, std::string, description, description);
%attributestring(sigrok::Device, std::string, vendor, vendor);
%attributestring(sigrok::Device, std::string, model, model);
%attributestring(sigrok::Device, std::string, version, version);