Fix some issues for string based constructors
Signed-off-by: Adelin Dobre <adelin.dobre@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
committed by
Mihai Tudor Panu
parent
8f11061de3
commit
2975bae075
@@ -66,12 +66,12 @@ APDS9930::APDS9930(std::string initStr) : mraaIo(initStr)
|
||||
}
|
||||
|
||||
for (std::string tok : upmTokens) {
|
||||
if(tok.substr(0,16) == "enableProximity:") {
|
||||
bool enable = std::stoi(tok.substr(16),nullptr,0);
|
||||
if(tok.substr(0, 16) == "enableProximity:") {
|
||||
bool enable = std::stoi(tok.substr(16), nullptr, 0);
|
||||
enableProximity(enable);
|
||||
}
|
||||
if(tok.substr(0,18) == "enableIlluminance:") {
|
||||
bool enable = std::stoi(tok.substr(18),nullptr,0);
|
||||
if(tok.substr(0, 18) == "enableIlluminance:") {
|
||||
bool enable = std::stoi(tok.substr(18), nullptr, 0);
|
||||
enableIlluminance(enable);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user