pub fn wor_join_request(uplink: Carrier) -> Result<[u8; 5], LorawanError>Expand description
Builds the wake-on-radio frame ahead of a join request, TS011-1.0.1 section 5.3.1.
§Arguments
uplink- where and how fast the join request follows.
§Returns
The frame.
§Errors
Returns LorawanError::MalformedFrame for a data rate past 15 or a frequency the
three-byte field cannot carry.
§Examples
use pamoja_lorawan::relay::{wor_join_request, Carrier, Wor};
// A device wakes its relay to say a join request follows on 868.1 MHz at DR5.
let uplink = Carrier::new(868_100_000, 5);
let frame = wor_join_request(uplink)?;
assert_eq!(frame.len(), 5, "a kind, a data rate, and three bytes of frequency");
// The relay reads where to listen for it.
assert_eq!(Wor::parse(&frame)?, Wor::JoinRequest { uplink });