36 #define PORTWRITE_VERSION \ 37 "PORTWRITE V1.0 write to port" 38 #define PORTWRITE_CVSID \ 43 #include <tfxx/commandline.h> 55 int main(
int iargc,
char* argv[])
62 "usage: portwrite [-p device] [-v] string" "\n" 63 " or: portwrite --help|-h" "\n" 73 using namespace tfxx::cmdline;
74 static Declare options[]=
81 {
"p",arg_yes,
"/dev/ttyS0"},
88 cerr << usage_text << endl;
93 Commandline cmdline(iargc, argv, options);
96 if (cmdline.optset(0))
98 cerr << usage_text << endl;
99 cerr << help_text << endl;
130 opt.
device=cmdline.string_arg(2);
133 while (cmdline.extra())
135 std::string text=cmdline.next();
136 if (opt.
verbose) { cout << text << endl; }
#define PORTWRITE_VERSION
code to access a serial port (prototypes)
void write(const std::string &text) const
write string to port
int main(int iargc, char *argv[])