I\'m attempting to read from my serial port using the following C code. I can successfully write to a listening computer (yay!) but the read throws Error (Code 11 - Resource tem
You have a buffer overflow here:
sprintf(message,"Test%d\r",running);
since message
is declared as:
char message[6];
message
needs to be at least 7 characters in size if it's going to hold a 6 character string, due to the need for a '\0'
terminator.
There may well be other problems too, but you should fix this and see if it makes any difference.