UDP communication protocol -------------------------- Clients "connect" by sending any UDP packet to port 4791. The packet need not contain a valid command. Once connected, the server will send status packets. The connection remains active for 60 seconds, and any UDP packet to port 4791 renews the 60 second timeout. The status packets are transmitted at a regular rate, typically 50 per second. The format of the status packet is: bytes 0 to 31: current motor position, 0 to 95 bytes 32 to 63: current motor status, 0=motor disabled, 1=motor enabled bytes 64 to 69: current sonar reading, 0 to 223, distance in half inches Additional bytes may be added with more status information, so code should be designed to handle larger packets and ignore the extra data The UDP packets sent to the server may contain a command. Enable Motor: byte 0: 0x7A byte 1: motor number, 0 to 31 Disable Motor: byte 0: 0x19 byte 1: motor number, 0 to 31 Set Speed: byte 0: 0x45 byte 1: motor number, 0 to 31 byte 2: speed, -63 to +63 (signed char) Set Motor Auto-Enable Timeout: byte 0: 0x6B byte 1: motor number, 0 to 31 byte 2: inactivity time, 1 to 255 seconds, 0=never auto enable Set LED: byte 0: 0x9C byte 1: board number, 0 to 7 byte 2: LED byte, 8 LEDs Set Position: (not implemented yet) Motors always disable automatically when a user touches the wheel. The auto-enable timeout should be used to reenable the motor after a period of inactivity (no motion from manual movement). The motor can also be enabled with an explict command. However, if a user is moving the wheel manually, it will auto-disable almost instantly. Speed set commands to disabled motors are ignored.