Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/touseefelahi/stira.serial

This is simple implementation of Serial Protocol with some features like Start Header and End Header.
https://github.com/touseefelahi/stira.serial

Last synced: 13 days ago
JSON representation

This is simple implementation of Serial Protocol with some features like Start Header and End Header.

Awesome Lists containing this project

README

        

## How to use

private readonly SerialCom serialCom;

///
/// Initializes the baudrate list and serial port
///
public ClassThatWantToUseSerial()
{
serialCom = new SerialCom();
serialCom.SetStartPacketID(new byte[] { 0xFF, 0x02 });
serialCom.SetEndPacketID(new byte[] { 0x03 });
serialCom.BytesThresholdForRxPush = 15; //This can be min packet size
serialCom.DataReady += InclinoDataReady;
serialCom.Open("COM1", 9600);
var lastError = serialCom.LastError;//Check last error for any errors
}

private void InclinoDataReady(object sender, byte[] tempBuffer)
{
//Data starting from 0xFF 0x22 and ending on 0x03
}

public bool Write(byte[] value)
{
return serialCom.Write(value);
}