Skip to main content

Crate zerodds_coap_bridge

Crate zerodds_coap_bridge 

Source
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)

§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 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-bridged Daemon-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.