pub enum Message {
SendData {
data: Vec<u8, { crate::MAX_LORA_PAYLOAD_LENGTH }>,
},
ReceiveData {
data: Vec<u8, { crate::MAX_LORA_PAYLOAD_LENGTH }>,
},
Configure {
region: u8,
spreading_factor: u8,
network: u16,
},
ReportRequest,
Report {
sn: u32,
version_data: Vec<u8, 9>,
region: u8,
spreading_factor: u8,
receive_queue_size: u8,
transmit_queue_size: u8,
network: u16,
},
Status {
code: StatusCode,
},
UpgradeFirmwareRequest,
SetTimestamp {
timestamp: u64,
},
GetRawIq,
RawIq {
data: Vec<u8, RAWIQ_DATA_LENGTH>,
},
}
Expand description
Possible commands send over host protocol
This enum contains both messages send exlusively to node or exclusively to host
Variants§
SendData
Host sending data to node instructing it to broadcast it to the wireless network
ReceiveData
Node sending data to host
Configure
Host is recongifuring the node
ReportRequest
Host requesting the node status
Report
Node reporting information to host
Fields
Status
Node reporting some error state to host
Fields
§
code: StatusCode
UpgradeFirmwareRequest
Firmware upgrade will follow
SetTimestamp
Set current time
GetRawIq
Get rawIq data
RawIq
Node returns raw IQ data to host
Implementations§
Source§impl Message
impl Message
pub fn try_from_cobs(buf: &mut [u8]) -> Result<Message, Error>
pub fn len(&self) -> usize
pub fn as_bytes(&self) -> Result<Vec<u8, MAX_MESSAGE_LENGTH>, Error>
pub fn encode(&self) -> Result<HostMessageVec, Error>
pub fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<usize, Error>
pub fn into_encoded_bytes(self) -> Result<HostMessageVec, Error>
Trait Implementations§
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more