|
Electroneum
|
Namespaces | |
| exc | |
| protocol | |
Classes | |
| class | BridgeTransport |
| class | DebugLink |
| class | GenericMessage |
| class | MessageMapper |
| class | Protocol |
| class | ProtocolV1 |
| class | Transport |
| struct | trezor_usb_desc_t |
| class | UdpTransport |
Typedefs | |
| using | json = rapidjson::Document |
| using | json_val = rapidjson::Value |
| typedef std::vector< std::shared_ptr< Transport > > | t_transport_vect |
Functions | |
| void | register_all (std::map< std::string, std::unique_ptr< device >> ®istry) |
| void | register_all () |
| template<class t_message = google::protobuf::Message> | |
| std::shared_ptr< t_message > | message_ptr_retype (std::shared_ptr< google::protobuf::Message > &in) |
| template<class t_message = google::protobuf::Message> | |
| std::shared_ptr< t_message > | message_ptr_retype_static (std::shared_ptr< google::protobuf::Message > &in) |
| bool | t_serialize (const std::string &in, std::string &out) |
| bool | t_serialize (const json_val &in, std::string &out) |
| std::string | t_serialize (const json_val &in) |
| bool | t_deserialize (const std::string &in, std::string &out) |
| bool | t_deserialize (const std::string &in, json &out) |
| uint64_t | pack_version (uint32_t major, uint32_t minor, uint32_t patch) |
| void | enumerate (t_transport_vect &res) |
| void | sort_transports_by_env (t_transport_vect &res) |
| std::shared_ptr< Transport > | transport (const std::string &path) |
| void | throw_failure_exception (const messages::common::Failure *failure) |
| std::ostream & | operator<< (std::ostream &o, hw::trezor::Transport const &t) |
| std::ostream & | operator<< (std::ostream &o, std::shared_ptr< hw::trezor::Transport > const &t) |
| template<class t_req , class t_res , class t_transport > | |
| bool | invoke_bridge_http (const boost::string_ref uri, const t_req &out_struct, t_res &result_struct, t_transport &transport, const boost::string_ref method="POST", std::chrono::milliseconds timeout=std::chrono::seconds(180)) |
| template<class t_transport = Transport> | |
| std::shared_ptr< t_transport > | transport_typed (const std::string &path) |
| template<class t_message = google::protobuf::Message> | |
| std::shared_ptr< t_message > | exchange_message (Transport &transport, const google::protobuf::Message &req, boost::optional< messages::MessageType > resp_type=boost::none) |
Variables | |
| const char * | TYPE_PREFIX = "MessageType_" |
| const char * | PACKAGES [] |
| const std::string | DEFAULT_BRIDGE = "127.0.0.1:21325" |
| using hw::trezor::json = typedef rapidjson::Document |
Definition at line 59 of file transport.hpp.
| using hw::trezor::json_val = typedef rapidjson::Value |
Definition at line 60 of file transport.hpp.
| typedef std::vector<std::shared_ptr<Transport> > hw::trezor::t_transport_vect |
Definition at line 135 of file transport.hpp.
| void hw::trezor::enumerate | ( | t_transport_vect & | res | ) |
Enumerates all transports
Definition at line 1144 of file transport.cpp.

| std::shared_ptr<t_message> hw::trezor::exchange_message | ( | Transport & | transport, |
| const google::protobuf::Message & | req, | ||
| boost::optional< messages::MessageType > | resp_type = boost::none |
||
| ) |
Simple wrapper for write-read message exchange with expected message response type.
| UnexpectedMessageException | if the response message type is different than expected. Exception contains message type and the message itself. |
Definition at line 373 of file transport.hpp.

| bool hw::trezor::invoke_bridge_http | ( | const boost::string_ref | uri, |
| const t_req & | out_struct, | ||
| t_res & | result_struct, | ||
| t_transport & | transport, | ||
| const boost::string_ref | method = "POST", |
||
| std::chrono::milliseconds | timeout = std::chrono::seconds(180) |
||
| ) |
Definition at line 77 of file transport.hpp.


| std::shared_ptr<t_message> hw::trezor::message_ptr_retype | ( | std::shared_ptr< google::protobuf::Message > & | in | ) |
Definition at line 73 of file messages_map.hpp.
| std::shared_ptr<t_message> hw::trezor::message_ptr_retype_static | ( | std::shared_ptr< google::protobuf::Message > & | in | ) |
Definition at line 83 of file messages_map.hpp.
| std::ostream & hw::trezor::operator<< | ( | std::ostream & | o, |
| hw::trezor::Transport const & | t | ||
| ) |
| std::ostream & hw::trezor::operator<< | ( | std::ostream & | o, |
| std::shared_ptr< hw::trezor::Transport > const & | t | ||
| ) |
Definition at line 1255 of file transport.cpp.
Definition at line 90 of file transport.cpp.

| void hw::trezor::register_all | ( | std::map< std::string, std::unique_ptr< device >> & | registry | ) |
Definition at line 732 of file device_trezor.cpp.
| void hw::trezor::register_all | ( | ) |
Definition at line 735 of file device_trezor.cpp.
| void hw::trezor::sort_transports_by_env | ( | t_transport_vect & | res | ) |
Sorts found transports by TREZOR_PATH environment variable.
Definition at line 1171 of file transport.cpp.

| bool hw::trezor::t_deserialize | ( | const std::string & | in, |
| std::string & | out | ||
| ) |
Definition at line 79 of file transport.cpp.
| bool hw::trezor::t_serialize | ( | const std::string & | in, |
| std::string & | out | ||
| ) |
Definition at line 60 of file transport.cpp.
| std::string hw::trezor::t_serialize | ( | const json_val & | in | ) |
Definition at line 68 of file transport.cpp.
| void hw::trezor::throw_failure_exception | ( | const messages::common::Failure * | failure | ) |
Throws corresponding failure exception.
Definition at line 1217 of file transport.cpp.


| std::shared_ptr< Transport > hw::trezor::transport | ( | const std::string & | path | ) |
Transforms path to the transport
Definition at line 1204 of file transport.cpp.

| std::shared_ptr<t_transport> hw::trezor::transport_typed | ( | const std::string & | path | ) |
Transforms path to the particular transport
Definition at line 319 of file transport.hpp.

| const std::string hw::trezor::DEFAULT_BRIDGE = "127.0.0.1:21325" |
Definition at line 63 of file transport.hpp.
| const char* hw::trezor::PACKAGES[] |
Definition at line 48 of file messages_map.cpp.
| const char* hw::trezor::TYPE_PREFIX = "MessageType_" |
Definition at line 47 of file messages_map.cpp.