]> sigrok.org Git - pulseview.git/blobdiff - pv/devices/device.hpp
Fix #605 by closing current device when another is selected
[pulseview.git] / pv / devices / device.hpp
index 7e0b58ad065600bdc993751f343ff8eb348d4de1..acc772ecc5eaab8aed2ccc746f0e9911cc42590b 100644 (file)
@@ -25,6 +25,7 @@
 #include <string>
 
 namespace sigrok {
+class ConfigKey;
 class Device;
 class Session;
 } // namespace sigrok
@@ -47,6 +48,9 @@ public:
 
        std::shared_ptr<sigrok::Device> device() const;
 
+       template<typename T>
+       T read_config(const sigrok::ConfigKey *key, const T default_value = 0);
+
        /**
         * Builds the full name. It only contains all the fields.
         */
@@ -60,7 +64,11 @@ public:
        virtual std::string display_name(
                const DeviceManager &device_manager) const = 0;
 
-       virtual void create() = 0;
+       virtual void open() = 0;
+
+       virtual void close() = 0;
+
+       virtual void start();
 
        virtual void run();