CyberSamurai0 / P2P-Transmitter

MIT License
0 stars 1 forks source link

Fix USB-Serial stdin #12

Open CyberSamurai0 opened 5 days ago

CyberSamurai0 commented 5 days ago

Raspberry Pi Pico is fully able to write data to stdout which is displaying correctly in Serial Monitoring software.

Pico is entirely unresponsive to stdin reads (tested only with scanf()). The scanf() function is a blocking function and should not be used with our final product. It is possible that the blocking nature of scanf() is why stdin over serial is nonfunctional; however, this issue may have an underlying issue related to the USB-Serial driver, CMakeLists.txt file, and/or Windows operating system.

CyberSamurai0 commented 5 days ago

The scanf() function is now functional, the issue was caused by some minor oversights previously.

However, input is not echoed to the user over serial. As in 3ff94210a5995502d25daffff92ace69a9deb647, we can scan individual characters from stdin and manually collect them into a character array, but we need a maximum buffer size.

Thinking 1500 bytes to remain consistent with TCP standard MTU. This would only be the data portion of the transmission, and would exclude any header bytes we might choose to add (awaiting #11).