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

Function HexStrToInt

src/libcec/LibCEC.cpp:608–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608inline bool HexStrToInt(const std::string& data, uint8_t& value)
609{
610 int iTmp(0);
611 if (sscanf(data.c_str(), "%x", &iTmp) == 1)
612 {
613 if (iTmp > 256)
614 value = 255;
615 else if (iTmp < 0)
616 value = 0;
617 else
618 value = (uint8_t) iTmp;
619
620 return true;
621 }
622
623 return false;
624}
625
626cec_command CLibCEC::CommandFromString(const char* strCommand)
627{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected