|
| 1 | +// Smdn.Net.EchonetLite.Primitives.dll (Smdn.Net.EchonetLite.Primitives-2.1.0) |
| 2 | +// Name: Smdn.Net.EchonetLite.Primitives |
| 3 | +// AssemblyVersion: 2.1.0.0 |
| 4 | +// InformationalVersion: 2.1.0+eceaa1ab8c33ec84da009bb0a40f14181fd5e97b |
| 5 | +// TargetFramework: .NETCoreApp,Version=v10.0 |
| 6 | +// Configuration: Release |
| 7 | +// Metadata: IsTrimmable=True |
| 8 | +// Metadata: RepositoryUrl=https://github.com/smdn/Smdn.Net.EchonetLite |
| 9 | +// Metadata: RepositoryBranch=main |
| 10 | +// Metadata: RepositoryCommit=eceaa1ab8c33ec84da009bb0a40f14181fd5e97b |
| 11 | +// Referenced assemblies: |
| 12 | +// Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60 |
| 13 | +// System.ComponentModel, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a |
| 14 | +// System.Memory, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 |
| 15 | +// System.Net.Primitives, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a |
| 16 | +// System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a |
| 17 | +#nullable enable annotations |
| 18 | + |
| 19 | +using System; |
| 20 | +using System.Buffers; |
| 21 | +using System.Collections.Generic; |
| 22 | +using System.Net; |
| 23 | +using System.Threading; |
| 24 | +using System.Threading.Tasks; |
| 25 | +using Microsoft.Extensions.Logging; |
| 26 | +using Smdn.Net.EchonetLite; |
| 27 | + |
| 28 | +namespace Smdn.Net.EchonetLite { |
| 29 | + public interface IEchonetLiteHandler { |
| 30 | + Func<IPAddress, ReadOnlyMemory<byte>, CancellationToken, ValueTask>? ReceiveCallback { get; set; } |
| 31 | + |
| 32 | + ValueTask SendAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken); |
| 33 | + ValueTask SendToAsync(IPAddress remoteAddress, ReadOnlyMemory<byte> data, CancellationToken cancellationToken); |
| 34 | + } |
| 35 | + |
| 36 | + public interface IEchonetObjectSpecification { |
| 37 | + byte ClassCode { get; } |
| 38 | + byte ClassGroupCode { get; } |
| 39 | + IEnumerable<IEchonetPropertySpecification> Properties { get; } |
| 40 | + } |
| 41 | + |
| 42 | + public interface IEchonetPropertySpecification { |
| 43 | + bool CanAnnounceStatusChange { get; } |
| 44 | + bool CanGet { get; } |
| 45 | + bool CanSet { get; } |
| 46 | + byte Code { get; } |
| 47 | + |
| 48 | + bool IsAcceptableValue(ReadOnlySpan<byte> edt); |
| 49 | + } |
| 50 | +} |
| 51 | + |
| 52 | +namespace Smdn.Net.EchonetLite.Transport { |
| 53 | + public abstract class EchonetLiteHandler : |
| 54 | + IAsyncDisposable, |
| 55 | + IDisposable, |
| 56 | + IEchonetLiteHandler |
| 57 | + { |
| 58 | + protected class ReceivedFromUnknownAddressException : InvalidOperationException { |
| 59 | + public ReceivedFromUnknownAddressException() {} |
| 60 | + public ReceivedFromUnknownAddressException(string message) {} |
| 61 | + public ReceivedFromUnknownAddressException(string message, Exception? innerException) {} |
| 62 | + } |
| 63 | + |
| 64 | + public const int DefaultPort = 3610; |
| 65 | + |
| 66 | + protected EchonetLiteHandler(ILogger? logger, IServiceProvider? serviceProvider) {} |
| 67 | + |
| 68 | + protected bool IsDisposed { get; } |
| 69 | + protected bool IsReceiving { get; } |
| 70 | + public abstract IPAddress? LocalAddress { get; } |
| 71 | + protected ILogger? Logger { get; } |
| 72 | + public Func<IPAddress, ReadOnlyMemory<byte>, CancellationToken, ValueTask>? ReceiveCallback { get; set; } |
| 73 | + |
| 74 | + protected virtual void Dispose(bool disposing) {} |
| 75 | + public void Dispose() {} |
| 76 | + public async ValueTask DisposeAsync() {} |
| 77 | + protected virtual async ValueTask DisposeAsyncCore() {} |
| 78 | + protected virtual bool HandleReceiveTaskException(Exception exception) {} |
| 79 | + protected abstract ValueTask<IPAddress> ReceiveAsyncCore(IBufferWriter<byte> buffer, CancellationToken cancellationToken); |
| 80 | + public ValueTask SendAsync(ReadOnlyMemory<byte> data, CancellationToken cancellationToken) {} |
| 81 | + protected abstract ValueTask SendAsyncCore(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken); |
| 82 | + public ValueTask SendToAsync(IPAddress remoteAddress, ReadOnlyMemory<byte> data, CancellationToken cancellationToken) {} |
| 83 | + protected abstract ValueTask SendToAsyncCore(IPAddress remoteAddress, ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken); |
| 84 | + protected void StartReceiving() {} |
| 85 | + protected void StartReceiving(TaskFactory? taskFactoryForReceiving) {} |
| 86 | + protected async ValueTask StopReceivingAsync() {} |
| 87 | + protected virtual void ThrowIfDisposed() {} |
| 88 | + protected void ThrowIfNotReceiving() {} |
| 89 | + protected void ThrowIfReceiving() {} |
| 90 | + } |
| 91 | +} |
| 92 | +// API list generated by Smdn.Reflection.ReverseGenerating.ListApi.MSBuild.Tasks v1.7.1.0. |
| 93 | +// Smdn.Reflection.ReverseGenerating.ListApi.Core v1.5.0.0 (https://github.com/smdn/Smdn.Reflection.ReverseGenerating) |
0 commit comments