Electroneum
Loading...
Searching...
No Matches
hw Namespace Reference

Namespaces

namespace  core
namespace  io
namespace  ledger
namespace  trezor

Classes

class  device_progress
class  i_device_callback
class  device
struct  reset_mode
class  device_registry
struct  wallet_shim
class  tx_aux_data
class  device_cold

Typedefs

typedef struct hw::wallet_shim wallet_shim

Functions

deviceget_device (const std::string &device_descriptor)
bool register_device (const std::string &device_name, device *hw_device)
void buffer_to_str (char *to_buff, size_t to_len, const char *buff, size_t len)
void log_hexbuffer (const std::string &msg, const char *buff, size_t len)
void log_message (const std::string &msg, const std::string &info)

Typedef Documentation

◆ wallet_shim

typedef struct hw::wallet_shim hw::wallet_shim

Function Documentation

◆ buffer_to_str()

void hw::buffer_to_str ( char * to_buff,
size_t to_len,
const char * buff,
size_t len )

Definition at line 38 of file log.cpp.

38 {
39 CHECK_AND_ASSERT_THROW_MES(to_len > (len*2), "destination buffer too short. At least" << (len*2+1) << " bytes required");
40 for (size_t i=0; i<len; i++) {
41 sprintf(to_buff+2*i, "%.02x", (unsigned char)buff[i]);
42 }
43 }
#define CHECK_AND_ASSERT_THROW_MES(expr, message)
Here is the caller graph for this function:

◆ get_device()

device & hw::get_device ( const std::string & device_descriptor)

Definition at line 95 of file device.cpp.

95 {
96 device_registry *registry = get_device_registry();
97 return registry->get_device(device_descriptor);
98 }
device & get_device(const std::string &device_descriptor)
Definition device.cpp:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ log_hexbuffer()

void hw::log_hexbuffer ( const std::string & msg,
const char * buff,
size_t len )

Definition at line 45 of file log.cpp.

45 {
46 char logstr[1025];
47 buffer_to_str(logstr, sizeof(logstr), buff, len);
48 MDEBUG(msg<< ": " << logstr);
49 }
#define MDEBUG(x)
Definition misc_log_ex.h:76
void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len)
Definition log.cpp:38
Here is the call graph for this function:

◆ log_message()

void hw::log_message ( const std::string & msg,
const std::string & info )

Definition at line 51 of file log.cpp.

51 {
52 MDEBUG(msg << ": " << info);
53 }
CXA_THROW_INFO_T * info

◆ register_device()

bool hw::register_device ( const std::string & device_name,
device * hw_device )

Definition at line 100 of file device.cpp.

100 {
101 device_registry *registry = get_device_registry();
102 return registry->register_device(device_name, hw_device);
103 }
bool register_device(const std::string &device_name, device *hw_device)
Definition device.cpp:66
Here is the call graph for this function:
Here is the caller graph for this function: