First usable version on RS Pro
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -128,6 +128,7 @@ int main(int argc, char* argv[])
|
||||
("temperature", "get and print temprature")
|
||||
("humidity", "get and print humidity")
|
||||
("pressure", "get and print pressure")
|
||||
("reboot", "reboot ESP32 CAM")
|
||||
("noraw", "do not set raw mode")
|
||||
("noreset", "do not set zero on lines DTR a RST")
|
||||
;
|
||||
@@ -161,10 +162,23 @@ int main(int argc, char* argv[])
|
||||
serial.setDTR(false);
|
||||
serial.setRTS(false);
|
||||
}
|
||||
|
||||
if (! vm.count("noraw")) {
|
||||
serial.setRAW();
|
||||
}
|
||||
|
||||
if (vm.count("reset")) {
|
||||
serial.setDTR(true);
|
||||
serial.setRTS(true);
|
||||
|
||||
serial.writeString("reboot\r\n");
|
||||
boost::this_thread::sleep(posix_time::milliseconds(1000));
|
||||
|
||||
serial.setDTR(false);
|
||||
serial.setRTS(false);
|
||||
|
||||
}
|
||||
|
||||
boost::this_thread::sleep(posix_time::milliseconds(5000));
|
||||
|
||||
if (! vm.count("noreset")) {
|
||||
@@ -233,8 +247,6 @@ int main(int argc, char* argv[])
|
||||
|
||||
serial.writeString("rb\r\n");
|
||||
boost::this_thread::sleep(posix_time::milliseconds(100));
|
||||
//serial.readChar(1);
|
||||
//serial.readChar(1);
|
||||
|
||||
modem.setSerialPort(&serial);
|
||||
modem.setFilePath(path);
|
||||
|
||||
Reference in New Issue
Block a user