45 const char *data = str.c_str();
47 std::cout << name <<
"[" << len <<
"]: " << std::hex;
48 for (
int i = 0; i < len; i++) {
51 std::cout << std::right << (int) data[i];
53 if (std::isalnum(data[i]) || std::ispunct(data[i]))
54 std::cout <<
"(" << data[i] <<
")";
59 std::cout << std::dec << std::endl;
65 size_t len = (hex.size() + 2) / 3;
66 std::stringstream ss(std::stringstream::in | std::stringstream::out);
70 for (
int i = 0; i < len; i++) {
72 ss >> std::hex >>
code;
73 result.push_back(
code);
106 std::string return_str;
112 if (return_str.find(
"-") == std::string::npos &&
113 return_str.find(
"OK") == std::string::npos &&
114 return_str.find(
"INITATION NOISE") == std::string::npos &&
115 return_str.find(
"INITATION LISTEN") == std::string::npos) {
static void hexdump(std::string name, std::string str)
static std::string hex2bin(std::string hex)
Header of the class needed by UWMPhy_modem to handle the physical connection between NS-Miracle and a...
Header of the class needed by UWMPhy_modem to handle the different transmissions cases and correspond...
UWMdriver * pmDriver
Pointer to UWMdriver object that contains this UWMconnector.
std::string pathToDevice
The path to be connected with the modem device.
std::queue< msgModem > queueMsg
Queue used to buffer incoming strings from the modem.
virtual void closeConnection()
Method to close the connection with the modem.
std::string readFromModem()
Method to check the receiving modem buffer.
~UWMconnector()
Class destructor.
void setDriverQueueLength(int length)
UWMconnector(UWMdriver *, std::string)
Class constructor.
The class needed by UWMPhy_modem to handle the different transmissions cases and corresponding protoc...
void printOnLog(log_level_t log_level, std::string module, std::string message)
std::string msg_rx
Message from the modem.