atat: ATI response cannot be parsed as String, but can as Bytes
I noticed the following when trying out atat
. When defining ATI response using heapless::Bytes
it parses correctly.
#[derive(Debug, Clone, AtatResp)]
pub struct ATIResponse
{
pub info: Bytes<64>,
}
The response:
ATIResponse { info: b'Quectel\r\nEC25\r\nRevision: EC25EFAR06A09M4G' }
But when using heapless::String
it results in Error::Parse
.
#[derive(Debug, Clone, AtatResp)]
pub struct ATIResponse
{
pub info: String<64>,
}
Perhaps still the same issue as in #86.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 32 (15 by maintainers)
I ran into this problem at work and came up with the following solution. I’m not particularly proud of it but it’s an ok stopgap until something nicer comes along 😃