diff --git a/main.cpp b/main.cpp index fb84a50..50a1ba9 100755 --- a/main.cpp +++ b/main.cpp @@ -114,7 +114,7 @@ int main(int argc, char* argv[]) float pressure = NAN; po::variables_map vm; std::string port,path,filename; - int speed,brightness,saturation,contrast; + int speed,brightness = 0,saturation = 0 ,contrast = 0; po::options_description desc("Allowed options"); desc.add_options() @@ -127,9 +127,9 @@ int main(int argc, char* argv[]) ("capture", "capture photo of camera") ("port", po::value(&port)->default_value("/dev/ttyUSB0"), "port to read from") ("speed", po::value(&speed)->default_value(460800), "speed read from port") - ("brightness", po::value(&brightness)->default_value(0), "set brightness") - ("saturation", po::value(&saturation)->default_value(0), "set saturation") - ("contrast", po::value(&contrast)->default_value(0), "set contrast") + ("brightness", po::value(&brightness)->implicit_value(0), "set brightness") + ("saturation", po::value(&saturation)->implicit_value(0), "set saturation") + ("contrast", po::value(&contrast)->implicit_value(0), "set contrast") ("temperature", "get and print temprature") ("humidity", "get and print humidity") ("pressure", "get and print pressure") @@ -187,6 +187,8 @@ int main(int argc, char* argv[]) boost::this_thread::sleep(posix_time::milliseconds(5000)); if (! vm.count("noreset")) { + serial.writeString("\r\n\r\n"); + boost::this_thread::sleep(posix_time::milliseconds(300)); line = serial.readStringUntil("\n"); trim(line); BOOST_LOG_TRIVIAL(debug) << line; @@ -194,6 +196,7 @@ int main(int argc, char* argv[]) if (vm.count("measure") || vm.count("temperature") || vm.count("pressure") || vm.count("humidity")) { serial.writeString("measure\r\n"); + boost::this_thread::sleep(posix_time::milliseconds(100)); for (;;) { line = serial.readStringUntil("\n"); diff --git a/openwrt/Makefile b/openwrt/Makefile index ad8826c..e067514 100644 --- a/openwrt/Makefile +++ b/openwrt/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=usbserial-dw -PKG_VERSION:=0.3.6 +PKG_VERSION:=0.3.7 PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git