TODO: handle reading lines in a bettwr way
This commit is contained in:
parent
db3cd1548e
commit
63359cc4c0
1 changed files with 2 additions and 0 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue