46 #include <visp3/core/vpTime.h> 48 #include <visp3/core/vpSerial.h> 50 int main(
int argc,
char **argv)
55 unsigned long baud = 9600;
56 for (
int i = 0; i < argc; i++) {
57 if (std::string(argv[i]) ==
"--port")
58 port = std::string(argv[i + 1]);
59 else if (std::string(argv[i]) ==
"--baud") {
60 baud = (
unsigned long)atol(argv[i + 1]);
62 else if (std::string(argv[i]) ==
"--help") {
63 std::cout <<
"\nUsage: " << argv[0] <<
" [--port <serial name>] [--baud <baud rate>] [--help]\n" << std::endl;
69 std::cout <<
"\nSerial port not specified." << std::endl;
70 std::cout <<
"\nUsage: " << argv[0] <<
" [--port <serial name>] [--baud <baud rate>] [--help]\n" << std::endl;
74 std::cout <<
"Try to connect to port \"" << port <<
"\" with baud rate " << baud << std::endl;
79 std::string line = serial.readline(
"\n");
81 std::cout <<
"Read line: " << line << std::endl;
88 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()