12 std::cout <<
"****************************************************************" << std::endl;
13 std::cout <<
"* Rebot Timeout Tests *" << std::endl;
14 std::cout <<
"****************************************************************" << std::endl;
17 std::cout <<
"Enter Rebot device SDM: ";
18 std::getline(std::cin, sdm);
20 std::cout << sdm << std::endl;
22 std::cout << std::endl;
23 std::cout << std::endl;
26 unsigned long duration;
27 std::string write_register;
28 std::string read_register;
31 std::cout <<
"Starting Test: Connection Timeout" << std::endl;
32 std::cout <<
"Power down tmcb and press enter" << std::endl;
33 std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
34 std::cout <<
"Trying to connect to TMCB..." << std::endl;
42 duration = std::chrono::duration_cast<std::chrono::seconds>(end - begin).count();
43 std::cout <<
"Test Succesful: connection timed out after " << duration <<
" s" << std::endl;
47 std::cout << std::endl;
48 std::cout << std::endl;
49 std::cout <<
"Power on tmcb and press enter after it appears on the network" << std::endl;
50 std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
54 std::cout <<
"Starting Test: Read Timeout" << std::endl;
55 std::cout <<
"Please enter register name on the tmcb to read from:" << std::endl;
56 std::getline(std::cin, read_register);
59 std::cout <<
"Please pull ethernet cable and press enter..." << std::endl;
60 std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
63 [[maybe_unused]]
auto x = d.read<
int>(read_register);
67 duration = std::chrono::duration_cast<std::chrono::seconds>(end - begin).count();
68 std::cout <<
"Test Succesful: Read timed out after " << duration <<
" s" << std::endl;
73 std::cout << std::endl;
74 std::cout << std::endl;
75 std::cout <<
"Reconnect cable and powercycle tmcb; press enter after it appears on the network" << std::endl;
76 std::cin.ignore(std::numeric_limits<std::streamsize>::max(),
'\n');
78 std::cout << std::endl;
79 std::cout << std::endl;
82 std::cout <<
"Starting Test: Write Timeout" << std::endl;
83 std::cout <<
"Use same register as read for this test? Press enter if yes; else type new name" << std::endl;
84 std::getline(std::cin, write_register);
86 if(write_register.empty()) {
87 write_register = read_register;
90 std::cout << write_register <<
" will be used for testing" << std::endl;
94 std::cout <<
"Please pull ethernet cable and press enter..." << std::endl;
95 std::getline(std::cin, read_register);
98 d.write(write_register, 56);
102 duration = std::chrono::duration_cast<std::chrono::seconds>(end - begin).count();
103 std::cout <<
"Test Succesful: Write timed out after " << duration <<
" s" << std::endl;
108 std::cout <<
"****************************************************************" << std::endl;
109 std::cout <<
"* Tests complete *" << std::endl;
110 std::cout <<
"****************************************************************" << std::endl;