Expose generated modules and add some top-level docs

This commit is contained in:
Wesley Moore 2024-01-17 21:59:22 +10:00
parent 5e53e48156
commit 87772ea0a5
No known key found for this signature in database

View file

@ -1 +1,27 @@
//! The Home Assistant protocol is structured as a simple
//! TCP socket with short binary messages encoded in the protocol buffers format.
//! First, a message in this protocol has a specific format:
//!
//! * A zero byte.
//! * VarInt denoting the size of the message object. (type is not part of this)
//! * VarInt denoting the type of message.
//! * The message object encoded as a ProtoBuf message
//!
//! The connection is established in 4 steps:
//!
//! * First, the client connects to the server and sends a [Hello Request](api::HelloRequest)
//! identifying itself
//! * The server responds with a [Hello Response](api::HelloResponse) and selects the
//! protocol version
//! * After receiving this message, the client attempts to authenticate itself using
//! the password and a [Connect Request](api::ConnectRequest)
//! * The server responds with a [Connect Response](api::ConnectResponse) and notifies
//! of invalid password if necessary.
//!
//! If anything in this initial process fails, the connection must immediately closed
//! by both sides and _no_ disconnection message is to be sent.
mod generated;
pub use generated::api;
pub use generated::api_options;