rename payload to response in response size parsing

This commit is contained in:
Vladan Popovic 2022-06-25 18:33:43 +02:00
parent bc495a7592
commit a4c8d03eb9

View file

@ -268,7 +268,7 @@ impl<UART: serial::Uart> Modem<UART> {
Ok(())
}
fn tcp_parse_payload_size(&mut self, reply_line: &str) -> Result<usize> {
fn tcp_parse_response_size(&mut self, reply_line: &str) -> Result<usize> {
reply_line.split(',')
.into_iter()
.last()
@ -283,7 +283,7 @@ impl<UART: serial::Uart> Modem<UART> {
.filter(|line| line.contains("+CIPRXGET: 4"))
.next()
.ok_or(ModemError::CommandError("reply not found :/".to_string()))
.map(|line| self.tcp_parse_payload_size(line))
.map(|line| self.tcp_parse_response_size(line))
.unwrap_or(Err(ModemError::CommandError(format!("received 0 elements from parsing"))))
}