This commit is contained in:
0m.ax 2025-07-20 02:20:12 +02:00
parent 3fb557dd4a
commit c092d631b2

View file

@ -52,7 +52,7 @@ def main(device_path, dest_ip, dest_port):
# The format string 'HH' specifies two unsigned short integers (u16).
# The '<' character ensures little-endian byte order.
try:
packet = struct.pack('<HH', (float(x_coor)/32767.0)*1920, (float(y_coor)/32767.0)*1080)
packet = struct.pack('<HH', int((float(x_coor)/32767.0)*1920), int((float(y_coor)/32767.0)*1080))
# Send the packet over UDP
sock.sendto(packet, (dest_ip, dest_port))