OpenBuffet.Seriport.Core
1.0.0
The owner has unlisted this package.
This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package OpenBuffet.Seriport.Core --version 1.0.0
NuGet\Install-Package OpenBuffet.Seriport.Core -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenBuffet.Seriport.Core" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenBuffet.Seriport.Core" Version="1.0.0" />
<PackageReference Include="OpenBuffet.Seriport.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenBuffet.Seriport.Core --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenBuffet.Seriport.Core, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenBuffet.Seriport.Core@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenBuffet.Seriport.Core&version=1.0.0
#tool nuget:?package=OpenBuffet.Seriport.Core&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Logger
______ __ __
/ \ | \ | \
| $$$$$$\ ______ ______ \$$ ______ ______ ______ _| $$_
| $$___\$$ / \ / \ | \ / \ / \ / \| $$ \
\$$ \ | $$$$$$\| $$$$$$\| $$| $$$$$$\| $$$$$$\| $$$$$$\\$$$$$$
_\$$$$$$\| $$ $$| $$ \$$| $$| $$ | $$| $$ | $$| $$ \$$ | $$ __
| \__| $$| $$$$$$$$| $$ | $$| $$__/ $$| $$__/ $$| $$ | $$| \
\$$ $$ \$$ \| $$ | $$| $$ $$ \$$ $$| $$ \$$ $$
\$$$$$$ \$$$$$$$ \$$ \$$| $$$$$$$ \$$$$$$ \$$ \$$$$
| $$
| $$
\$$
Description
This package ensure use seriport
Getting Started
Dependencies
- .NET Dependency Injection >=9.0.3
Installing
- Install Library with Package Manager script or on Nuget GUI.
Executing program
Usage
Exception exception;
IServiceProvider serviceProvider = new ServiceCollection()
.AddOpenBuffetSeriport(configuration => {
configuration.PortName = "COM1"; //set the your test port
configuration.Baudrate = 9600;
configuration.Databit = 8;
configuration.Paritybit = Parity.None;
configuration.Stopbit = StopBits.One;
configuration.ReceiveBufferSize = 1024;
configuration.TransferBufferSize = 1024;
configuration.ReceiveTimeout = 1000;
configuration.TransferTimeout = 1000;
})
.BuildServiceProvider();
//act
ISeriportService seriportService = serviceProvider.GetService<ISeriportService>();
seriportService.ErrorReceivedEvent += ((sender, e) => {
Console.WriteLine(e.ToString());
Console.ReadKey();
Environment.Exit(0);
});
seriportService.DataReceivedEvent += ((sender, e) => {
string readedData = string.Empty;
int readedBytes = 0;
TimeSpan readedTime = TimeSpan.Zero;
if (!seriportService.TryReadSeriport(out readedData, out readedBytes, out readedTime, out exception)) {
Console.WriteLine(exception.Message);
Console.ReadKey();
Environment.Exit(0);
}
Console.WriteLine($"Readed Data : {readedData}\r\n");
Console.WriteLine($"Readed Bytes : {readedBytes}\r\n");
Console.WriteLine($"Readed Time : {readedTime}\r\n");
int sendedBytes = 0;
TimeSpan sendedTime = TimeSpan.Zero;
if (!seriportService.TryWriteSeriport(readedData, out sendedBytes, out sendedTime, out exception)) {
Console.WriteLine(exception.Message);
Console.ReadKey();
Environment.Exit(0);
}
Console.WriteLine($"Sended Data : {readedData}\r\n");
Console.WriteLine($"Sended Bytes : {sendedBytes}\r\n");
Console.WriteLine($"Sended Time : {sendedTime}\r\n");
});
if (!seriportService.TryOpenSeriport(out exception)) {
Console.WriteLine(exception.Message);
Console.ReadKey();
Environment.Exit(0);
}
bool connectionState = false;
if (!seriportService.TryGetSeriPortState(out connectionState, out exception)) {
Console.WriteLine(exception.Message);
Console.ReadKey();
Environment.Exit(0);
}
Console.WriteLine($"Connected To : {seriportService.GetSeriportConfiguration.PortName}");
while (true) { Thread.Sleep(1000); }
Authors
Ferdi Kurnaz Contact
Version History
- 0.0
- initial nuget package release
License
This project is licensed under the [MIT] License
Notes:
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.3)
- System.IO.Ports (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|
first release