diff options
author | Stanley Huang <stanleyhuangyc@gmail.com> | 2017-05-08 21:18:48 +1000 |
---|---|---|
committer | Stanley Huang <stanleyhuangyc@gmail.com> | 2017-05-08 21:18:48 +1000 |
commit | aa5b6250d0164963de25b214f3b15b07eb56ea42 (patch) | |
tree | 944ca77dabbaad9ef36a8fb68fca32b303a916ac /libraries/OBD2UART/OBD2UART.cpp | |
parent | d4bb136599fae4daac47d5952a3672cce7c3db2a (diff) | |
download | 2021-arduino-obd-aa5b6250d0164963de25b214f3b15b07eb56ea42.tar.gz 2021-arduino-obd-aa5b6250d0164963de25b214f3b15b07eb56ea42.tar.bz2 2021-arduino-obd-aa5b6250d0164963de25b214f3b15b07eb56ea42.zip |
Sync some stuff with Freematics ONE library
Diffstat (limited to 'libraries/OBD2UART/OBD2UART.cpp')
-rw-r--r-- | libraries/OBD2UART/OBD2UART.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libraries/OBD2UART/OBD2UART.cpp b/libraries/OBD2UART/OBD2UART.cpp index 4e9a8de..0352c6a 100644 --- a/libraries/OBD2UART/OBD2UART.cpp +++ b/libraries/OBD2UART/OBD2UART.cpp @@ -257,12 +257,19 @@ bool COBD::getResult(byte& pid, int& result) return true; } -void COBD::sleep() +void COBD::enterLowPowerMode() { char buf[32]; sendCommand("ATLP\r", buf, sizeof(buf)); } +void COBD::leaveLowPowerMode() +{ + // simply send any command to wake the device up + char buf[32]; + sendCommand("ATI\r", buf, sizeof(buf), 1000); +} + char* COBD::getResultValue(char* buf) { char* p = buf; |