29 #include "../src/SerialDev.hxx" 33 #include <boost/format.hpp> 36 int main(
int argc,
char ** argv)
39 std::cerr <<
"Usage: SerialDev_Test <serial_dev>" << std::endl;
43 std::string devname(argv[1]);
48 std::string on(
"ON00NO");
49 std::string off(
"ST00TS");
55 std::cerr <<
"Need to add synchronization here --- for arduino... send a challenge/response that gives us a starting point for synchronization" << std::endl;
58 for(
int i = 0; i < 8; i++) {
59 on = (boost::format(
"ON%d%dNO%c") % i % i % ctlj).str();
65 std::cerr << boost::format(
"on: success\n");
68 std::cerr << boost::format(
"on: fail\n");
72 off = (boost::format(
"ST%d%dTS%c") % i % i % ctlj).str();
76 std::cerr << boost::format(
"off: got reply [%s]\n") % repl;
79 std::cerr << boost::format(
"off: success\n");
82 std::cerr << boost::format(
"off: fail\n");
bool getString(std::string &str, unsigned int maxlen)
int main(int argc, char **argv)
bool palindromeCommand(std::string &str)
bool putString(const std::string &str)