43 #include <visp3/core/vpTime.h>
45 #include <visp3/core/vpSerial.h>
47 int main(
int argc,
char **argv)
52 unsigned long baud = 9600;
53 for (
int i = 0; i < argc; i++) {
54 if (std::string(argv[i]) ==
"--port")
55 port = std::string(argv[i + 1]);
56 else if (std::string(argv[i]) ==
"--baud") {
57 baud = (
unsigned long)atol(argv[i + 1]);
58 }
else if (std::string(argv[i]) ==
"--help") {
59 std::cout <<
"\nUsage: " << argv[0] <<
" [--port <serial name>] [--baud <baud rate>] [--help]\n" << std::endl;
65 std::cout <<
"\nSerial port not specified." << std::endl;
66 std::cout <<
"\nUsage: " << argv[0] <<
" [--port <serial name>] [--baud <baud rate>] [--help]\n" << std::endl;
70 std::cout <<
"Try to connect to port \"" << port <<
"\" with baud rate " << baud << std::endl;
75 std::string line = serial.readline(
"\n");
77 std::cout <<
"Read line: " << line << std::endl;
84 std::cout <<
"Serial test is only working on unix-like OS." << std::endl;
VISP_EXPORT int wait(double t0, double t)
VISP_EXPORT double measureTimeSecond()