This is a fork of the KSPSerialIO plugin for Kerbal Space Program. KSPSerialIO provides a serial interface for KSP. This fork of the plugin replaces the underlying serial library and provides support for Linux and Mac OS.
This version is compatible with version 0.18.7 of zitronen's KSPSerialIO, and
their KSPIODemo16
example sketch. Refer to the forum thread for current
packet format and the demo code.
This fork replaces the old serial library with PsiMax Serial library.
The original plugin fails because the Mono runtime in KSP doesn't call the
DataReceived
callback. Mulbin's KSPSerialIO fork
works around this by polling the serial port for data in the Unity
Update
event.
This fork replaces that mechanism with an asynchronous serial reader running in a separate thread. It should be more reliable and less laggy.
- This plugin doesn't (yet) function on Windows 10. Previous Windows releases are untested.
- Automatic port detection. You'll need to explicitly set a serial port
in the
config.xml
.
- Everything else, as far as I'm aware.
- Check if the port is open before trying to start reading, instead of just catching the exception. The delay in the exception handler is at least part of the reason this isn't working on Windows 10.
- Clean up the stream handler and thread in OnDestroy, to make sure we're not leaving uncollected garbage lying around.
Like the original plugin, this code is licensed under CC-BY.