Hello,
I am attempting to make use of atat for an application to make and answer voice calls as well as sending and interpreting DTMF tones. The modem I'm using emits the following when a voice call comes in:
I was able to return a single Urc on a ring with the following (note the urc_helper in impl Parser for Urc has a trailing '\r':
#[derive(Clone, Debug)]
pub enum Urc {
// #[at_urc(b"RING")]
Ring,
// #[at_urc(b"RDY")]
Ready,
// #[at_urc(b"MISSED_CALL")]
MissedCall,
// #[at_urc(b"+RXDTMF")]
Dtmf,
}
impl AtatUrc for Urc {
type Response = Urc;
#[inline]
fn parse(resp: &[u8]) -> Option<Self::Response> {
let index = resp.iter().position(|&x| x == b':').unwrap_or(resp.len());
Some(match &resp[..index] {
b"MISSED_CALL" => Urc::MissedCall,
b"RING" => Urc::Ring,
b"RDY" => Urc::Ready,
b"+RXDTMF" => Urc::Dtmf,
_ => return None,
})
}
}
impl Parser for Urc {
fn parse<'a>(buf: &'a [u8]) -> Result<(&'a [u8], usize), ParseError> {
let (_, r) = alt((
urc_helper(&b"MISSED_CALL"[..]),
urc_helper(&b"RING\r"[..]),
urc_helper(&b"RDY"[..]),
urc_helper(&b"+RXDTMF"[..]),
))(buf)?;
Ok(r)
}
}
However, if there is a subsequent \r\r\nRING\r\r\n I seem to stop getting any more data from the Digester (calls to try_next_message_pure() on the Urc subscription channel return None).
I'm not sure where exactly to begin to debug this further as I am quite the Rust n00b.
Hello,
I am attempting to make use of atat for an application to make and answer voice calls as well as sending and interpreting DTMF tones. The modem I'm using emits the following when a voice call comes in:
I was able to return a single Urc on a ring with the following (note the
urc_helperinimpl Parser for Urchas a trailing'\r':However, if there is a subsequent
\r\r\nRING\r\r\nI seem to stop getting any more data from the Digester (calls totry_next_message_pure()on the Urc subscription channel returnNone).I'm not sure where exactly to begin to debug this further as I am quite the Rust n00b.