UdpProto: fixed data offset
This commit is contained in:
parent
5da4548e25
commit
45475cb89d
|
@ -43,10 +43,10 @@ impl UdpProto
|
||||||
return Ok( () );
|
return Ok( () );
|
||||||
}
|
}
|
||||||
|
|
||||||
self.packet_offset = 0;
|
|
||||||
|
|
||||||
self.socket.send(&self.packet[0..self.packet_offset])?;
|
self.socket.send(&self.packet[0..self.packet_offset])?;
|
||||||
|
|
||||||
|
self.packet_offset = 0;
|
||||||
|
|
||||||
Ok( () )
|
Ok( () )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ impl UdpProto
|
||||||
self.packet[self.packet_offset + 2] = led;
|
self.packet[self.packet_offset + 2] = led;
|
||||||
|
|
||||||
for i in 0 .. data.len() {
|
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;
|
self.packet_offset += 7;
|
||||||
|
|
Loading…
Reference in a new issue