pub fn parse_downlink_mac_commands(
    data: &[u8]
) -> MacCommandIterator<'_, DownlinkMacCommand<'_>> 
Expand description

Parses bytes to downlink mac commands if possible.

Could return error if some values are out of range or the payload does not end at mac command boundry.

Argument

  • bytes - the data from which the MAC commands are to be built.

Examples

let mut data = vec![0x02, 0x03, 0x00];
let mac_cmds: Vec<lorawan::maccommands::DownlinkMacCommand> =
    lorawan::maccommands::parse_downlink_mac_commands(&data).collect();