pub enum TxStatus {
None,
TooLate,
TooEarly,
CollisionPacket,
CollisionBeacon,
TxFreq,
TxPower,
GpsUnlocked,
}Expand description
What became of a downlink the server asked for.
Variants§
None
It was scheduled, which the protocol writes as NONE.
TooLate
It arrived too late to be scheduled.
TooEarly
Its timestamp is too far ahead.
CollisionPacket
Another packet was already scheduled then.
CollisionBeacon
A beacon was already scheduled then.
TxFreq
The radio chain cannot reach that frequency.
TxPower
The gateway cannot transmit at that power.
GpsUnlocked
A GPS timestamp was asked for while the GPS is unlocked.
Implementations§
Source§impl TxStatus
impl TxStatus
Sourcepub const fn scheduled(self) -> bool
pub const fn scheduled(self) -> bool
Reports whether the downlink was scheduled.
§Returns
true for TxStatus::None, which is the protocol’s way of saying nothing failed.
Sourcepub fn from_json(body: &[u8]) -> Result<TxStatus, ProtocolError>
pub fn from_json(body: &[u8]) -> Result<TxStatus, ProtocolError>
Reads the payload of a TX_ACK, which a gateway may leave empty when nothing failed.
§Arguments
body- the bytes after the gateway’s identifier.
§Returns
The status.
§Errors
Returns ProtocolError::Payload when the body is neither empty nor a JSON object
with a txpk_ack naming a value the protocol defines.
Trait Implementations§
impl Copy for TxStatus
impl Eq for TxStatus
impl StructuralPartialEq for TxStatus
Auto Trait Implementations§
impl Freeze for TxStatus
impl RefUnwindSafe for TxStatus
impl Send for TxStatus
impl Sync for TxStatus
impl Unpin for TxStatus
impl UnsafeUnpin for TxStatus
impl UnwindSafe for TxStatus
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