Skip to main content

Module bdx

Module bdx 

Source
Expand description

Re-export the rs-matter crate Bulk Data Exchange (BDX) protocol.

BDX transfers an opaque “file” (a sequence of bytes plus optional metadata) between two nodes over a single Exchange, inside a PASE or CASE session. It is used, among other things, to download Over-the-Air (OTA) software-update images.

It provides the wire codec (the protocol id, opcodes, status codes, the TransferControl/RangeControl flag fields, and the message types with binary parse/encode) and a synchronous streaming engine on top of it: the BdxDownloadInitiator/BdxUploadInitiator initiator traits and the BdxDownloadResponder/BdxUploadResponder responders, which yield BdxReader/BdxWriter byte-stream handles.

All multi-byte integers are little-endian (as per the Matter Core spec).

Structs§

Bdx
An ExchangeHandler for the BDX protocol (PROTO_ID_BDX) that accepts each incoming transfer into a BdxResponder and dispatches it to the wrapped BdxHandler.
BdxDownloadResponder
The responding side of a download: a peer requested a download (sent a ReceiveInit), so this node becomes the Sender. Inspect the request via fd, then reply to obtain a BdxWriter, or reject it.
BdxReader
A reader over a BDX transfer - the Receiver side.
BdxUploadResponder
The responding side of a upload: a peer requested an upload (sent a SendInit), so this node becomes the Receiver. Inspect the request via fd/len, then reply to obtain a BdxReader, or reject it.
BdxWriter
A writer over a BDX transfer - the Sender side.
Block
A Block (OpCode::Block) or BlockEof (OpCode::BlockEof) message - a chunk of the transferred data tagged with its block counter.
BlockQuery
A BlockQuery (OpCode::BlockQuery) message - a driving Receiver requesting the next block.
BlockQueryWithSkip
A BlockQueryWithSkip (OpCode::BlockQueryWithSkip) message - a BlockQuery that first advances the Sender’s cursor by bytes_to_skip.
ChainedBdxHandler
Two BdxHandlers composed into one: handler is consulted first (via handles), then next. Nest these (terminated by EmptyBdxHandler) to compose more than two.
EmptyBdxHandler
A BdxHandler that handles nothing - the terminator of a ChainedBdxHandler. Every transfer routed to it is rejected with FileDesignatorUnknown.
RangeControl
The Range Control (RC) field of the *Init/ReceiveAccept messages.
TransferAccept
A SendAccept (OpCode::SendAccept) or ReceiveAccept (OpCode::ReceiveAccept) message.
TransferControl
The Proposed Transfer Control (PTC) / Transfer Control (TC) field of the *Init/*Accept messages.
TransferInit
A SendInit (OpCode::SendInit) or ReceiveInit (OpCode::ReceiveInit) message - the opening message of a BDX session.

Enums§

BdxResponder
An accepted, not-yet-answered BDX transfer, in one of the two directions: Download (a peer wants to download from us - we send) or Upload (a peer wants to upload to us - we receive).
BdxStatus
The BDX status codes carried in a StatusReport to fail or reject a transfer.
OpCode
The BDX protocol message opcodes.

Constants§

BDX_VERSION
The BDX protocol version implemented here. BDX Version 0 is the first (and, as of Matter 1.5, only) version.
PROTO_ID_BDX
The Matter protocol id for BDX.

Traits§

BdxDownloadInitiator
An extension trait for initiating a BDX download: download makes this node the (typically driving) Receiver and returns a BdxReader.
BdxHandler
A device-specific BDX handler: one or more “files” - identified by their BDX file designator and direction - that this node serves (a download) or processes (an upload).
BdxUploadInitiator
An extension trait for initiating a BDX upload: upload makes this node the (typically driving) Sender and returns a BdxWriter.

Type Aliases§

BdxBuffer
The buffer a BDX transfer stages each block in. Aliases the central Buffer (same size as an Interaction Model exchange buffer), so a single PooledBuffers pool can be shared with the data model if desired.