TODO: handle reading lines in a bettwr way

This commit is contained in:
Vladan Popovic 2022-07-20 12:27:42 +02:00
parent db3cd1548e
commit 63359cc4c0

View file

@ -101,6 +101,8 @@ impl<UART: serial::Uart> SerialIO<UART> {
.take_while(|c| *c != '\n')
.collect();
// TODO: \r\n is true for sim800l, but might not be valud for other devices. Re-implement
// this function so that it can be used on all devices.
// \r must come right before \n on read; take_while excludes the matched element.
if line.ends_with('\r') {
line.push('\n');