query backing device

This commit is contained in:
m2049r 2018-08-16 10:31:48 +02:00
parent bad2c7cf31
commit bce474be7d
No known key found for this signature in database
GPG key ID: 4386E69AF260078D
10 changed files with 123 additions and 17 deletions

View file

@ -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;
/* ======================================================================= */

View file

@ -61,6 +61,8 @@ namespace hw {
bool set_mode(device_mode mode) override;
device_type get_type() const {return device_type::SOFTWARE;};
/* ======================================================================= */
/* LOCKER */
/* ======================================================================= */

View file

@ -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 */