Expand description
Crate zerodds-coap-bridge. Safety classification: STANDARD.
CoAP (RFC 7252) Wire-Codec + Reliability + Discovery + Bridge —
pure-Rust no_std + alloc, forbid(unsafe_code). Implementiert
neben dem reinen Wire-Codec auch alle CoAP-Begleit-Schichten:
Reliability/Congestion-Control (§4.2-§4.7), Request/Response-
Matching (§5.3), Block-Wise-Transfer (RFC 7959), Resource-Discovery
im CoRE-Link-Format (RFC 6690), Observe-Registry (RFC 7641),
Multicast-Diskovery, Caching/Proxying (§5.6 + §5.7), DTLS-Mode-
Marker (§9) und einen Bidirectional-CoAP↔DDS-Topic-Bridge.
Spec-Referenzen:
- RFC 7252 — CoAP (Constrained Application Protocol).
- RFC 7641 — Observing Resources in CoAP.
- RFC 7959 — Block-Wise Transfer.
- RFC 6690 — CoRE-Link-Format.
§Schichten-Position
Layer 5 — Bridges. Substrat fuer DDS↔IoT-Endpoint-Mapping (Constrained-Devices, OPC-UA-PubSub-Mapping, ROS-2-on-Constrained- Bridges).
§Public API (Stand 1.0.0-rc.1)
CoapMessage/CoapCode/MessageType— Message-Modell (§3 + §12.1).encode/decode/CodecError— Wire-Codec.CoapOption/OptionNumber/OptionValue— Options mit Delta-Encoding + Extended-Length (§3.1, §5.10).BlockOption/BlockValue/BlockReassembler/BlockError— Block-Wise-Transfer (RFC 7959).CoreLink/encode_links/decode_links— Resource- Discovery (RFC 6690).OBSERVE_OPTION_NUMBER/ObserveRegistry/ObserverEntry— RFC 7641 Observer-State.PendingConfirmable/ReliabilityTracker/TickOutput/ACK_TIMEOUT_MS/MAX_RETRANSMIT— Reliability §4.CoapDdsBridge/BridgeOp/BridgeError/map_method/parse_dds_path— CoAP↔DDS-Topic-Mapping.
§Beispiel
use zerodds_coap_bridge::{decode, encode, CoapCode, CoapMessage, MessageType};
let msg = CoapMessage {
version: 1,
message_type: MessageType::Confirmable,
token: Vec::new(),
code: CoapCode::GET,
message_id: 0xBEEF,
options: Vec::new(),
payload: Vec::new(),
};
let wire = encode(&msg).expect("encode");
let decoded = decode(&wire).expect("decode");
assert_eq!(decoded.code, CoapCode::GET);Re-exports§
pub use blockwise::BlockError;pub use blockwise::BlockOption;pub use blockwise::BlockReassembler;pub use blockwise::BlockValue;pub use bridge::BridgeError;pub use bridge::BridgeOp;pub use bridge::CoapDdsBridge;pub use bridge::map_method;pub use bridge::parse_dds_path;pub use codec::CodecError;pub use codec::decode;pub use codec::encode;pub use core_link::CoreLink;pub use core_link::decode_links;pub use core_link::encode_links;pub use message::CoapCode;pub use message::CoapMessage;pub use message::MessageType;pub use observe::OBSERVE_OPTION_NUMBER;pub use observe::ObserveRegistry;pub use observe::ObserverEntry;pub use option::CoapOption;pub use option::OptionNumber;pub use option::OptionValue;pub use reliability::ACK_TIMEOUT_MS;pub use reliability::MAX_RETRANSMIT;pub use reliability::PendingConfirmable;pub use reliability::ReliabilityTracker;pub use reliability::TickOutput;
Modules§
- blockwise
- Block-Wise Transfer — RFC 7959.
- bridge
- CoAP↔DDS-Topic-Bridge.
- caching_
proxy - CoAP Caching + Proxying nach RFC 7252 §2.3 / §5.6 / §5.7 + HTTP-Cross-Proto-Mapping nach RFC 7252 §10.
- codec
- CoAP-Wire-Codec — RFC 7252 §3 + §3.1.
- core_
link - CoRE-Link-Format — RFC 6690.
- daemon
zerodds-coap-bridgedDaemon-Implementation.- dtls
- CoAP DTLS Mode nach RFC 7252 §9.
- matching
- Request/Response-Matching nach RFC 7252 §5.3.
- message
- CoAP-Message Modell — RFC 7252 §3 + §12.1.
- method_
props - Method-Properties (Idempotency / Safety) nach RFC 7252 §5.8.
- multicast
- CoAP Multicast Operation nach RFC 7252 §8.
- observe
- Observe-Pattern — RFC 7641.
- option
- CoAP Option Model — RFC 7252 §3.1, §5.10 + RFC 7641 §2.
- reliability
- CoAP-Reliability — RFC 7252 §4.2-§4.7.
- uri
- CoAP URI-Scheme-Parser nach RFC 7252 §6.