NetStick API / Networked Joystick

I have working, on LinuxPCRobot.org, a networked joystick system composed of a "joysender" and a "joyclient" class.

Communication, currently, is from the sender to the client. The sender sends packets to the client. If no joystick event is available, a "keepalive" event is sent.

The client code is C++, and events are handled via virtual member functions.

The client class has a configurable 0.2 seconds in which it must receive some signal from the sender. The sender won't wait any more than 0.1 seconds without sending information. (These are probably a bit too aggressive) If the time out elapses, there is a user overloadable HandleDeadman(...) function that gets called for proper emergency shut down.

The packets sent across the network contain a time, an event id, value index, and value. In the case of a joystick, the event is AXIS or BUTTON, the value index is which button or axis, the value is, obviously the value. The joysender program also will send keystrokes to the joyclient application via a KEY event.

There are two interfaces, Poll and Loop. A Poll interface relies that you call Poll frequently. Loop probably requires an external thread.

If anyone is interested in this code, it is on my site:

formatting link

Reply to
mlw
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.