Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genielabs/serialport-lib-dotnet
Serial Port libray for .Net / Mono
https://github.com/genielabs/serialport-lib-dotnet
dotnet serialport
Last synced: about 11 hours ago
JSON representation
Serial Port libray for .Net / Mono
- Host: GitHub
- URL: https://github.com/genielabs/serialport-lib-dotnet
- Owner: genielabs
- License: apache-2.0
- Created: 2015-08-16T15:27:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-16T17:29:43.000Z (8 months ago)
- Last Synced: 2024-11-08T19:48:26.490Z (8 days ago)
- Topics: dotnet, serialport
- Language: C#
- Homepage: https://www.nuget.org/packages/SerialPortLib/
- Size: 108 KB
- Stars: 156
- Watchers: 19
- Forks: 65
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![Build status](https://ci.appveyor.com/api/projects/status/r9fcyt98fjmygwu6?svg=true)](https://ci.appveyor.com/project/genemars/serialport-lib-dotnet)
[![NuGet](https://img.shields.io/nuget/v/SerialPortLib.svg)](https://www.nuget.org/packages/SerialPortLib/)
![License](https://img.shields.io/github/license/genielabs/serialport-lib-dotnet.svg)# Serial Port library for .Net
## Features
- Easy to use
- Event driven
- Hot plug
- Automatically restabilish connection on error/disconnect
- Compatible with Mono
- It overcomes the lack of *DataReceived* event in Mono## NuGet Package
SerialPortLib is available as a [NuGet package](https://www.nuget.org/packages/SerialPortLib).
Run `Install-Package SerialPortLib` in the [Package Manager Console](http://docs.nuget.org/docs/start-here/using-the-package-manager-console) or search for “SerialPortLib” in your IDE’s package management plug-in.
## Example usage
```csharp
using SerialPortLib;
...
var serialPort = new SerialPortInput();// Listen to Serial Port events
serialPort.ConnectionStatusChanged += delegate(object sender, ConnectionStatusChangedEventArgs args)
{
Console.WriteLine("Connected = {0}", args.Connected);
};serialPort.MessageReceived += delegate(object sender, MessageReceivedEventArgs args)
{
Console.WriteLine("Received message: {0}", BitConverter.ToString(args.Data));
};// Set port options
serialPort.SetPort("/dev/ttyUSB0", 115200);// Connect the serial port
serialPort.Connect();// Send a message
var message = System.Text.Encoding.UTF8.GetBytes("Hello World!");
serialPort.SendMessage(message);
```## License
SerialPortLib is open source software, licensed under the terms of Apache License 2.0. See the [LICENSE](LICENSE) file for details.
## Who's using this library?
- [HomeGenie Server](http://github.com/genielabs/HomeGenie): smart home automation server
- [ZWaveLib](https://github.com/genielabs/zwave-lib-dotnet): z-wave home automation library for .net/mono