#include <debug_link.hpp>
Definition at line 40 of file debug_link.hpp.
◆ DebugLink()
| hw::trezor::DebugLink::DebugLink |
( |
| ) |
|
◆ ~DebugLink()
| hw::trezor::DebugLink::~DebugLink |
( |
| ) |
|
|
virtual |
Definition at line 39 of file debug_link.cpp.
39 {
40 if (m_transport){
42 }
43 }
◆ call()
template<class t_message = messages::debug::DebugLinkState>
| std::shared_ptr< t_message > hw::trezor::DebugLink::call |
( |
const google::protobuf::Message & | req, |
|
|
const boost::optional< messages::MessageType > & | resp_type = boost::none, |
|
|
bool | no_wait = false ) |
|
inline |
Definition at line 58 of file debug_link.hpp.
62 {
63 BOOST_STATIC_ASSERT(boost::is_base_of<google::protobuf::Message, t_message>::value);
64
65 m_transport->write(req);
66 if (no_wait){
67 return nullptr;
68 }
69
70
71 std::shared_ptr<google::protobuf::Message> msg_resp;
72 hw::trezor::messages::MessageType msg_resp_type;
73 m_transport->read(msg_resp, &msg_resp_type);
74
76 if (msg_resp_type == required_type) {
78 } else if (msg_resp_type == messages::MessageType_Failure){
80 } else {
81 throw exc::UnexpectedMessageException(msg_resp_type, msg_resp);
82 }
83 };
static messages::MessageType get_message_wire_number()
void throw_failure_exception(const messages::common::Failure *failure)
std::shared_ptr< t_message > message_ptr_retype(std::shared_ptr< google::protobuf::Message > &in)
◆ close()
| void hw::trezor::DebugLink::close |
( |
| ) |
|
Definition at line 51 of file debug_link.cpp.
51 {
53 if (m_transport) m_transport->close();
54 }
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
◆ init()
| void hw::trezor::DebugLink::init |
( |
std::shared_ptr< Transport > & | transport | ) |
|
Definition at line 45 of file debug_link.cpp.
45 {
48 m_transport->open();
49 }
std::shared_ptr< Transport > transport(const std::string &path)
◆ input_button()
| void hw::trezor::DebugLink::input_button |
( |
bool | button | ) |
|
Definition at line 68 of file debug_link.cpp.
68 {
69 messages::debug::DebugLinkDecision decision;
70 decision.set_yes_no(button);
71 call(decision, boost::none,
true);
72 }
std::shared_ptr< t_message > call(const google::protobuf::Message &req, const boost::optional< messages::MessageType > &resp_type=boost::none, bool no_wait=false)
◆ input_swipe()
| void hw::trezor::DebugLink::input_swipe |
( |
bool | swipe | ) |
|
Definition at line 74 of file debug_link.cpp.
74 {
75 messages::debug::DebugLinkDecision decision;
76 decision.set_up_down(swipe);
77 call(decision, boost::none,
true);
78 }
◆ input_word()
| void hw::trezor::DebugLink::input_word |
( |
const std::string & | word | ) |
|
Definition at line 62 of file debug_link.cpp.
62 {
63 messages::debug::DebugLinkDecision decision;
64 decision.set_input(word);
65 call(decision, boost::none,
true);
66 }
◆ press_no()
| void hw::trezor::DebugLink::press_no |
( |
| ) |
|
|
inline |
◆ press_yes()
| void hw::trezor::DebugLink::press_yes |
( |
| ) |
|
|
inline |
◆ state()
| std::shared_ptr< messages::debug::DebugLinkState > hw::trezor::DebugLink::state |
( |
| ) |
|
Definition at line 56 of file debug_link.cpp.
56 {
58 messages::debug::DebugLinkGetState(),
59 boost::make_optional(messages::MessageType_DebugLinkGetState));
60 }
◆ stop()
| void hw::trezor::DebugLink::stop |
( |
| ) |
|
Definition at line 80 of file debug_link.cpp.
80 {
81 messages::debug::DebugLinkStop msg;
82 call(msg, boost::none,
true);
83 }
The documentation for this class was generated from the following files:
- /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/device_trezor/trezor/debug_link.hpp
- /home/abuild/rpmbuild/BUILD/electroneum-5.1.3.1-build/electroneum-5.1.3.1/src/device_trezor/trezor/debug_link.cpp