🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

Smdn.Net.EchonetLite.Primitives

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Smdn.Net.EchonetLite.Primitives

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も提供します。

2.0.0
NuGet
Version published
Maintainers
1
Created
Source

Smdn.Net.EchonetLite.Primitives 2.0.0

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 (net8.0)

// Smdn.Net.EchonetLite.Primitives.dll (Smdn.Net.EchonetLite.Primitives-2.0.0)
//   Name: Smdn.Net.EchonetLite.Primitives
//   AssemblyVersion: 2.0.0.0
//   InformationalVersion: 2.0.0+e711220aebaba7dfe17051eed5e6dd8890ffd4d1
//   TargetFramework: .NETCoreApp,Version=v8.0
//   Configuration: Release
//   Referenced assemblies:
//     Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
//     System.ComponentModel, 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
#nullable enable annotations

using System;
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Smdn.Net.EchonetLite;

namespace Smdn.Net.EchonetLite {
  public interface IEchonetLiteHandler {
    Func<IPAddress, ReadOnlyMemory<byte>, CancellationToken, ValueTask>? ReceiveCallback { get; set; }

    ValueTask SendAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken);
    ValueTask SendToAsync(IPAddress remoteAddress, 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
  {
    protected class ReceivedFromUnknownAddressException : InvalidOperationException {
      public ReceivedFromUnknownAddressException() {}
      public ReceivedFromUnknownAddressException(string message) {}
      public ReceivedFromUnknownAddressException(string message, Exception? innerException) {}
    }

    public const int DefaultPort = 3610;

    protected EchonetLiteHandler(ILogger? logger, IServiceProvider? serviceProvider) {}

    protected bool IsDisposed { get; }
    [MemberNotNullWhen(true, "taskReceiveEchonetLite")]
    protected bool IsReceiving { [MemberNotNullWhen(true, "taskReceiveEchonetLite")] get; }
    public abstract IPAddress? LocalAddress { get; }
    protected ILogger? Logger { get; }
    public Func<IPAddress, ReadOnlyMemory<byte>, CancellationToken, ValueTask>? ReceiveCallback { get; set; }

    protected virtual void Dispose(bool disposing) {}
    public void Dispose() {}
    public async ValueTask DisposeAsync() {}
    protected virtual async ValueTask DisposeAsyncCore() {}
    protected virtual bool HandleReceiveTaskException(Exception exception) {}
    protected abstract ValueTask<IPAddress> ReceiveAsyncCore(IBufferWriter<byte> buffer, CancellationToken cancellationToken);
    public ValueTask SendAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken) {}
    protected abstract ValueTask SendAsyncCore(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken);
    public ValueTask SendToAsync(IPAddress remoteAddress, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) {}
    protected abstract ValueTask SendToAsyncCore(IPAddress remoteAddress, ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken);
    protected void StartReceiving() {}
    protected void StartReceiving(TaskFactory? taskFactoryForReceiving) {}
    protected async ValueTask StopReceivingAsync() {}
    protected virtual void ThrowIfDisposed() {}
    [MemberNotNull("taskReceiveEchonetLite")]
    protected void ThrowIfNotReceiving() {}
    protected void ThrowIfReceiving() {}
  }
}
// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.5.0.0.
// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.3.1.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating)

Keywords

smdn.jp

FAQs

Package last updated on 11 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts