Smdn.Net.EchonetLite.Primitives 2.0.0-preview1

Prefix Reserved
This is a prerelease version of Smdn.Net.EchonetLite.Primitives.
dotnet add package Smdn.Net.EchonetLite.Primitives --version 2.0.0-preview1                
NuGet\Install-Package Smdn.Net.EchonetLite.Primitives -Version 2.0.0-preview1                
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="Smdn.Net.EchonetLite.Primitives" Version="2.0.0-preview1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smdn.Net.EchonetLite.Primitives --version 2.0.0-preview1                
#r "nuget: Smdn.Net.EchonetLite.Primitives, 2.0.0-preview1"                
#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.
// Install Smdn.Net.EchonetLite.Primitives as a Cake Addin
#addin nuget:?package=Smdn.Net.EchonetLite.Primitives&version=2.0.0-preview1&prerelease

// Install Smdn.Net.EchonetLite.Primitives as a Cake Tool
#tool nuget:?package=Smdn.Net.EchonetLite.Primitives&version=2.0.0-preview1&prerelease                

Smdn.Net.EchonetLite.Primitives 2.0.0-preview1

Provides common types and abstractions for Smdn.Net.EchonetLite.*. Also provides the APIs based on the specifications described in the "ECHONET Lite SPECIFICATION II ECHONET Lite Communication Middleware Specifications". Including APIs such as IEchonetLiteHandler, which is the interface for implementing the communication endpoint to the "Lower Communication Layers".

Smdn.Net.EchonetLite.*で共通して使用される型と抽象化機能を提供します。 また「ECHONET Lite SPECIFICATION 第2部 ECHONET Lite 通信ミドルウェア仕様」に記載されている「下位通信層」との通信エンドポイントを実装するための抽象インターフェースIEchonetLiteHandlerなどのAPIも提供します。

Contributing

This project welcomes contributions, feedbacks and suggestions. You can contribute to this project by submitting Issues or Pull Requests on the GitHub repository.

API List

List of APIs exposed by assembly Smdn.Net.EchonetLite.Primitives-2.0.0-preview1 (net8.0)

// Smdn.Net.EchonetLite.Primitives.dll (Smdn.Net.EchonetLite.Primitives-2.0.0-preview1)
//   Name: Smdn.Net.EchonetLite.Primitives
//   AssemblyVersion: 2.0.0.0
//   InformationalVersion: 2.0.0-preview1+a49cbd05bcf92f5f6205892f53982b36f3d6b0e2
//   TargetFramework: .NETCoreApp,Version=v8.0
//   Configuration: Release
//   Referenced assemblies:
//     System.ComponentModel.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Memory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
//     System.Net.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
//     System.Threading, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
#nullable enable annotations

using System;
using System.Buffers;
using System.Collections.Generic;
using System.ComponentModel;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Smdn.Net.EchonetLite;

namespace Smdn.Net.EchonetLite {
  public interface IEchonetLiteHandler {
    event EventHandler<(IPAddress Address, ReadOnlyMemory<byte> Data)> Received;

    ISynchronizeInvoke? SynchronizingObject { get; set; }

    ValueTask SendAsync(IPAddress? address, ReadOnlyMemory<byte> data, CancellationToken cancellationToken);
  }

  public interface IEchonetObjectSpecification {
    byte ClassCode { get; }
    byte ClassGroupCode { get; }
    IEnumerable<IEchonetPropertySpecification> Properties { get; }
  }

  public interface IEchonetPropertySpecification {
    bool CanAnnounceStatusChange { get; }
    bool CanGet { get; }
    bool CanSet { get; }
    byte Code { get; }

    bool IsAcceptableValue(ReadOnlySpan<byte> edt);
  }
}

namespace Smdn.Net.EchonetLite.Transport {
  public abstract class EchonetLiteHandler :
    IAsyncDisposable,
    IDisposable,
    IEchonetLiteHandler
  {
    public event EventHandler<(IPAddress, ReadOnlyMemory<byte>)> Received { add; remove; }

    protected EchonetLiteHandler() {}

    protected bool IsDisposed { get; }
    protected bool IsReceiving { get; }
    public abstract IPAddress? LocalAddress { get; }
    public abstract ISynchronizeInvoke? SynchronizingObject { get; set; }

    protected virtual void Dispose(bool disposing) {}
    public void Dispose() {}
    public async ValueTask DisposeAsync() {}
    protected virtual async ValueTask DisposeAsyncCore() {}
    protected abstract ValueTask<IPAddress> ReceiveAsyncCore(IBufferWriter<byte> buffer, CancellationToken cancellationToken);
    public async ValueTask SendAsync(IPAddress? address, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) {}
    protected abstract ValueTask SendAsyncCore(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken);
    protected abstract ValueTask SendToAsyncCore(IPAddress remoteAddress, ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken);
    protected void StartReceiving() {}
    protected async ValueTask StopReceivingAsync() {}
    protected virtual void ThrowIfDisposed() {}
    protected void ThrowIfReceiving() {}
  }
}
// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.4.1.0.
// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.1.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Smdn.Net.EchonetLite.Primitives:

Package Downloads
Smdn.Net.EchonetLite

Provides the implementation based on the specifications described in the "ECHONET Lite SPECIFICATION II ECHONET Lite Communication Middleware Specifications". Including APIs such as `EchonetClient`, which is an implementation corresponding to the "Communication Middleware" in the specification. 「ECHONET Lite SPECIFICATION 第2部 ECHONET Lite 通信ミドルウェア仕様」に記載されている仕様に基づく実装を提供します。 同仕様書における「通信ミドルウェア」に相当する`EchonetClient`などのAPIを提供します。

Smdn.Net.EchonetLite.RouteB.Primitives

Provides common types and abstractions for `Smdn.Net.EchonetLite.RouteB.*`. Provides a transport layer abstraction class `RouteBEchonetLiteHandler` to handle ECHONET Lite communication via the **route-B**, the communication path for communicating information with smart electricity meters. Also provides an abstract interface `IRouteBCredential` to handle credentials used in B-route communication path. `Smdn.Net.EchonetLite.RouteB.*`で共通して使用される型と抽象化機能を提供します。 スマート電力量メータとの情報伝達手段である「Bルート」を介してECHONET Lite規格の通信を扱うためのトランスポート層抽象クラス`RouteBEchonetLiteHandler`を提供します。 また、その際に使用される認証情報を扱うための抽象インターフェイス`IRouteBCredential`を提供します。

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0-preview1 92 10/16/2024