Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/touseefelahi/stira.serial
- Owner: Touseefelahi
- Created: 2020-08-19T14:43:28.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T11:46:54.000Z (over 3 years ago)
- Last Synced: 2024-12-01T22:48:04.977Z (about 1 month ago)
- Language: C#
- Size: 22.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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);
}