From: Krzysztof Wicher Date: Wed, 6 Sep 2023 07:27:14 +0000 (+0200) Subject: Add System.IO.Ports X-Git-Tag: accepted/tizen/unified/riscv/20231226.055536~97^2^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=795122ab786eb3075a8d114e694890581e18c452;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Add System.IO.Ports --- diff --git a/src/libraries/System.IO.Ports/src/PACKAGE.md b/src/libraries/System.IO.Ports/src/PACKAGE.md index 2709a6e..b450bd4 100644 --- a/src/libraries/System.IO.Ports/src/PACKAGE.md +++ b/src/libraries/System.IO.Ports/src/PACKAGE.md @@ -1,44 +1,58 @@ ## About - - +[System.IO.Ports](https://www.nuget.org/packages/System.IO.Ports) package provides synchronous serial port file resource. Additionally, the functionality of this class can be wrapped in an internal `Stream` object, accessible through the `BaseStream` property, and passed to classes that wrap or use streams. ## Key Features -* -* -* +* synchronous and event-driven I/O +* access to pin and break states +* access to serial driver properties +* access to `Stream` object through the `BaseStream` property ## How to Use +```C# +using System.IO.Ports; + +// Provides list of available serial ports +string[] portNames = SerialPort.GetPortNames(); + +// First available port +string myPortName = portNames[0]; +int baudRate = 9600; + +SerialPort sp = new SerialPort(myPortName, baudRate); +sp.Open(); +sp.WriteLine("Hello World!"); +``` + ## Main Types -The main types provided by this library are: +The main type provided by this library is: -* `` -* `` -* `` +* `SerialPort` ## Additional Documentation -* [Conceptual documentation](https://learn.microsoft.com/en-us/dotnet/standard/serialization/**LIBRARYNAME**/overview) -* [API documentation](https://learn.microsoft.com/en-us/dotnet/api/**LIBRARYNAME**) +* [SerialPort class documentation](https://learn.microsoft.com/en-us/dotnet/api/system.io.ports.serialport?view=dotnet-plat-ext-7.0) +* [API documentation](https://learn.microsoft.com/en-us/dotnet/api/System.IO.Ports) ## Related Packages +- [System.IO.Ports](https://www.nuget.org/packages/System.IO.Ports) ## Feedback & Contributing -**LIBRARY NAME** is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime). \ No newline at end of file +**System.IO.Ports** is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/runtime).