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
ExchangeHandlerfor the BDX protocol (PROTO_ID_BDX) that accepts each incoming transfer into aBdxResponderand dispatches it to the wrappedBdxHandler. - BdxDownload
Responder - The responding side of a
download: a peer requested a download (sent aReceiveInit), so this node becomes the Sender. Inspect the request viafd, thenreplyto obtain aBdxWriter, orrejectit. - BdxReader
- A reader over a BDX transfer - the Receiver side.
- BdxUpload
Responder - The responding side of a
upload: a peer requested an upload (sent aSendInit), so this node becomes the Receiver. Inspect the request viafd/len, thenreplyto obtain aBdxReader, orrejectit. - BdxWriter
- A writer over a BDX transfer - the Sender side.
- Block
- A
Block(OpCode::Block) orBlockEof(OpCode::BlockEof) message - a chunk of the transferred data tagged with its block counter. - Block
Query - A
BlockQuery(OpCode::BlockQuery) message - a driving Receiver requesting the next block. - Block
Query With Skip - A
BlockQueryWithSkip(OpCode::BlockQueryWithSkip) message - aBlockQuerythat first advances the Sender’s cursor bybytes_to_skip. - Chained
BdxHandler - Two
BdxHandlers composed into one:handleris consulted first (viahandles), thennext. Nest these (terminated byEmptyBdxHandler) to compose more than two. - Empty
BdxHandler - A
BdxHandlerthat handles nothing - the terminator of aChainedBdxHandler. Every transfer routed to it is rejected withFileDesignatorUnknown. - Range
Control - The Range Control (RC) field of the
*Init/ReceiveAcceptmessages. - Transfer
Accept - A
SendAccept(OpCode::SendAccept) orReceiveAccept(OpCode::ReceiveAccept) message. - Transfer
Control - The Proposed Transfer Control (PTC) / Transfer Control (TC) field of the
*Init/*Acceptmessages. - Transfer
Init - A
SendInit(OpCode::SendInit) orReceiveInit(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) orUpload(a peer wants to upload to us - we receive). - BdxStatus
- The BDX status codes carried in a
StatusReportto 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§
- BdxDownload
Initiator - An extension trait for initiating a BDX download:
downloadmakes this node the (typically driving) Receiver and returns aBdxReader. - 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).
- BdxUpload
Initiator - An extension trait for initiating a BDX upload:
uploadmakes this node the (typically driving) Sender and returns aBdxWriter.
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 singlePooledBufferspool can be shared with the data model if desired.