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

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', x_coor, y_coor)
packet = struct.pack('<HH', (float(x_coor)/32767.0)*1920, (float(y_coor)/32767.0)*1080)
# Send the packet over UDP
sock.sendto(packet, (dest_ip, dest_port))