pub struct Info {Show 20 fields
pub proto_major: u8,
pub proto_minor: u8,
pub fw_major: u8,
pub fw_minor: u8,
pub fw_patch: u8,
pub radio_chip_id: u16,
pub capability_bitmap: u64,
pub supported_sf_bitmap: u16,
pub supported_bw_bitmap: u16,
pub max_payload_bytes: u16,
pub rx_queue_capacity: u16,
pub tx_queue_capacity: u16,
pub freq_min_hz: u32,
pub freq_max_hz: u32,
pub tx_power_min_dbm: i8,
pub tx_power_max_dbm: i8,
pub mcu_uid_len: u8,
pub mcu_uid: [u8; 32],
pub radio_uid_len: u8,
pub radio_uid: [u8; 16],
}Expand description
GET_INFO response payload.
mcu_uid and radio_uid are fixed-capacity arrays (MAX_MCU_UID_LEN
and MAX_RADIO_UID_LEN respectively). Only the first *_len bytes
are meaningful on the wire; the rest are zero-padded and ignored.
radio_chip_id is stored as the raw u16. Use chip_id() to project
it into the RadioChipId enum when convenient; unassigned values
stay representable so a newer device advertising a chip this codec
hasn’t heard of still round-trips cleanly.
Fields§
§proto_major: u8§proto_minor: u8§fw_major: u8§fw_minor: u8§fw_patch: u8§radio_chip_id: u16§capability_bitmap: u64§supported_sf_bitmap: u16§supported_bw_bitmap: u16§max_payload_bytes: u16§rx_queue_capacity: u16§tx_queue_capacity: u16§freq_min_hz: u32§freq_max_hz: u32§tx_power_min_dbm: i8§tx_power_max_dbm: i8§mcu_uid_len: u8§mcu_uid: [u8; 32]§radio_uid_len: u8§radio_uid: [u8; 16]Implementations§
Source§impl Info
impl Info
Sourcepub const MIN_WIRE_SIZE: usize = 37
pub const MIN_WIRE_SIZE: usize = 37
Size of the fixed-layout prefix (through radio_uid_len’s byte).
The spec locates radio_uid_len at offset 36 + mcu_uid_len; the
37 bytes of fixed fields before mcu_uid plus 1 for the
radio_uid_len byte gives the absolute minimum wire size (with
mcu_uid_len = 0 and radio_uid_len = 0).
Sourcepub fn chip_id(&self) -> Option<RadioChipId>
pub fn chip_id(&self) -> Option<RadioChipId>
Project radio_chip_id into the enum. Returns None for
unassigned values so callers can decide how to handle them.
Sourcepub fn supports(&self, mask: u64) -> bool
pub fn supports(&self, mask: u64) -> bool
True if the device advertises a given capability bit.
Sourcepub fn encode(&self, buf: &mut [u8]) -> Result<usize, InfoParseError>
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, InfoParseError>
Encode into buf. Returns the number of bytes written
(37 + mcu_uid_len + radio_uid_len).
Sourcepub fn decode(buf: &[u8]) -> Result<Self, InfoParseError>
pub fn decode(buf: &[u8]) -> Result<Self, InfoParseError>
Decode from buf. The full slice must be the GET_INFO payload.