Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

xSerial

Serial communication for Haxe / C++

This is a quick library for serial communication in Haxe. It only works with the C++ target and Windows (for now). But i might add support for Linux / Mac also.

It is based upon hxSerial from Andy Li : https://github.com/andyli/hxSerial.

However it does not need any dll or external dependencies to work.

Its still a bit ugly work-in-progress and hopefully will be be somewhat improved!

To use:

varserial=newSerial("COM8", 9600);
if (serial.isSetup)
{
if (serial.available() >0)
{
vardata:String=serial.readBytes(serial.available());
serial.flush();
}
}

Methods available

readBytes(length:Int):String;
readByte():Null<Int>;
writeBytes(length:Int,data:String):Bool;
writeByte(data:Int):Bool;
available():Int;
flush(?flushIn:Bool, ?flushOut);
staticenumerateDevices():Array<ComDevice>;

Info

Only tested on Windows 10, Haxe 4.0.5

About

Serial communication for Haxe / C++

Resources

Stars

7 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages