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') |             .take_while(|c| *c != '\n') | ||||||
|             .collect(); |             .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.
 |         // \r must come right before \n on read; take_while excludes the matched element.
 | ||||||
|         if line.ends_with('\r') { |         if line.ends_with('\r') { | ||||||
|             line.push('\n'); |             line.push('\n'); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue