UdpProto: fixed data offset

This commit is contained in:
Thomas Kolb 2021-02-23 22:31:31 +01:00
parent 5da4548e25
commit 45475cb89d
1 changed files with 3 additions and 3 deletions

View File

@ -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;