aboutsummaryrefslogtreecommitdiff
path: root/src/device/device.hpp
diff options
context:
space:
mode:
authorDusan Klinec <dusan.klinec@gmail.com>2018-08-23 23:50:53 +0200
committerDusan Klinec <dusan.klinec@gmail.com>2018-11-02 21:36:39 +0100
commit29ffb6bba8867586986345b4f0c560e5ea5fce85 (patch)
tree544386c5c4158ab4d8edfb50ab3792e25a97439d /src/device/device.hpp
parentMerge pull request #4676 (diff)
downloadmonero-29ffb6bba8867586986345b4f0c560e5ea5fce85.tar.xz
device/trezor: trezor support added
Diffstat (limited to 'src/device/device.hpp')
-rw-r--r--src/device/device.hpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/device/device.hpp b/src/device/device.hpp
index 815a0ab93..dd9ad4332 100644
--- a/src/device/device.hpp
+++ b/src/device/device.hpp
@@ -47,6 +47,7 @@
#include "crypto/crypto.h"
#include "crypto/chacha.h"
#include "ringct/rctTypes.h"
+#include "cryptonote_config.h"
#ifndef USE_DEVICE_LEDGER
@@ -99,10 +100,17 @@ namespace hw {
enum device_type
{
SOFTWARE = 0,
- LEDGER = 1
+ LEDGER = 1,
+ TREZOR = 2
};
+ enum device_protocol_t {
+ PROTOCOL_DEFAULT,
+ PROTOCOL_PROXY, // Originally defined by Ledger
+ PROTOCOL_COLD, // Originally defined by Trezor
+ };
+
/* ======================================================================= */
/* SETUP/TEARDOWN */
/* ======================================================================= */
@@ -120,6 +128,7 @@ namespace hw {
virtual device_type get_type() const = 0;
+ virtual device_protocol_t device_protocol() const { return PROTOCOL_DEFAULT; };
/* ======================================================================= */
/* LOCKER */
@@ -204,6 +213,11 @@ namespace hw {
virtual bool close_tx(void) = 0;
+ virtual bool has_ki_cold_sync(void) const { return false; }
+ virtual bool has_tx_cold_sign(void) const { return false; }
+
+ virtual void set_network_type(cryptonote::network_type network_type) { }
+
protected:
device_mode mode;
} ;