Permalink
Browse files

device/trezor: rename refactoring, unification, minor fixes

device/trezor: minor fixes
device/trezor: webusb session counting fix
device/trezor: compile constant fix
  • Loading branch information...
ph4r05 committed Nov 29, 2018
1 parent 40acb75 commit 6d7442fe589d10ee92c421bee7e16e7b4a441089
@@ -56,7 +56,7 @@ if(Protobuf_FOUND AND USE_DEVICE_TREZOR AND TREZOR_PYTHON)
endif()
if(USE_DEVICE_TREZOR_UDP_RELEASE)
add_definitions(-DWITH_DEVICE_TREZOR_UDP_RELEASE=1)
add_definitions(-DUSE_DEVICE_TREZOR_UDP_RELEASE=1)
endif()
if (Protobuf_INCLUDE_DIR)
@@ -65,7 +65,7 @@ namespace trezor {
}
bool device_trezor_base::set_name(const std::string & name) {
this->full_name = name;
this->m_full_name = name;
this->name = "";
auto delim = name.find(':');
@@ -77,10 +77,10 @@ namespace trezor {
}
const std::string device_trezor_base::get_name() const {
if (this->full_name.empty()) {
if (this->m_full_name.empty()) {
return std::string("<disconnected:").append(this->name).append(">");
}
return this->full_name;
return this->m_full_name;
}
bool device_trezor_base::init() {
@@ -239,15 +239,15 @@ namespace trezor {
void device_trezor_base::write_raw(const google::protobuf::Message * msg){
require_connected();
CHECK_AND_ASSERT_THROW_MES(msg, "Empty message");
this->getTransport()->write(*msg);
this->get_transport()->write(*msg);
}
GenericMessage device_trezor_base::read_raw(){
require_connected();
std::shared_ptr<google::protobuf::Message> msg_resp;
hw::trezor::messages::MessageType msg_resp_type;
this->getTransport()->read(msg_resp, &msg_resp_type);
this->get_transport()->read(msg_resp, &msg_resp_type);
return GenericMessage(msg_resp_type, msg_resp);
}
@@ -70,7 +70,7 @@ namespace trezor {
std::shared_ptr<Transport> m_transport;
i_device_callback * m_callback;
std::string full_name;
std::string m_full_name;
std::vector<unsigned int> m_wallet_deriv_path;
std::string m_device_state; // returned after passphrase entry, session
std::shared_ptr<messages::management::Features> m_features; // features from the last device reset
@@ -134,7 +134,7 @@ namespace trezor {
// Scoped session closer
BOOST_SCOPE_EXIT_ALL(&, this) {
if (open_session){
this->getTransport()->close();
this->get_transport()->close();
}
};
@@ -213,7 +213,7 @@ namespace trezor {
// Default derivation path for Monero
static const uint32_t DEFAULT_BIP44_PATH[2];
std::shared_ptr<Transport> getTransport(){
std::shared_ptr<Transport> get_transport(){
return m_transport;
}
@@ -840,7 +840,7 @@ namespace trezor{
throw exc::DeviceAcquireException("Unable to claim libusb device");
}
m_conn_count += 1;
m_conn_count = 1;
m_proto->session_begin(*this);
#undef TREZOR_DESTROY_SESSION

0 comments on commit 6d7442f

Please sign in to comment.