aboutsummaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorm2049r <m2049r@monerujo.io>2018-08-16 10:31:48 +0200
committerm2049r <m2049r@monerujo.io>2018-09-19 18:25:38 +0200
commitbce474be7d9cfa80d9f0970047bfd508db60424f (patch)
tree438aa4f3d4e2e5a2f8d56ef8747b522b44013e76 /src/device
parentMerge pull request #4391 (diff)
downloadmonero-bce474be7d9cfa80d9f0970047bfd508db60424f.tar.xz
query backing device
Diffstat (limited to 'src/device')
-rw-r--r--src/device/device.hpp11
-rw-r--r--src/device/device_default.hpp2
-rw-r--r--src/device/device_ledger.hpp4
3 files changed, 14 insertions, 3 deletions
diff --git a/src/device/device.hpp b/src/device/device.hpp
index d14b8848c..87f1430f4 100644
--- a/src/device/device.hpp
+++ b/src/device/device.hpp
@@ -78,7 +78,6 @@ namespace hw {
return false;
}
-
class device {
protected:
std::string name;
@@ -96,6 +95,12 @@ namespace hw {
TRANSACTION_CREATE_FAKE,
TRANSACTION_PARSE
};
+ enum device_type
+ {
+ SOFTWARE = 0,
+ LEDGER = 1
+ };
+
/* ======================================================================= */
/* SETUP/TEARDOWN */
@@ -109,7 +114,9 @@ namespace hw {
virtual bool connect(void) = 0;
virtual bool disconnect(void) = 0;
- virtual bool set_mode(device_mode mode) = 0;
+ virtual bool set_mode(device_mode mode) = 0;
+
+ virtual device_type get_type() const = 0;
/* ======================================================================= */
diff --git a/src/device/device_default.hpp b/src/device/device_default.hpp
index 8d841d9de..b697e1775 100644
--- a/src/device/device_default.hpp
+++ b/src/device/device_default.hpp
@@ -61,6 +61,8 @@ namespace hw {
bool set_mode(device_mode mode) override;
+ device_type get_type() const {return device_type::SOFTWARE;};
+
/* ======================================================================= */
/* LOCKER */
/* ======================================================================= */
diff --git a/src/device/device_ledger.hpp b/src/device/device_ledger.hpp
index e6c6e5b52..4a3625b2b 100644
--- a/src/device/device_ledger.hpp
+++ b/src/device/device_ledger.hpp
@@ -142,7 +142,9 @@ namespace hw {
bool connect(void) override;
bool disconnect() override;
- bool set_mode(device_mode mode) override;
+ bool set_mode(device_mode mode) override;
+
+ device_type get_type() const {return device_type::LEDGER;};
/* ======================================================================= */
/* LOCKER */