pub enum Event {
Synced {
max_block_size: u16,
protocol_version: String,
},
Ack(u8),
ResendRequested(u8),
AsciiLine(String),
FatalError,
OutOfSync {
expected: u8,
got: u8,
},
Timeout {
sync: u8,
},
}Expand description
Things the session emits to the caller as parsed bytes arrive.
Variants§
Synced
Sync handshake completed. Carries the device’s reported block size and protocol version.
Fields
Ack(u8)
An ok<n> line was received, acknowledging the packet with sync n.
ResendRequested(u8)
A rs<n> line was received: the device is requesting we retransmit
the packet with sync n.
AsciiLine(String)
A line was received that did not match any known control token.
The file-transfer layer consumes these to parse PFT:* replies.
FatalError
A fe line was received: device reports a fatal protocol error.
OutOfSync
The session received an ok<m> whose number did not match the
in-flight packet’s sync. Recovery requires calling
Session::reset then Session::connect — the protocol
has no way to resynchronise mid-stream.
Timeout
A queued packet exceeded its total retransmit budget without an ack. The packet has been dropped from the queue.