#include "libsigrok/libsigrok.hpp"
+#include <sstream>
+
namespace sigrok
{
delete entry.second;
}
+string Device::get_description()
+{
+ ostringstream s;
+
+ vector<string> parts =
+ {get_vendor(), get_model(), get_version()};
+
+ for (string part : parts)
+ if (part.length() > 0)
+ s << part;
+
+ return s.str();
+}
+
string Device::get_vendor()
{
return valid_string(structure->vendor);
public StructureWrapper<Context, struct sr_dev_inst>
{
public:
+ /** Description identifying this device. */
+ string get_description();
/** Vendor name for this device. */
string get_vendor();
/** Model name for this device. */
%attributestring(sigrok::OutputFormat,
std::string, description, get_description);
+%attributestring(sigrok::Device, std::string, description, get_description);
%attributestring(sigrok::Device, std::string, vendor, get_vendor);
%attributestring(sigrok::Device, std::string, model, get_model);
%attributestring(sigrok::Device, std::string, version, get_version);