--- branches/linux-serial/Serial.cpp 2007/02/05 10:11:47 55 +++ branches/linux-serial/Serial.cpp 2007/02/05 10:24:24 56 @@ -14,8 +14,11 @@ #include #include #include + +#ifdef DEBUG #include #include +#endif #define _POSIX_SOURCE 1 /* POSIX compliant source */ #define BAUDRATE B9600 @@ -131,12 +134,10 @@ { termios newtio; - std::cout << "opening port " << std::endl; mFiledescriptor = ::open(mPortstr, flags); if (mFiledescriptor < 0) throw std::runtime_error( writeLastError() ); - std::cout << "port opened" << std::endl; bzero(&newtio, sizeof(newtio) ); // use a std. 8N1 config @@ -150,16 +151,10 @@ newtio.c_cc[VTIME] = 0; // inter-character timer unused newtio.c_cc[VMIN] = 0; // blocking read until 1 chars received - -/* cfmakeraw(&newtio); - cfsetospeed(&newtio, B9600 ); - cfsetispeed(&newtio, B9600 ); -*/ tcflush(mFiledescriptor, TCIFLUSH); tcsetattr(mFiledescriptor, TCSANOW, &newtio); - std::cout << "port configured " << std::endl; mIsopen = true; } #endif @@ -202,7 +197,6 @@ size = read(mFiledescriptor, &out, 1); if (size != 1) { - //std::cout << writeLastError() << std::endl; return -1; } #endif @@ -352,8 +346,10 @@ // void CSerial::printByte(char* description, unsigned char byte) { +#ifdef DEBUG std::cout << description << " : " << (int) byte << "/" << std::setw(2) << std::setfill('0') << std::hex << (int) byte << std::endl; std::cout << std::dec; +#endif }