Skip to content

Commit d443c9d

Browse files
author
test
committed
refactor: remove design references from mqtt-connector doc comments
1 parent db9c7f1 commit d443c9d

4 files changed

Lines changed: 24 additions & 24 deletions

File tree

aimdb-mqtt-connector/src/embassy_client.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ unsafe impl Sync for TlsSlot {}
297297
///
298298
/// Collects routes from the database during `build()` and wires the broker
299299
/// manager + the outbound/inbound pumps. The broker URL scheme selects the
300-
/// transport (design 044 D9): `mqtt://` is plain TCP (default port 1883),
301-
/// `mqtts://` is TLS (default port 8883) and requires both the `embassy-tls`
302-
/// feature and [`with_tls`](Self::with_tls).
300+
/// transport: `mqtt://` is plain TCP (default port 1883), `mqtts://` is TLS
301+
/// (default port 8883) and requires both the `embassy-tls` feature and
302+
/// [`with_tls`](Self::with_tls).
303303
pub struct MqttConnectorBuilder {
304304
broker_url: String,
305305
client_id: String,
@@ -351,7 +351,7 @@ impl MqttConnectorBuilder {
351351
self
352352
}
353353

354-
/// Provide the TLS materials for an `mqtts://` broker (design 044 §4).
354+
/// Provide the TLS materials for an `mqtts://` broker.
355355
///
356356
/// Required for `mqtts://` URLs; rejected at `build()` for `mqtt://`.
357357
#[cfg(feature = "embassy-tls")]
@@ -393,7 +393,7 @@ impl ConnectorBuilder for MqttConnectorBuilder {
393393
static_connection_settings(&self.client_id, self.credentials.as_ref());
394394

395395
// Broker manager task(s) + the channel ends for the pumps.
396-
// The URL scheme selects the transport (design 044 D9).
396+
// The URL scheme selects the transport.
397397
#[cfg(feature = "embassy-tls")]
398398
let (action_sender, event_receiver, manager_tasks) = {
399399
let tls_options = self.tls.0.borrow_mut().take();
@@ -454,7 +454,7 @@ impl ConnectorBuilder for MqttConnectorBuilder {
454454
}
455455
}
456456

457-
/// Parsed broker endpoint: transport + authority (design 044 D9).
457+
/// Parsed broker endpoint: transport + authority.
458458
struct BrokerUrl {
459459
tls: bool,
460460
host: String,
@@ -597,8 +597,8 @@ fn setup_manager(
597597
}
598598

599599
/// Set up the TLS broker manager ([`run_tls`]) plus the SNTP time-source
600-
/// task (design 044 §5–§6). Synchronous — no `.await` — so the caller's
601-
/// `build` future stays `Send`.
600+
/// task. Synchronous — no `.await` — so the caller's `build` future stays
601+
/// `Send`.
602602
#[cfg(feature = "embassy-tls")]
603603
fn setup_tls_manager(
604604
broker: &BrokerUrl,
@@ -616,7 +616,7 @@ fn setup_tls_manager(
616616
let (action_sender, action_receiver, event_sender, event_receiver) = init_channels();
617617

618618
// `Settings` supplies the session cadence and port; its address field is
619-
// unused on the TLS path (the host is resolved per attempt, 044 D7).
619+
// unused on the TLS path (the host is resolved per attempt instead).
620620
let settings = Settings::new(Ipv4Address::UNSPECIFIED, broker.port);
621621
let network = stack.get();
622622
let host = broker.host.clone();

aimdb-mqtt-connector/src/embassy_tls.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! TLS transport for the Embassy MQTT client (design 044).
1+
//! TLS transport for the Embassy MQTT client.
22
//!
33
//! `mqtts://` broker sessions: an `embedded-tls` 1.3 session over the Embassy
44
//! TCP socket, wrapped in mountain-mqtt's [`ConnectionEmbedded`] so the MQTT
@@ -10,8 +10,8 @@
1010
//! The session loop ([`handle_messages`], [`State`], [`ChannelEventHandler`])
1111
//! is a port of mountain-mqtt-embassy's private equivalents (MIT OR
1212
//! Apache-2.0): upstream `run()` constructs a bare `TcpSocket` internally and
13-
//! offers no seam for a TLS session (design 044 D6). Keep the loop in sync
14-
//! with the fork when bumping it.
13+
//! offers no seam for a TLS session. Keep the loop in sync with the fork when
14+
//! bumping it.
1515
1616
use alloc::string::String;
1717
use alloc::vec::Vec;
@@ -53,7 +53,7 @@ use crate::sntp::{self, SntpClock};
5353
/// covers RSA-4096 leaves with headroom.
5454
const CERT_BUFFER_SIZE: usize = 4096;
5555

56-
/// TLS materials for a `mqtts://` broker connection (design 044 §4).
56+
/// TLS materials for a `mqtts://` broker connection.
5757
///
5858
/// All references are `'static`: the session outlives `build()`, so buffers
5959
/// and the RNG live in `StaticCell`s (or equivalents) owned by the
@@ -155,10 +155,10 @@ impl embedded_io_async::Write for SharedTcp<'_, '_> {
155155
/// undecrypted bytes on the wire (`can_recv` on the shared socket). Checking
156156
/// both keeps coalesced packets flowing promptly.
157157
///
158-
/// Known limitation (documented in design 044): wire bytes that decrypt to
159-
/// *no* application data (unsolicited session tickets, KeyUpdate) make
160-
/// `receive` wait for the next real record; if the broker stays silent, the
161-
/// keep-alive lapse tears the session down and the manager reconnects.
158+
/// Known limitation: wire bytes that decrypt to *no* application data
159+
/// (unsolicited session tickets, KeyUpdate) make `receive` wait for the next
160+
/// real record; if the broker stays silent, the keep-alive lapse tears the
161+
/// session down and the manager reconnects.
162162
struct TlsSession<'r, 'a, 'b> {
163163
tls: TlsConnection<'b, SharedTcp<'r, 'a>, Aes128GcmSha256>,
164164
socket: SharedTcp<'r, 'a>,
@@ -204,7 +204,7 @@ impl Connection for TlsSession<'_, '_, '_> {
204204
/// [`CryptoProvider`] pairing the injected TRNG with `rustpki` certificate
205205
/// verification (time from [`SntpClock`]). Client-certificate signing is
206206
/// deliberately absent — the mesh authenticates with MQTT credentials
207-
/// (design 044 non-goals).
207+
/// instead.
208208
struct TrngProvider<'a> {
209209
rng: &'a mut dyn CryptoRngCore,
210210
verifier: CertVerifier<'static, Aes128GcmSha256, SntpClock, CERT_BUFFER_SIZE>,
@@ -227,7 +227,7 @@ impl CryptoProvider for TrngProvider<'_> {
227227
/// The TLS broker manager: resolve → TCP → TLS handshake → MQTT session,
228228
/// reconnecting forever with the same [`Settings`] cadence as the plain
229229
/// path's `mqtt_manager::run` (`settings.address` is unused — the TLS path
230-
/// resolves `host` per attempt, design 044 D7).
230+
/// resolves `host` per attempt instead).
231231
#[allow(clippy::too_many_arguments)]
232232
pub(crate) async fn run_tls(
233233
stack: Stack<'static>,
@@ -255,7 +255,7 @@ pub(crate) async fn run_tls(
255255

256256
loop {
257257
// Certificate validity needs real time — hold the first handshake
258-
// until SNTP has synced (design 044 D5).
258+
// until SNTP has synced.
259259
if sntp::unix_now().is_none() {
260260
#[cfg(feature = "defmt")]
261261
defmt::info!("MQTT-TLS: waiting for SNTP time sync...");

aimdb-mqtt-connector/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//! - `tokio-runtime`: Tokio-based connector using `rumqttc`
1010
//! - `embassy-runtime`: Embassy connector for embedded systems using `mountain-mqtt`
1111
//! - `embassy-tls`: TLS (`mqtts://`), broker authentication, DNS, and the
12-
//! SNTP time source for the Embassy connector (design 044)
12+
//! SNTP time source for the Embassy connector
1313
//! - `tracing`: Debug logging support (std)
1414
//! - `defmt`: Debug logging support (no_std)
1515
//!
@@ -110,7 +110,7 @@ pub mod embassy_client;
110110
#[cfg_attr(not(feature = "embassy-tls"), allow(dead_code))]
111111
pub(crate) mod sntp_codec;
112112

113-
// TLS transport + SNTP time source for the Embassy client (design 044)
113+
// TLS transport + SNTP time source for the Embassy client
114114
#[cfg(feature = "embassy-tls")]
115115
pub mod embassy_tls;
116116
#[cfg(feature = "embassy-tls")]

aimdb-mqtt-connector/src/sntp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//! SNTP time source for TLS certificate validation (design 044 §6).
1+
//! SNTP time source for TLS certificate validation.
22
//!
33
//! The reference boards have no battery-backed RTC, but checking a
44
//! certificate's validity window needs the current Unix time. This module
55
//! keeps one crate-global clock: Unix seconds at the `embassy_time` epoch
66
//! (boot), written after each SNTP sync and read through [`unix_now`] /
77
//! [`SntpClock`]. The TLS manager spawns [`run`] alongside its broker loop
8-
//! and holds the first handshake until the first sync lands (design 044 D5).
8+
//! and holds the first handshake until the first sync lands.
99
1010
use core::sync::atomic::{AtomicU32, Ordering};
1111

0 commit comments

Comments
 (0)