ddp_rs/
lib.rs

1//! # Distributed Display Protocol (DDP) in Rust
2//!
3//! This crate allows you to write pixel data to LED strips over the
4//! [Distributed Display Protocol (DDP)](http://www.3waylabs.com/ddp/) by 3waylabs.
5//!
6//! You can use this to stream pixel data to [WLED](https://github.com/Aircoookie/WLED)
7//! or any other DDP-capable receiver.
8//!
9//! ## Quick Start
10//!
11//! ```no_run
12//! use ddp_rs::connection::DDPConnection;
13//! use ddp_rs::protocol::{PixelConfig, ID};
14//! use std::net::UdpSocket;
15//!
16//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
17//! // Create a connection to your LED controller
18//! let mut conn = DDPConnection::try_new(
19//!     "192.168.1.40:4048",              // Device IP and DDP port
20//!     PixelConfig::default(),            // RGB, 8 bits per channel
21//!     ID::Default,                       // Default ID
22//!     UdpSocket::bind("0.0.0.0:6969")?  // Local socket
23//! )?;
24//!
25//! // Send RGB pixel data (2 pixels: red and blue)
26//! conn.write(&[
27//!     255, 0, 0,    // First pixel: Red
28//!     0, 0, 255,    // Second pixel: Blue
29//! ])?;
30//! # Ok(())
31//! # }
32//! ```
33//!
34//!
35//! ## Modules
36//!
37//! - [`connection`] - Main connection type for sending pixel data
38//! - [`protocol`] - DDP protocol types and structures
39//! - [`packet`] - Packet parsing for receiving data from displays
40//! - [`error`] - Error types used throughout the crate
41//!
42//! 
43pub mod connection;
44pub mod error;
45pub mod packet;
46pub mod protocol;
47
48#[cfg(test)]
49mod testing;