From 45475cb89db8750f5b212c451e37da0d8c96ae9c Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Tue, 23 Feb 2021 22:31:31 +0100 Subject: [PATCH] UdpProto: fixed data offset --- src/udpproto.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/udpproto.rs b/src/udpproto.rs index f69f17d..0b32478 100644 --- a/src/udpproto.rs +++ b/src/udpproto.rs @@ -43,10 +43,10 @@ impl UdpProto return Ok( () ); } - self.packet_offset = 0; - self.socket.send(&self.packet[0..self.packet_offset])?; + self.packet_offset = 0; + Ok( () ) } @@ -58,7 +58,7 @@ impl UdpProto self.packet[self.packet_offset + 2] = led; for i in 0 .. data.len() { - self.packet[self.packet_offset + i] = data[i]; + self.packet[self.packet_offset + i + 3] = data[i]; } self.packet_offset += 7;