| 116 | } |
| 117 | |
| 118 | inline bool HexStrToInt(const std::string& data, uint8_t& value) |
| 119 | { |
| 120 | int iTmp(0); |
| 121 | if (sscanf(data.c_str(), "%x", &iTmp) == 1) |
| 122 | { |
| 123 | if (iTmp > 256) |
| 124 | value = 255; |
| 125 | else if (iTmp < 0) |
| 126 | value = 0; |
| 127 | else |
| 128 | value = (uint8_t) iTmp; |
| 129 | |
| 130 | return true; |
| 131 | } |
| 132 | |
| 133 | return false; |
| 134 | } |
| 135 | |
| 136 | //get the first word (separated by whitespace) from string data and place that in word |
| 137 | //then remove that word from string data |
no outgoing calls
no test coverage detected