wjwwood / serial

Cross-platform, Serial Port library written in C++
http://wjwwood.github.com/serial/
MIT License
2.13k stars 1.04k forks source link

can write but can not read any strings #217

Closed guoxinzhan closed 3 years ago

guoxinzhan commented 4 years ago

Is the serial port open? Yes. Timeout == 1000ms, asking for 1 more byte than written.AT9600 Iteration: 0, Bytes written: 2, Bytes read: 0, String read: Iteration: 1, Bytes written: 2, Bytes read: 0, String read: Iteration: 2, Bytes written: 2, Bytes read: 0, String read: Iteration: 3, Bytes written: 2, Bytes read: 0, String read: Iteration: 4, Bytes written: 2, Bytes read: 0, String read:

shiwenwang commented 4 years ago

Is the serial port open? Yes. Timeout == 1000ms, asking for 1 more byte than written. Iteration: 0, Bytes written: 6, Bytes read: 6, String read: AT\r\n Iteration: 1, Bytes written: 6, Bytes read: 6, String read: AT\r\n Iteration: 2, Bytes written: 6, Bytes read: 6, String read: AT\r\n Iteration: 3, Bytes written: 6, Bytes read: 6, String read: AT\r\n Iteration: 4, Bytes written: 6, Bytes read: 6, String read: AT\r\n Iteration: 5, Bytes written: 6, Bytes read: 6, String read: AT\r\n

Reading worked, but theresult is unexcepted for me. It should be \r\nOK.

wjwwood commented 3 years ago

Seems like an issue with the device that is connected, not the library? Closing.