brighrness, speed 460800
This commit is contained in:
11
main.cpp
11
main.cpp
@@ -114,7 +114,7 @@ int main(int argc, char* argv[])
|
|||||||
float pressure = NAN;
|
float pressure = NAN;
|
||||||
po::variables_map vm;
|
po::variables_map vm;
|
||||||
std::string port,path,filename;
|
std::string port,path,filename;
|
||||||
int speed,brightness,saturation,contrast;
|
int speed,brightness = 0,saturation = 0 ,contrast = 0;
|
||||||
|
|
||||||
po::options_description desc("Allowed options");
|
po::options_description desc("Allowed options");
|
||||||
desc.add_options()
|
desc.add_options()
|
||||||
@@ -127,9 +127,9 @@ int main(int argc, char* argv[])
|
|||||||
("capture", "capture photo of camera")
|
("capture", "capture photo of camera")
|
||||||
("port", po::value<string>(&port)->default_value("/dev/ttyUSB0"), "port to read from")
|
("port", po::value<string>(&port)->default_value("/dev/ttyUSB0"), "port to read from")
|
||||||
("speed", po::value<int>(&speed)->default_value(460800), "speed read from port")
|
("speed", po::value<int>(&speed)->default_value(460800), "speed read from port")
|
||||||
("brightness", po::value<int>(&brightness)->default_value(0), "set brightness")
|
("brightness", po::value<int>(&brightness)->implicit_value(0), "set brightness")
|
||||||
("saturation", po::value<int>(&saturation)->default_value(0), "set saturation")
|
("saturation", po::value<int>(&saturation)->implicit_value(0), "set saturation")
|
||||||
("contrast", po::value<int>(&contrast)->default_value(0), "set contrast")
|
("contrast", po::value<int>(&contrast)->implicit_value(0), "set contrast")
|
||||||
("temperature", "get and print temprature")
|
("temperature", "get and print temprature")
|
||||||
("humidity", "get and print humidity")
|
("humidity", "get and print humidity")
|
||||||
("pressure", "get and print pressure")
|
("pressure", "get and print pressure")
|
||||||
@@ -187,6 +187,8 @@ int main(int argc, char* argv[])
|
|||||||
boost::this_thread::sleep(posix_time::milliseconds(5000));
|
boost::this_thread::sleep(posix_time::milliseconds(5000));
|
||||||
|
|
||||||
if (! vm.count("noreset")) {
|
if (! vm.count("noreset")) {
|
||||||
|
serial.writeString("\r\n\r\n");
|
||||||
|
boost::this_thread::sleep(posix_time::milliseconds(300));
|
||||||
line = serial.readStringUntil("\n");
|
line = serial.readStringUntil("\n");
|
||||||
trim(line);
|
trim(line);
|
||||||
BOOST_LOG_TRIVIAL(debug) << 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")) {
|
if (vm.count("measure") || vm.count("temperature") || vm.count("pressure") || vm.count("humidity")) {
|
||||||
serial.writeString("measure\r\n");
|
serial.writeString("measure\r\n");
|
||||||
|
boost::this_thread::sleep(posix_time::milliseconds(100));
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
line = serial.readStringUntil("\n");
|
line = serial.readStringUntil("\n");
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=usbserial-dw
|
PKG_NAME:=usbserial-dw
|
||||||
PKG_VERSION:=0.3.6
|
PKG_VERSION:=0.3.7
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
PKG_SOURCE_PROTO:=git
|
PKG_SOURCE_PROTO:=git
|
||||||
|
|||||||
Reference in New Issue
Block a user