]> sigrok.org Git - libsigrok.git/blobdiff - bindings/cxx/classes.cpp
Return sensible Device::description() for session and input devices.
[libsigrok.git] / bindings / cxx / classes.cpp
index 86d0865e30b59460365def90bb72160bc90f91dc..9013e41ae9d44ad004cfe2a9b218e742a719432e 100644 (file)
@@ -789,6 +789,11 @@ SessionDevice::~SessionDevice()
 {
 }
 
+string SessionDevice::description()
+{
+       return _parent->_filename;
+}
+
 shared_ptr<Device> SessionDevice::get_shared_from_this()
 {
        return static_pointer_cast<Device>(shared_from_this());
@@ -806,6 +811,7 @@ Session::Session(shared_ptr<Context> context) :
 Session::Session(shared_ptr<Context> context, string filename) :
        UserOwned(_structure),
        _context(context),
+       _filename(filename),
        _saving(false)
 {
        check(sr_session_load(filename.c_str(), &_structure));
@@ -1364,6 +1370,11 @@ InputDevice::~InputDevice()
 {
 }
 
+string InputDevice::description()
+{
+       return "<input data>";
+}
+
 shared_ptr<Device> InputDevice::get_shared_from_this()
 {
        return static_pointer_cast<Device>(shared_from_this());