I've been involved in other things and haven't had much time to do any coding until recently. I've managed to get the wxCTB sample: "CTB_Test.cpp" to compile and run in a cosole window. I used HyperTerminal on my pentium-2 Win98 computer for something to send to/receive from (the remote computer).
By extending the length of the timeout I had time to send an answer back to the wxCTB window. I was able to use different baud rates and I consider the experiment a success.
My first question has to do with the receivedBytes variable. This counts the bytes from the remote computer and reports the number at the end of the received string:
Code: Select all
char* receivedBytes = NULL;
int rd = dev->ReadUntilEOS(&receivedBytes,"\n",5000);
if(rd > 0) {
receivedBytes[rd] = 0;
printf("answer (%i): %s\n",rd,receivedBytes);
}
My second question is how to use the other read and write functions that are part of the tool box. The sample program uses Writev to send to the port and ReadUntilEOS to read from the port.
I notice that ReadUntilEOS is the only one with wxIOBase:: as part of the declaration and also that it is declared as virtual int. There are two other functions; Read and Write, which are declared as virtual int in wxIOBase, but they aren