CSerialPort::CSerialPort()
{
m_fd = -1;
+ m_tostdout = false;
}
CSerialPort::~CSerialPort()
}
//print what's written to stdout for debugging
-// if (m_tostdout)
-// {
-// printf("%s write:", m_name.c_str());
-// for (int i = 0; i < byteswritten; i++)
-// printf(" %02x", (unsigned int)data[i]);
-//
-// printf("\n");
-// }
+ if (m_tostdout)
+ {
+ printf("%s write:", m_name.c_str());
+ for (int i = 0; i < byteswritten; i++)
+ printf(" %02x", data->at(i));
+
+ printf("\n");
+ }
return byteswritten;
}
}
//print what's read to stdout for debugging
-// if (m_tostdout && bytesread > 0)
-// {
-// printf("%s read:", m_name.c_str());
-// for (int i = 0; i < bytesread; i++)
-// printf(" %02x", (unsigned int)data[i]);
-//
-// printf("\n");
-// }
+ if (m_tostdout && bytesread > 0)
+ {
+ printf("%s read:", m_name.c_str());
+ for (int i = 0; i < bytesread; i++)
+ printf(" %02x", data[i]);
+
+ printf("\n");
+ }
return bytesread;
}