pub enum IncomingStateMachine {
Show 17 variants
None,
RealTimeData {
buffer: [u8; 8],
received_bytes: usize,
},
DeviceIdentifier {
buffer: [u8; 8],
received_bytes: usize,
},
UserInformation {
buffer: [u8; 8],
received_bytes: usize,
},
StorageStartTimeDate {
buffer: [u8; 7],
received_bytes: usize,
},
StorageStartTimeTime {
buffer: [u8; 7],
received_bytes: usize,
},
StorageDataLength {
buffer: [u8; 7],
received_bytes: usize,
},
StorageDataWithPI {
buffer: [u8; 5],
received_bytes: usize,
},
StorageDataSegmentAmount {
buffer: [u8; 3],
received_bytes: usize,
},
CommandFeedback {
buffer: [u8; 3],
received_bytes: usize,
},
FreeFeedback {
buffer: [u8; 1],
received_bytes: usize,
},
DisconnectNotice {
buffer: [u8; 2],
received_bytes: usize,
},
PIIdentifiers {
buffer: [u8; 2],
received_bytes: usize,
},
StorageData {
buffer: [u8; 7],
received_bytes: usize,
},
UserAmount {
buffer: [u8; 2],
received_bytes: usize,
},
DeviceNotice {
buffer: [u8; 8],
received_bytes: usize,
},
StorageDataIdentifiers {
buffer: [u8; 8],
received_bytes: usize,
},
}
Expand description
State machine which handles incoming packages
Variants
None
Current status: nothing read
RealTimeData
Real time data
DeviceIdentifier
Device identifier
UserInformation
User Information
StorageStartTimeDate
Storage start time(date)
StorageStartTimeTime
Storage start time(time)
StorageDataLength
Storage Data Length
StorageDataWithPI
Storage Data with PI
StorageDataSegmentAmount
Storage Data Segment Amount
CommandFeedback
Command Feedback
FreeFeedback
Device free feedback
DisconnectNotice
Device disconnect notice
PIIdentifiers
PI Identifiers
StorageData
Storage Data
UserAmount
User Amount
DeviceNotice
Device Notice
StorageDataIdentifiers
Storage Data Identifiers
Implementations
sourceimpl IncomingStateMachine
impl IncomingStateMachine
sourcepub fn resume<E: AsErrorSource>(
&mut self,
read: impl FnMut(&mut [u8]) -> Poll<Result<usize, E>>
) -> Poll<Result<IncomingPackage, E>>
pub fn resume<E: AsErrorSource>(
&mut self,
read: impl FnMut(&mut [u8]) -> Poll<Result<usize, E>>
) -> Poll<Result<IncomingPackage, E>>
Resumes execution of the state machine
Arguments
read
- A function which read new bytes into the provided buffer. It must returnPoll::Pending
if no data is available for reading, orPoll::Ready(Ok(num_bytes_read))
otherwise.
Auto Trait Implementations
impl RefUnwindSafe for IncomingStateMachine
impl Send for IncomingStateMachine
impl Sync for IncomingStateMachine
impl Unpin for IncomingStateMachine
impl UnwindSafe for IncomingStateMachine
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more