I get problem when used RCM5600W development kit.
Why receive buffer not empty after I’ve flush serial input buffer, then send data out?
I send data out the serial port, but the data also enter into the serial buffer. Its echo mode?
// 1. Clear RX buffer
serXrdFlush(SER_PORT_F);
// 2. Read RX buffer status, RX buffer is empty in here (it's OK)
printf("RX BUFFER AFTER FLUSH: %d
", serXrdUsed(SER_PORT_F)); // result = 0
// 3. Send mode
serF->xRTSon();
// 4. Sending data
serXputc(SER_PORT_F, EOT);
serXputc(SER_PORT_F, DeviceID);
serXputc(SER_PORT_F, POLLING);
serXputc(SER_PORT_F, ENQ);
// 5. Wait until data is sent
while(serXwrUsed(SER_PORT_F)>0);
// 6. Read RX buffer status, Why RX buffer is not empty, I clear RX buffer on top of code(step 1).
// I see 4 characters in RX buffer (Its problem).
printf("RX BUFFER AFTER TRANSMITE: %d
", serXrdUsed(SER_PORT_F)); // result = 4
// 7. Receive mode
serF->xRTSoff();
// Receive data in here