Add a function to change the modulation mode and a function to receive
packets. Still needs a ton of work on various radio features and no
implementation of gfsk yet.
//! if let Some(packet) = txvr.radio_rx(65535).unwrap() {
//! println!("{:?}", packet);
//! }
//! }
//! ```
// One of the critical aspects of this library is error handling. Because it is intended
// to communicate with an external device, any operation could discover a disconnection
@ -49,6 +66,12 @@ quick_error! {
description("the LoRaWAN MAC cannot be paused")
display("The LoRaWAN MAC cannot be paused right now, but a pause was requested.")
}
/// The transceiver is busy with another operation, or is under the control of
/// the MAC, and cannot be used to perform the requested operation.
TransceiverBusy{
description("the radio transceiver hardware is in use")
display("The LoRa/FSK radio transceiver hardware is in use by another operation or the MAC layer and cannot be used to perform the requested operation.")
}
/// The program has become disconnected from the RN2903 module due to an I/O
/// error. It is possible the device was physically disconnected, or that the
/// host operating system closed the serial port for some reason.
@ -390,6 +413,60 @@ impl Rn2903 {
}
}
/// Types of modulation available for transmitting and receiving packets.
#[derive(Debug, PartialEq, Eq)]
pubenumModulationMode{
/// Regular digital frequency shift keying mode
Fsk,
/// LoRa chirp spread spectrum mode
LoRa,// TODO: GFSK with radio set bt <value>
}
/// # Radio API Functions
implRn2903{
/// Set the modulation mode used by the radio for transmission and reception.