MCPcopy Create free account
hub / github.com/Pulse-Eight/libcec / HexStrToInt

Function HexStrToInt

src/cec-client/cec-client.cpp:118–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118inline 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

Callers 5

ProcessCommandONFunction · 0.70
ProcessCommandSTANDBYFunction · 0.70
ProcessCommandPOLLFunction · 0.70
ProcessCommandPAFunction · 0.70
ProcessCommandOSDFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected