#include #include "util/comstream.h" using namespace std; int main(int argc, char *argv[]){ cerr << "Usage: " << argv[0] << " COMport" << endl; cerr << "Ex) " << argv[0] << " COM1" << endl; if(argc <= 1){ cerr << "COMport unspecified!!" << endl; exit(-1); } try{ ComportStream com_io(argv[1]); char buf[1]; while(true){ com_io.read(buf, sizeof(buf)); com_io << buf[0]; } }catch(exception &e){ cerr << e.what() << endl; } return 0; }