Skip to main content

Module file_transfer

Module file_transfer 

Source
Expand description

Layer 3: file-transfer state machine.

Drives the protocol-1 sub-protocol (QUERY / OPEN / WRITE / CLOSE / ABORT) on top of a Session. Translates the session’s raw Events into file-level FileEvents so the caller doesn’t have to parse the PFT:* tokens themselves.

§Lifecycle

Idle ── query()  ──► AwaitingQueryReply ──► Negotiated
                                             │
Negotiated ── open() ──► AwaitingOpenReply ──┴──► Opened ── close() ──► Closed
                                             │           ── abort() ──► Aborted
                                             └── (busy/fail) ──► Failed
Opened     ── write() ──► AwaitingWriteAck ──► Opened

Compression is negotiated inside FileTransfer::query: if the caller passed Compression::Auto and the device advertises heatshrink, the negotiated parameters are exposed via FileTransfer::negotiated_compression. The adapter modules are responsible for actually compressing chunk bytes before calling FileTransfer::write.

Structs§

FileTransfer
File-transfer state machine driving a Session.

Enums§

Compression
Caller-visible compression preference.
FileError
Reasons a transfer failed.
FileEvent
Things FileTransfer::poll emits as the protocol progresses.