#include #include #include #include #include using namespace std; #define DEBUG 1 #include "com_if.h" //#define STEP_INTERVAL 1000 * 60 * 1 //[ms] // 1•ªŠÔ #define STEP_INTERVAL 1000 * 3 //[ms] // 5•bŠÔ #ifndef PI #define PI 3.14159265358979323846 #endif int main(int argv, const char *argc[]){ char buf[128]; COMIF *com_if(NULL); com_if = ((argv >= 2) ? (new COMIF(atoi(argc[1]))) : (new COMIF())); for(unsigned int i(0); true; i++){ const char test_str[] = "The quick brown fox jumps over the lazy dog. 1234567890"; cout << "TX(" << i << "): " << test_str << endl; com_if->write_to(test_str, sizeof(test_str)); for(unsigned int j(0); j < 10; j++){ buf[com_if->read_from(buf, sizeof(buf))] = '\0'; cout << "RX(" << i << ", " << j << "): " << buf << endl; Sleep(10); } Sleep(STEP_INTERVAL); } delete com_if; }