Electroneum
hw Namespace Reference

Namespaces

 core
 
 io
 
 ledger
 
 trezor
 

Classes

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

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

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)
Definition: misc_log_ex.h:173
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  }
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  }
void buffer_to_str(char *to_buff, size_t to_len, const char *buff, size_t len)
Definition: log.cpp:38
#define MDEBUG(x)
Definition: misc_log_ex.h:76
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  }
#define MDEBUG(x)
Definition: misc_log_ex.h:76
CXA_THROW_INFO_T * info
Definition: stack_trace.cpp:91

◆ 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  }
Here is the call graph for this function:
Here is the caller graph for this function: