(
ds: &mut internal::DeviceSession,
cid: lrwn::CID,
)
| 12 | } |
| 13 | |
| 14 | pub async fn get_pending( |
| 15 | ds: &mut internal::DeviceSession, |
| 16 | cid: lrwn::CID, |
| 17 | ) -> Result<Option<lrwn::MACCommandSet>> { |
| 18 | let b = ds |
| 19 | .mac_command_pending |
| 20 | .remove(&cid.to_u8().into()) |
| 21 | .unwrap_or_default(); |
| 22 | |
| 23 | let out = if !b.is_empty() { |
| 24 | let mut mac = lrwn::MACCommandSet::from_slice(&b); |
| 25 | |
| 26 | // Per definition, the uplink flag is set to false as this function is intended to retrieve |
| 27 | // pending mac-commands that were previously sent to the device. |
| 28 | mac.decode_from_raw(false)?; |
| 29 | |
| 30 | Some(mac) |
| 31 | } else { |
| 32 | None |
| 33 | }; |
| 34 | |
| 35 | Ok(out) |
| 36 | } |
no test coverage detected