From 627a10f0accdca652948ba09b6540716d7d7d336 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Wed, 14 Dec 2022 14:43:38 +0700 Subject: [PATCH] Add mqtt messages to the docs --- src/mqtt/mod.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/mqtt/mod.rs b/src/mqtt/mod.rs index 3ed26a8..a56038a 100644 --- a/src/mqtt/mod.rs +++ b/src/mqtt/mod.rs @@ -4,6 +4,28 @@ use log::*; /// /// Handles incoming and outgoing MQTT messages /// +/// This acts as a bridge between cameras and MQTT servers +/// +/// Messages are prefixed with `neolink/{CAMERANAME}` +/// +/// Control messages: +/// +/// - `/control/led [on|off]` Turns status LED on/off +/// - `/control/ir [on|off|auti]` Turn IR lights on/off or automatically via light detection +/// - `/control/reboot` Reboot the camera +/// - `/control/ptz` [up|down|left|right|in|out] (amount) Control the PTZ movements, amount defaults to 32.0 +/// +/// Status Messages: +/// +/// `/status offline` Sent when the neolink goes offline this is a LastWill message +/// `/status disconnected` Sent when the camera goes offline +/// `/status/battery` Sent in reply to a `/query/battery` +/// +/// Query Messages: +/// +/// `/query/battery` Request that the camera reports its battery level (Not Yet Implemented) +/// +/// /// # Usage /// /// ```bash @@ -24,8 +46,8 @@ use log::*; // credentials = ["username", "password"] // ``` // -// `server` is the mqtt server that messages will be sent to -// `port` is the server's mqtt port +// `server` is the mqtt server +// `port` is the mqtt server's port // `credentials` are the username and password required to identify with the mqtt server // use std::sync::Arc;