pub struct Header {
pub packet_type: PacketType,
pub sequence_number: u8,
pub pixel_config: PixelConfig,
pub id: ID,
pub offset: u32,
pub length: u16,
pub time_code: TimeCode,
}Expand description
DDP packet header containing metadata and control flags.
The header is 10 bytes (or 14 with timecode) and contains all the information needed to interpret the packet payload.
§Examples
use ddp_rs::protocol::{Header, PacketType, PixelConfig, ID, timecode::TimeCode};
let header = Header {
packet_type: PacketType::default(),
sequence_number: 1,
pixel_config: PixelConfig::default(),
id: ID::Default,
offset: 0,
length: 9,
time_code: TimeCode(None),
};
// Convert to bytes for transmission
let bytes: [u8; 10] = header.into();Fields§
§packet_type: PacketTypePacket type flags (version, timecode, storage, reply, query, push)
sequence_number: u8Sequence number (1-15, wraps around to 1)
pixel_config: PixelConfigPixel format configuration (RGB, RGBW, etc.)
id: IDProtocol message ID
offset: u32Byte offset into the display buffer
length: u16Length of data in this packet (in bytes)
time_code: TimeCodeOptional timecode for synchronization (if timecode flag is set)
Trait Implementations§
impl Copy for Header
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more