Skip to content

Instantly share code, notes, and snippets.

@smdn
Created June 30, 2024 12:40
Show Gist options
  • Save smdn/2a2658204b2349b126e3df3ae40d9caa to your computer and use it in GitHub Desktop.
Save smdn/2a2658204b2349b126e3df3ae40d9caa to your computer and use it in GitHub Desktop.
Smdn.Net.SkStackIP 1.2.0 Release Notes
diff --git a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net6.0.apilist.cs b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net6.0.apilist.cs
index 953f626..908f8e6 100644
--- a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net6.0.apilist.cs
+++ b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net6.0.apilist.cs
@@ -1,469 +1,476 @@
-// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.1.0)
+// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.2.0)
// Name: Smdn.Net.SkStackIP
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+b1231cf0cca65506f3356620e16e3ecd4cb811c1
+// AssemblyVersion: 1.2.0.0
+// InformationalVersion: 1.2.0+0e506f4265dfd6eb80e5f98b4486e10a5cda9d99
// TargetFramework: .NETCoreApp,Version=v6.0
// Configuration: Release
// Referenced assemblies:
// Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
// Polly.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc
// Smdn.Fundamental.ControlPicture, Version=3.0.0.1, Culture=neutral
// Smdn.Fundamental.PrintableEncoding.Hexadecimal, Version=3.0.0.0, Culture=neutral
// System.Collections, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.ComponentModel.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// System.Linq, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Memory, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// System.Net.NetworkInformation, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Net.Primitives, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.ObjectModel, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Runtime.InteropServices, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Threading, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
#nullable enable annotations
using System;
using System.Buffers;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipelines;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Polly;
using Smdn.Net.SkStackIP;
using Smdn.Net.SkStackIP.Protocol;
namespace Smdn.Net.SkStackIP {
public enum SkStackERXUDPDataFormat : int {
Binary = 0,
HexAsciiText = 1,
}
public enum SkStackErrorCode : int {
ER01 = 1,
ER02 = 2,
ER03 = 3,
ER04 = 4,
ER05 = 5,
ER06 = 6,
ER07 = 7,
ER08 = 8,
ER09 = 9,
ER10 = 10,
Undefined = 0,
}
public enum SkStackEventNumber : byte {
ActiveScanCompleted = 34,
BeaconReceived = 32,
EchoRequestReceived = 5,
EnergyDetectScanCompleted = 31,
NeighborAdvertisementReceived = 2,
NeighborSolicitationReceived = 1,
PanaSessionEstablishmentCompleted = 37,
PanaSessionEstablishmentError = 36,
PanaSessionExpired = 41,
PanaSessionTerminationCompleted = 39,
PanaSessionTerminationRequestReceived = 38,
PanaSessionTerminationTimedOut = 40,
TransmissionTimeControlLimitationActivated = 50,
TransmissionTimeControlLimitationDeactivated = 51,
UdpSendCompleted = 33,
Undefined = 0,
WakeupSignalReceived = 192,
}
public enum SkStackResponseStatus : int {
Fail = -1,
Ok = 1,
Undetermined = 0,
}
public enum SkStackUdpEncryption : byte {
EncryptIfAble = 2,
ForceEncrypt = 1,
ForcePlainText = 0,
}
public enum SkStackUdpPortHandle : byte {
Handle1 = 1,
Handle2 = 2,
Handle3 = 3,
Handle4 = 4,
Handle5 = 5,
Handle6 = 6,
None = 0,
}
public abstract class SkStackActiveScanOptions : ICloneable {
public static SkStackActiveScanOptions Default { get; }
public static SkStackActiveScanOptions Null { get; }
public static SkStackActiveScanOptions ScanUntilFind { get; }
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, PhysicalAddress paaMacAddress) {}
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, Predicate<SkStackPanDescription>? paaSelector = null) {}
protected SkStackActiveScanOptions() {}
public abstract SkStackActiveScanOptions Clone();
object ICloneable.Clone() {}
}
public class SkStackClient : IDisposable {
public static readonly TimeSpan SKSCANDefaultDuration; // = "00:00:00.0480000"
public static readonly TimeSpan SKSCANMaxDuration; // = "00:02:37.2960000"
public static readonly TimeSpan SKSCANMinDuration; // = "00:00:00.0192000"
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionEstablished;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionExpired;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionTerminated;
public event EventHandler<SkStackEventArgs>? Slept;
public event EventHandler<SkStackEventArgs>? WokeUp;
public SkStackClient(PipeWriter sender, PipeReader receiver, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackClient(Stream stream, bool leaveStreamOpen = true, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackERXUDPDataFormat ERXUDPDataFormat { get; protected set; }
[MemberNotNullWhen(true, "PanaSessionPeerAddress")]
public bool IsPanaSessionAlive { [MemberNotNullWhen(true, "PanaSessionPeerAddress")] get; }
protected ILogger? Logger { get; }
public IPAddress? PanaSessionPeerAddress { get; }
public TimeSpan ReceiveResponseDelay { get; set; }
public TimeSpan ReceiveUdpPollingInterval { get; set; }
public ISynchronizeInvoke? SynchronizingObject { get; set; }
+ public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public async ValueTask<IPAddress> ConvertToIPv6LinkLocalAddressAsync(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask DisableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
public ValueTask EnableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<IPAddress>> GetAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPort>> GetListeningUdpPortListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyDictionary<IPAddress, PhysicalAddress>> GetNeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPortHandle>> GetUnusedUdpPortHandleListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask LoadFlashMemoryAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<SkStackUdpPort> PrepareUdpPortAsync(int port, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpAsync(int port, IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpEchonetLiteAsync(IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask SaveFlashMemoryAsync(SkStackFlashMemoryWriteRestriction restriction, CancellationToken cancellationToken = default) {}
internal protected ValueTask<SkStackResponse<TPayload>> SendCommandAsync<TPayload>(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments, SkStackSequenceParser<TPayload> parseResponsePayload, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
internal protected async ValueTask<SkStackResponse> SendCommandAsync(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments = null, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKADDNBRAsync(IPAddress ipv6Address, PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<string>> SendSKAPPVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKDSLEEPAsync(bool waitUntilWakeUp = false, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKERASEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<(IPAddress LinkLocalAddress, PhysicalAddress MacAddress, SkStackChannel Channel, int PanId, int Addr16)>> SendSKINFOAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKJOINAsync(IPAddress ipv6address, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IPAddress>> SendSKLL64Async(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKLOADAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IPAddress Address)> SendSKREJOINAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKRESETAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSAVEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(Action<IBufferWriter<byte>> writePassword, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<byte> password, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(Action<IBufferWriter<byte>> writeRBID, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<byte> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<char> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<TValue>> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, TValue @value, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<IPAddress>>> SendSKTABLEAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<SkStackUdpPort>>> SendSKTABLEListeningPortListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyDictionary<IPAddress, PhysicalAddress>>> SendSKTABLENeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKTERMAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, SkStackUdpPort UdpPort)> SendSKUDPPORTAsync(SkStackUdpPortHandle handle, int port, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKUDPPORTUnsetAsync(SkStackUdpPortHandle handle, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<Version>> SendSKVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask SendUdpEchonetLiteAsync(ReadOnlyMemory<byte> buffer, ResiliencePipeline? resiliencePipeline = null, CancellationToken cancellationToken = default) {}
protected async ValueTask SetFlashMemoryAutoLoadAsync(bool trueIfEnable, CancellationToken cancellationToken = default) {}
public void StartCapturingUdpReceiveEvents(int port) {}
public void StopCapturingUdpReceiveEvents(int port) {}
public ValueTask<bool> TerminatePanaSessionAsync(CancellationToken cancellationToken = default) {}
protected void ThrowIfDisposed() {}
internal protected void ThrowIfPanaSessionAlreadyEstablished() {}
[MemberNotNull("PanaSessionPeerAddress")]
internal protected void ThrowIfPanaSessionIsNotEstablished() {}
}
public class SkStackCommandNotSupportedException : SkStackErrorResponseException {
}
public class SkStackErrorResponseException : SkStackResponseException {
public SkStackErrorCode ErrorCode { get; }
public string ErrorText { get; }
public SkStackResponse Response { get; }
}
public class SkStackEventArgs : EventArgs {
public SkStackEventNumber EventNumber { get; }
}
public class SkStackFlashMemoryIOException : SkStackErrorResponseException {
}
public abstract class SkStackFlashMemoryWriteRestriction {
public static SkStackFlashMemoryWriteRestriction CreateGrantIfElapsed(TimeSpan interval) {}
public static SkStackFlashMemoryWriteRestriction DangerousCreateAlwaysGrant() {}
protected SkStackFlashMemoryWriteRestriction() {}
internal protected abstract bool IsRestricted();
}
public static class SkStackKnownPortNumbers {
public const int EchonetLite = 3610;
public const int Pana = 716;
}
public class SkStackPanaSessionEstablishmentException : SkStackPanaSessionException {
public SkStackChannel? Channel { get; }
public IPAddress? PaaAddress { get; }
public int? PanId { get; }
}
public sealed class SkStackPanaSessionEventArgs : SkStackEventArgs {
public IPAddress PanaSessionPeerAddress { get; }
}
public abstract class SkStackPanaSessionException : InvalidOperationException {
public IPAddress Address { get; }
public SkStackEventNumber EventNumber { get; }
}
public sealed class SkStackPanaSessionInfo {
public SkStackChannel Channel { get; }
public IPAddress LocalAddress { get; }
public PhysicalAddress LocalMacAddress { get; }
public int PanId { get; }
public IPAddress PeerAddress { get; }
public PhysicalAddress PeerMacAddress { get; }
}
public static class SkStackRegister {
public abstract class RegisterEntry<TValue> {
private protected delegate bool ExpectValueFunc(ref SequenceReader<byte> reader, out TValue @value);
public bool IsReadable { get; }
public bool IsWritable { get; }
public TValue MaxValue { get; }
public TValue MinValue { get; }
public string Name { get; }
}
public static SkStackRegister.RegisterEntry<bool> AcceptIcmpEcho { get; }
public static SkStackRegister.RegisterEntry<ulong> AccumulatedSendTimeInMilliseconds { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> Channel { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoLoad { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoReauthentication { get; }
public static SkStackRegister.RegisterEntry<bool> EnableEchoback { get; }
public static SkStackRegister.RegisterEntry<bool> EncryptIPMulticast { get; }
public static SkStackRegister.RegisterEntry<uint> FrameCounter { get; }
public static SkStackRegister.RegisterEntry<bool> IsSendingRestricted { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> PairingId { get; }
public static SkStackRegister.RegisterEntry<ushort> PanId { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> PanaSessionLifetimeInSeconds { get; }
public static SkStackRegister.RegisterEntry<bool> RespondBeaconRequest { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> S02 { get; }
public static SkStackRegister.RegisterEntry<ushort> S03 { get; }
public static SkStackRegister.RegisterEntry<uint> S07 { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> S0A { get; }
public static SkStackRegister.RegisterEntry<bool> S15 { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> S16 { get; }
public static SkStackRegister.RegisterEntry<bool> S17 { get; }
public static SkStackRegister.RegisterEntry<bool> SA0 { get; }
public static SkStackRegister.RegisterEntry<bool> SA1 { get; }
public static SkStackRegister.RegisterEntry<bool> SFB { get; }
public static SkStackRegister.RegisterEntry<ulong> SFD { get; }
public static SkStackRegister.RegisterEntry<bool> SFE { get; }
public static SkStackRegister.RegisterEntry<bool> SFF { get; }
}
public class SkStackResponse {
public SkStackResponseStatus Status { get; }
public ReadOnlyMemory<byte> StatusText { get; }
public bool Success { get; }
}
public class SkStackResponseException : InvalidOperationException {
public SkStackResponseException() {}
public SkStackResponseException(string message) {}
public SkStackResponseException(string message, Exception? innerException = null) {}
}
public class SkStackResponse<TPayload> : SkStackResponse {
public TPayload Payload { get; }
}
public class SkStackUartIOException : SkStackErrorResponseException {
}
public class SkStackUdpSendFailedException : InvalidOperationException {
public SkStackUdpSendFailedException() {}
public SkStackUdpSendFailedException(string message) {}
public SkStackUdpSendFailedException(string message, Exception? innerException = null) {}
public SkStackUdpSendFailedException(string message, SkStackUdpPortHandle portHandle, IPAddress peerAddress, Exception? innerException = null) {}
public IPAddress? PeerAddress { get; }
public SkStackUdpPortHandle PortHandle { get; }
}
public class SkStackUdpSendResultIndeterminateException : InvalidOperationException {
public SkStackUdpSendResultIndeterminateException() {}
public SkStackUdpSendResultIndeterminateException(string message) {}
public SkStackUdpSendResultIndeterminateException(string message, Exception? innerException = null) {}
}
public readonly struct SkStackChannel :
IComparable<SkStackChannel>,
IEquatable<SkStackChannel>
{
public static readonly IReadOnlyDictionary<int, SkStackChannel> Channels; // = "System.Collections.Generic.Dictionary`2[System.Int32,Smdn.Net.SkStackIP.SkStackChannel]"
public static readonly SkStackChannel Empty; // = "0ch (S02=0x00, 0 MHz)"
public static SkStackChannel Channel33 { get; }
public static SkStackChannel Channel34 { get; }
public static SkStackChannel Channel35 { get; }
public static SkStackChannel Channel36 { get; }
public static SkStackChannel Channel37 { get; }
public static SkStackChannel Channel38 { get; }
public static SkStackChannel Channel39 { get; }
public static SkStackChannel Channel40 { get; }
public static SkStackChannel Channel41 { get; }
public static SkStackChannel Channel42 { get; }
public static SkStackChannel Channel43 { get; }
public static SkStackChannel Channel44 { get; }
public static SkStackChannel Channel45 { get; }
public static SkStackChannel Channel46 { get; }
public static SkStackChannel Channel47 { get; }
public static SkStackChannel Channel48 { get; }
public static SkStackChannel Channel49 { get; }
public static SkStackChannel Channel50 { get; }
public static SkStackChannel Channel51 { get; }
public static SkStackChannel Channel52 { get; }
public static SkStackChannel Channel53 { get; }
public static SkStackChannel Channel54 { get; }
public static SkStackChannel Channel55 { get; }
public static SkStackChannel Channel56 { get; }
public static SkStackChannel Channel57 { get; }
public static SkStackChannel Channel58 { get; }
public static SkStackChannel Channel59 { get; }
public static SkStackChannel Channel60 { get; }
public static bool operator == (SkStackChannel x, SkStackChannel y) {}
public static bool operator != (SkStackChannel x, SkStackChannel y) {}
public int ChannelNumber { get; }
public decimal FrequencyMHz { get; }
public bool IsEmpty { get; }
public bool Equals(SkStackChannel other) {}
public override bool Equals(object? obj) {}
public override int GetHashCode() {}
int IComparable<SkStackChannel>.CompareTo(SkStackChannel other) {}
public override string ToString() {}
}
public readonly struct SkStackPanDescription {
public SkStackChannel Channel { get; }
public int ChannelPage { get; }
public int Id { get; }
public PhysicalAddress MacAddress { get; }
public uint PairingId { get; }
public decimal Rssi { get; }
public override string ToString() {}
}
public readonly struct SkStackUdpPort {
public static readonly SkStackUdpPort Null; // = "0 (#0)"
public SkStackUdpPortHandle Handle { get; }
public bool IsNull { get; }
public bool IsUnused { get; }
public int Port { get; }
public override string ToString() {}
}
}
namespace Smdn.Net.SkStackIP.Protocol {
public delegate TResult SkStackSequenceParser<TResult>(ISkStackSequenceParserContext context);
public interface ISkStackCommandLineWriter {
void WriteMaskedToken(ReadOnlySpan<byte> token);
void WriteToken(ReadOnlySpan<byte> token);
}
public interface ISkStackSequenceParserContext {
ReadOnlySequence<byte> UnparsedSequence { get; }
void Complete();
void Complete(SequenceReader<byte> consumedReader);
void Continue();
ISkStackSequenceParserContext CreateCopy();
virtual SequenceReader<byte> CreateReader() {}
void Ignore();
void SetAsIncomplete();
void SetAsIncomplete(SequenceReader<byte> incompleteReader);
}
public abstract class SkStackProtocolSyntax {
public static SkStackProtocolSyntax Default { get; }
protected SkStackProtocolSyntax() {}
public abstract ReadOnlySpan<byte> EndOfCommandLine { get; }
public virtual ReadOnlySpan<byte> EndOfEchobackLine { get; }
public abstract ReadOnlySpan<byte> EndOfStatusLine { get; }
public abstract bool ExpectStatusLine { get; }
}
public static class SkStackTokenParser {
public static bool Expect<TValue>(ref SequenceReader<byte> reader, int length, Converter<ReadOnlySequence<byte>, TValue> converter, [NotNullWhen(true)] out TValue @value) {}
public static bool ExpectADDR16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectADDR64(ref SequenceReader<byte> reader, [NotNullWhen(true)] out PhysicalAddress? @value) {}
public static bool ExpectBinary(ref SequenceReader<byte> reader, out bool @value) {}
public static bool ExpectCHANNEL(ref SequenceReader<byte> reader, out SkStackChannel @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, [NotNullWhen(true)] out string? @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, out ReadOnlyMemory<byte> @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, int length, out uint @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectEndOfLine(ref SequenceReader<byte> reader) {}
public static bool ExpectIPADDR(ref SequenceReader<byte> reader, [NotNullWhen(true)] out IPAddress? @value) {}
public static bool ExpectSequence(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedSequence) {}
public static bool ExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
public static bool ExpectUINT16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectUINT32(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectUINT64(ref SequenceReader<byte> reader, out ulong @value) {}
public static bool ExpectUINT8(ref SequenceReader<byte> reader, out byte @value) {}
public static void ToByteSequence(ReadOnlySequence<byte> hexTextSequence, int byteSequenceLength, Span<byte> destination) {}
public static bool TryExpectStatusLine(ref SequenceReader<byte> reader, out SkStackResponseStatus status) {}
public static OperationStatus TryExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
}
public class SkStackUnexpectedResponseException : SkStackResponseException {
public string? CausedText { get; }
}
}
// 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)
diff --git a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net8.0.apilist.cs b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net8.0.apilist.cs
index 7c2d7f7..fbc09c7 100644
--- a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net8.0.apilist.cs
+++ b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-net8.0.apilist.cs
@@ -1,467 +1,474 @@
-// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.1.0)
+// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.2.0)
// Name: Smdn.Net.SkStackIP
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+b1231cf0cca65506f3356620e16e3ecd4cb811c1
+// AssemblyVersion: 1.2.0.0
+// InformationalVersion: 1.2.0+0e506f4265dfd6eb80e5f98b4486e10a5cda9d99
// TargetFramework: .NETCoreApp,Version=v8.0
// Configuration: Release
// Referenced assemblies:
// Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
// Polly.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc
// Smdn.Fundamental.ControlPicture, Version=3.0.0.1, Culture=neutral
// Smdn.Fundamental.PrintableEncoding.Hexadecimal, Version=3.0.0.0, Culture=neutral
// System.Collections, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.ComponentModel.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// System.Linq, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// System.Memory, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// System.Net.NetworkInformation, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// 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.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipelines;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Polly;
using Smdn.Net.SkStackIP;
using Smdn.Net.SkStackIP.Protocol;
namespace Smdn.Net.SkStackIP {
public enum SkStackERXUDPDataFormat : int {
Binary = 0,
HexAsciiText = 1,
}
public enum SkStackErrorCode : int {
ER01 = 1,
ER02 = 2,
ER03 = 3,
ER04 = 4,
ER05 = 5,
ER06 = 6,
ER07 = 7,
ER08 = 8,
ER09 = 9,
ER10 = 10,
Undefined = 0,
}
public enum SkStackEventNumber : byte {
ActiveScanCompleted = 34,
BeaconReceived = 32,
EchoRequestReceived = 5,
EnergyDetectScanCompleted = 31,
NeighborAdvertisementReceived = 2,
NeighborSolicitationReceived = 1,
PanaSessionEstablishmentCompleted = 37,
PanaSessionEstablishmentError = 36,
PanaSessionExpired = 41,
PanaSessionTerminationCompleted = 39,
PanaSessionTerminationRequestReceived = 38,
PanaSessionTerminationTimedOut = 40,
TransmissionTimeControlLimitationActivated = 50,
TransmissionTimeControlLimitationDeactivated = 51,
UdpSendCompleted = 33,
Undefined = 0,
WakeupSignalReceived = 192,
}
public enum SkStackResponseStatus : int {
Fail = -1,
Ok = 1,
Undetermined = 0,
}
public enum SkStackUdpEncryption : byte {
EncryptIfAble = 2,
ForceEncrypt = 1,
ForcePlainText = 0,
}
public enum SkStackUdpPortHandle : byte {
Handle1 = 1,
Handle2 = 2,
Handle3 = 3,
Handle4 = 4,
Handle5 = 5,
Handle6 = 6,
None = 0,
}
public abstract class SkStackActiveScanOptions : ICloneable {
public static SkStackActiveScanOptions Default { get; }
public static SkStackActiveScanOptions Null { get; }
public static SkStackActiveScanOptions ScanUntilFind { get; }
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, PhysicalAddress paaMacAddress) {}
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, Predicate<SkStackPanDescription>? paaSelector = null) {}
protected SkStackActiveScanOptions() {}
public abstract SkStackActiveScanOptions Clone();
object ICloneable.Clone() {}
}
public class SkStackClient : IDisposable {
public static readonly TimeSpan SKSCANDefaultDuration; // = "00:00:00.0480000"
public static readonly TimeSpan SKSCANMaxDuration; // = "00:02:37.2960000"
public static readonly TimeSpan SKSCANMinDuration; // = "00:00:00.0192000"
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionEstablished;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionExpired;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionTerminated;
public event EventHandler<SkStackEventArgs>? Slept;
public event EventHandler<SkStackEventArgs>? WokeUp;
public SkStackClient(PipeWriter sender, PipeReader receiver, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackClient(Stream stream, bool leaveStreamOpen = true, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackERXUDPDataFormat ERXUDPDataFormat { get; protected set; }
[MemberNotNullWhen(true, "PanaSessionPeerAddress")]
public bool IsPanaSessionAlive { [MemberNotNullWhen(true, "PanaSessionPeerAddress")] get; }
protected ILogger? Logger { get; }
public IPAddress? PanaSessionPeerAddress { get; }
public TimeSpan ReceiveResponseDelay { get; set; }
public TimeSpan ReceiveUdpPollingInterval { get; set; }
public ISynchronizeInvoke? SynchronizingObject { get; set; }
+ public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public async ValueTask<IPAddress> ConvertToIPv6LinkLocalAddressAsync(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask DisableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
public ValueTask EnableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<IPAddress>> GetAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPort>> GetListeningUdpPortListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyDictionary<IPAddress, PhysicalAddress>> GetNeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPortHandle>> GetUnusedUdpPortHandleListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask LoadFlashMemoryAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<SkStackUdpPort> PrepareUdpPortAsync(int port, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpAsync(int port, IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpEchonetLiteAsync(IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask SaveFlashMemoryAsync(SkStackFlashMemoryWriteRestriction restriction, CancellationToken cancellationToken = default) {}
internal protected ValueTask<SkStackResponse<TPayload>> SendCommandAsync<TPayload>(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments, SkStackSequenceParser<TPayload> parseResponsePayload, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
internal protected async ValueTask<SkStackResponse> SendCommandAsync(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments = null, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKADDNBRAsync(IPAddress ipv6Address, PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<string>> SendSKAPPVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKDSLEEPAsync(bool waitUntilWakeUp = false, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKERASEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<(IPAddress LinkLocalAddress, PhysicalAddress MacAddress, SkStackChannel Channel, int PanId, int Addr16)>> SendSKINFOAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKJOINAsync(IPAddress ipv6address, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IPAddress>> SendSKLL64Async(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKLOADAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IPAddress Address)> SendSKREJOINAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKRESETAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSAVEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(Action<IBufferWriter<byte>> writePassword, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<byte> password, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(Action<IBufferWriter<byte>> writeRBID, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<byte> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<char> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<TValue>> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, TValue @value, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<IPAddress>>> SendSKTABLEAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<SkStackUdpPort>>> SendSKTABLEListeningPortListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyDictionary<IPAddress, PhysicalAddress>>> SendSKTABLENeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKTERMAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, SkStackUdpPort UdpPort)> SendSKUDPPORTAsync(SkStackUdpPortHandle handle, int port, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKUDPPORTUnsetAsync(SkStackUdpPortHandle handle, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<Version>> SendSKVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask SendUdpEchonetLiteAsync(ReadOnlyMemory<byte> buffer, ResiliencePipeline? resiliencePipeline = null, CancellationToken cancellationToken = default) {}
protected async ValueTask SetFlashMemoryAutoLoadAsync(bool trueIfEnable, CancellationToken cancellationToken = default) {}
public void StartCapturingUdpReceiveEvents(int port) {}
public void StopCapturingUdpReceiveEvents(int port) {}
public ValueTask<bool> TerminatePanaSessionAsync(CancellationToken cancellationToken = default) {}
protected void ThrowIfDisposed() {}
internal protected void ThrowIfPanaSessionAlreadyEstablished() {}
[MemberNotNull("PanaSessionPeerAddress")]
internal protected void ThrowIfPanaSessionIsNotEstablished() {}
}
public class SkStackCommandNotSupportedException : SkStackErrorResponseException {
}
public class SkStackErrorResponseException : SkStackResponseException {
public SkStackErrorCode ErrorCode { get; }
public string ErrorText { get; }
public SkStackResponse Response { get; }
}
public class SkStackEventArgs : EventArgs {
public SkStackEventNumber EventNumber { get; }
}
public class SkStackFlashMemoryIOException : SkStackErrorResponseException {
}
public abstract class SkStackFlashMemoryWriteRestriction {
public static SkStackFlashMemoryWriteRestriction CreateGrantIfElapsed(TimeSpan interval) {}
public static SkStackFlashMemoryWriteRestriction DangerousCreateAlwaysGrant() {}
protected SkStackFlashMemoryWriteRestriction() {}
internal protected abstract bool IsRestricted();
}
public static class SkStackKnownPortNumbers {
public const int EchonetLite = 3610;
public const int Pana = 716;
}
public class SkStackPanaSessionEstablishmentException : SkStackPanaSessionException {
public SkStackChannel? Channel { get; }
public IPAddress? PaaAddress { get; }
public int? PanId { get; }
}
public sealed class SkStackPanaSessionEventArgs : SkStackEventArgs {
public IPAddress PanaSessionPeerAddress { get; }
}
public abstract class SkStackPanaSessionException : InvalidOperationException {
public IPAddress Address { get; }
public SkStackEventNumber EventNumber { get; }
}
public sealed class SkStackPanaSessionInfo {
public SkStackChannel Channel { get; }
public IPAddress LocalAddress { get; }
public PhysicalAddress LocalMacAddress { get; }
public int PanId { get; }
public IPAddress PeerAddress { get; }
public PhysicalAddress PeerMacAddress { get; }
}
public static class SkStackRegister {
public abstract class RegisterEntry<TValue> {
private protected delegate bool ExpectValueFunc(ref SequenceReader<byte> reader, out TValue @value);
public bool IsReadable { get; }
public bool IsWritable { get; }
public TValue MaxValue { get; }
public TValue MinValue { get; }
public string Name { get; }
}
public static SkStackRegister.RegisterEntry<bool> AcceptIcmpEcho { get; }
public static SkStackRegister.RegisterEntry<ulong> AccumulatedSendTimeInMilliseconds { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> Channel { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoLoad { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoReauthentication { get; }
public static SkStackRegister.RegisterEntry<bool> EnableEchoback { get; }
public static SkStackRegister.RegisterEntry<bool> EncryptIPMulticast { get; }
public static SkStackRegister.RegisterEntry<uint> FrameCounter { get; }
public static SkStackRegister.RegisterEntry<bool> IsSendingRestricted { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> PairingId { get; }
public static SkStackRegister.RegisterEntry<ushort> PanId { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> PanaSessionLifetimeInSeconds { get; }
public static SkStackRegister.RegisterEntry<bool> RespondBeaconRequest { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> S02 { get; }
public static SkStackRegister.RegisterEntry<ushort> S03 { get; }
public static SkStackRegister.RegisterEntry<uint> S07 { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> S0A { get; }
public static SkStackRegister.RegisterEntry<bool> S15 { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> S16 { get; }
public static SkStackRegister.RegisterEntry<bool> S17 { get; }
public static SkStackRegister.RegisterEntry<bool> SA0 { get; }
public static SkStackRegister.RegisterEntry<bool> SA1 { get; }
public static SkStackRegister.RegisterEntry<bool> SFB { get; }
public static SkStackRegister.RegisterEntry<ulong> SFD { get; }
public static SkStackRegister.RegisterEntry<bool> SFE { get; }
public static SkStackRegister.RegisterEntry<bool> SFF { get; }
}
public class SkStackResponse {
public SkStackResponseStatus Status { get; }
public ReadOnlyMemory<byte> StatusText { get; }
public bool Success { get; }
}
public class SkStackResponseException : InvalidOperationException {
public SkStackResponseException() {}
public SkStackResponseException(string message) {}
public SkStackResponseException(string message, Exception? innerException = null) {}
}
public class SkStackResponse<TPayload> : SkStackResponse {
public TPayload Payload { get; }
}
public class SkStackUartIOException : SkStackErrorResponseException {
}
public class SkStackUdpSendFailedException : InvalidOperationException {
public SkStackUdpSendFailedException() {}
public SkStackUdpSendFailedException(string message) {}
public SkStackUdpSendFailedException(string message, Exception? innerException = null) {}
public SkStackUdpSendFailedException(string message, SkStackUdpPortHandle portHandle, IPAddress peerAddress, Exception? innerException = null) {}
public IPAddress? PeerAddress { get; }
public SkStackUdpPortHandle PortHandle { get; }
}
public class SkStackUdpSendResultIndeterminateException : InvalidOperationException {
public SkStackUdpSendResultIndeterminateException() {}
public SkStackUdpSendResultIndeterminateException(string message) {}
public SkStackUdpSendResultIndeterminateException(string message, Exception? innerException = null) {}
}
public readonly struct SkStackChannel :
IComparable<SkStackChannel>,
IEquatable<SkStackChannel>
{
public static readonly IReadOnlyDictionary<int, SkStackChannel> Channels; // = "System.Collections.Generic.Dictionary`2[System.Int32,Smdn.Net.SkStackIP.SkStackChannel]"
public static readonly SkStackChannel Empty; // = "0ch (S02=0x00, 0 MHz)"
public static SkStackChannel Channel33 { get; }
public static SkStackChannel Channel34 { get; }
public static SkStackChannel Channel35 { get; }
public static SkStackChannel Channel36 { get; }
public static SkStackChannel Channel37 { get; }
public static SkStackChannel Channel38 { get; }
public static SkStackChannel Channel39 { get; }
public static SkStackChannel Channel40 { get; }
public static SkStackChannel Channel41 { get; }
public static SkStackChannel Channel42 { get; }
public static SkStackChannel Channel43 { get; }
public static SkStackChannel Channel44 { get; }
public static SkStackChannel Channel45 { get; }
public static SkStackChannel Channel46 { get; }
public static SkStackChannel Channel47 { get; }
public static SkStackChannel Channel48 { get; }
public static SkStackChannel Channel49 { get; }
public static SkStackChannel Channel50 { get; }
public static SkStackChannel Channel51 { get; }
public static SkStackChannel Channel52 { get; }
public static SkStackChannel Channel53 { get; }
public static SkStackChannel Channel54 { get; }
public static SkStackChannel Channel55 { get; }
public static SkStackChannel Channel56 { get; }
public static SkStackChannel Channel57 { get; }
public static SkStackChannel Channel58 { get; }
public static SkStackChannel Channel59 { get; }
public static SkStackChannel Channel60 { get; }
public static bool operator == (SkStackChannel x, SkStackChannel y) {}
public static bool operator != (SkStackChannel x, SkStackChannel y) {}
public int ChannelNumber { get; }
public decimal FrequencyMHz { get; }
public bool IsEmpty { get; }
public bool Equals(SkStackChannel other) {}
public override bool Equals(object? obj) {}
public override int GetHashCode() {}
int IComparable<SkStackChannel>.CompareTo(SkStackChannel other) {}
public override string ToString() {}
}
public readonly struct SkStackPanDescription {
public SkStackChannel Channel { get; }
public int ChannelPage { get; }
public int Id { get; }
public PhysicalAddress MacAddress { get; }
public uint PairingId { get; }
public decimal Rssi { get; }
public override string ToString() {}
}
public readonly struct SkStackUdpPort {
public static readonly SkStackUdpPort Null; // = "0 (#0)"
public SkStackUdpPortHandle Handle { get; }
public bool IsNull { get; }
public bool IsUnused { get; }
public int Port { get; }
public override string ToString() {}
}
}
namespace Smdn.Net.SkStackIP.Protocol {
public delegate TResult SkStackSequenceParser<TResult>(ISkStackSequenceParserContext context);
public interface ISkStackCommandLineWriter {
void WriteMaskedToken(ReadOnlySpan<byte> token);
void WriteToken(ReadOnlySpan<byte> token);
}
public interface ISkStackSequenceParserContext {
ReadOnlySequence<byte> UnparsedSequence { get; }
void Complete();
void Complete(SequenceReader<byte> consumedReader);
void Continue();
ISkStackSequenceParserContext CreateCopy();
virtual SequenceReader<byte> CreateReader() {}
void Ignore();
void SetAsIncomplete();
void SetAsIncomplete(SequenceReader<byte> incompleteReader);
}
public abstract class SkStackProtocolSyntax {
public static SkStackProtocolSyntax Default { get; }
protected SkStackProtocolSyntax() {}
public abstract ReadOnlySpan<byte> EndOfCommandLine { get; }
public virtual ReadOnlySpan<byte> EndOfEchobackLine { get; }
public abstract ReadOnlySpan<byte> EndOfStatusLine { get; }
public abstract bool ExpectStatusLine { get; }
}
public static class SkStackTokenParser {
public static bool Expect<TValue>(ref SequenceReader<byte> reader, int length, Converter<ReadOnlySequence<byte>, TValue> converter, [NotNullWhen(true)] out TValue @value) {}
public static bool ExpectADDR16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectADDR64(ref SequenceReader<byte> reader, [NotNullWhen(true)] out PhysicalAddress? @value) {}
public static bool ExpectBinary(ref SequenceReader<byte> reader, out bool @value) {}
public static bool ExpectCHANNEL(ref SequenceReader<byte> reader, out SkStackChannel @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, [NotNullWhen(true)] out string? @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, out ReadOnlyMemory<byte> @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, int length, out uint @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectEndOfLine(ref SequenceReader<byte> reader) {}
public static bool ExpectIPADDR(ref SequenceReader<byte> reader, [NotNullWhen(true)] out IPAddress? @value) {}
public static bool ExpectSequence(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedSequence) {}
public static bool ExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
public static bool ExpectUINT16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectUINT32(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectUINT64(ref SequenceReader<byte> reader, out ulong @value) {}
public static bool ExpectUINT8(ref SequenceReader<byte> reader, out byte @value) {}
public static void ToByteSequence(ReadOnlySequence<byte> hexTextSequence, int byteSequenceLength, Span<byte> destination) {}
public static bool TryExpectStatusLine(ref SequenceReader<byte> reader, out SkStackResponseStatus status) {}
public static OperationStatus TryExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
}
public class SkStackUnexpectedResponseException : SkStackResponseException {
public string? CausedText { get; }
}
}
// 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)
diff --git a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-netstandard2.1.apilist.cs b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-netstandard2.1.apilist.cs
index 9753e9e..b6b4a76 100644
--- a/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-netstandard2.1.apilist.cs
+++ b/doc/api-list/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP-netstandard2.1.apilist.cs
@@ -1,459 +1,466 @@
-// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.1.0)
+// Smdn.Net.SkStackIP.dll (Smdn.Net.SkStackIP-1.2.0)
// Name: Smdn.Net.SkStackIP
-// AssemblyVersion: 1.1.0.0
-// InformationalVersion: 1.1.0+b1231cf0cca65506f3356620e16e3ecd4cb811c1
+// AssemblyVersion: 1.2.0.0
+// InformationalVersion: 1.2.0+0e506f4265dfd6eb80e5f98b4486e10a5cda9d99
// TargetFramework: .NETStandard,Version=v2.1
// Configuration: Release
// Referenced assemblies:
// Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60
// Polly.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=c8a3ffc3f8f825cc
// Smdn.Fundamental.ControlPicture, Version=3.0.0.1, Culture=neutral
// Smdn.Fundamental.Encoding.Buffer, Version=3.0.0.0, Culture=neutral
// Smdn.Fundamental.PrintableEncoding.Hexadecimal, Version=3.0.0.0, Culture=neutral
// System.IO.Pipelines, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
// netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
#nullable enable annotations
using System;
using System.Buffers;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipelines;
using System.Net;
using System.Net.NetworkInformation;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Polly;
using Smdn.Net.SkStackIP;
using Smdn.Net.SkStackIP.Protocol;
namespace Smdn.Net.SkStackIP {
public enum SkStackERXUDPDataFormat : int {
Binary = 0,
HexAsciiText = 1,
}
public enum SkStackErrorCode : int {
ER01 = 1,
ER02 = 2,
ER03 = 3,
ER04 = 4,
ER05 = 5,
ER06 = 6,
ER07 = 7,
ER08 = 8,
ER09 = 9,
ER10 = 10,
Undefined = 0,
}
public enum SkStackEventNumber : byte {
ActiveScanCompleted = 34,
BeaconReceived = 32,
EchoRequestReceived = 5,
EnergyDetectScanCompleted = 31,
NeighborAdvertisementReceived = 2,
NeighborSolicitationReceived = 1,
PanaSessionEstablishmentCompleted = 37,
PanaSessionEstablishmentError = 36,
PanaSessionExpired = 41,
PanaSessionTerminationCompleted = 39,
PanaSessionTerminationRequestReceived = 38,
PanaSessionTerminationTimedOut = 40,
TransmissionTimeControlLimitationActivated = 50,
TransmissionTimeControlLimitationDeactivated = 51,
UdpSendCompleted = 33,
Undefined = 0,
WakeupSignalReceived = 192,
}
public enum SkStackResponseStatus : int {
Fail = -1,
Ok = 1,
Undetermined = 0,
}
public enum SkStackUdpEncryption : byte {
EncryptIfAble = 2,
ForceEncrypt = 1,
ForcePlainText = 0,
}
public enum SkStackUdpPortHandle : byte {
Handle1 = 1,
Handle2 = 2,
Handle3 = 3,
Handle4 = 4,
Handle5 = 5,
Handle6 = 6,
None = 0,
}
public abstract class SkStackActiveScanOptions : ICloneable {
public static SkStackActiveScanOptions Default { get; }
public static SkStackActiveScanOptions Null { get; }
public static SkStackActiveScanOptions ScanUntilFind { get; }
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, PhysicalAddress paaMacAddress) {}
public static SkStackActiveScanOptions Create(IEnumerable<int> scanDurationGenerator, Predicate<SkStackPanDescription>? paaSelector = null) {}
protected SkStackActiveScanOptions() {}
public abstract SkStackActiveScanOptions Clone();
object ICloneable.Clone() {}
}
public class SkStackClient : IDisposable {
public static readonly TimeSpan SKSCANDefaultDuration; // = "00:00:00.0480000"
public static readonly TimeSpan SKSCANMaxDuration; // = "00:02:37.2960000"
public static readonly TimeSpan SKSCANMinDuration; // = "00:00:00.0192000"
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionEstablished;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionExpired;
public event EventHandler<SkStackPanaSessionEventArgs>? PanaSessionTerminated;
public event EventHandler<SkStackEventArgs>? Slept;
public event EventHandler<SkStackEventArgs>? WokeUp;
public SkStackClient(PipeWriter sender, PipeReader receiver, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackClient(Stream stream, bool leaveStreamOpen = true, SkStackERXUDPDataFormat erxudpDataFormat = SkStackERXUDPDataFormat.Binary, ILogger? logger = null) {}
public SkStackERXUDPDataFormat ERXUDPDataFormat { get; protected set; }
public bool IsPanaSessionAlive { get; }
protected ILogger? Logger { get; }
public IPAddress? PanaSessionPeerAddress { get; }
public TimeSpan ReceiveResponseDelay { get; set; }
public TimeSpan ReceiveUdpPollingInterval { get; set; }
public ISynchronizeInvoke? SynchronizingObject { get; set; }
+ public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(Action<IBufferWriter<byte>> writeRBID, Action<IBufferWriter<byte>> writePassword, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, IPAddress paaAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, SkStackChannel channel, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, PhysicalAddress paaMacAddress, int channelNumber, int panId, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackActiveScanOptions? scanOptions = null, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(ReadOnlyMemory<byte> rbid, ReadOnlyMemory<byte> password, SkStackPanDescription pan, CancellationToken cancellationToken = default) {}
public async ValueTask<IPAddress> ConvertToIPv6LinkLocalAddressAsync(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask DisableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
protected virtual void Dispose(bool disposing) {}
public void Dispose() {}
public ValueTask EnableFlashMemoryAutoLoadAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<IPAddress>> GetAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPort>> GetListeningUdpPortListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyDictionary<IPAddress, PhysicalAddress>> GetNeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<IReadOnlyList<SkStackUdpPortHandle>> GetUnusedUdpPortHandleListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask LoadFlashMemoryAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<SkStackUdpPort> PrepareUdpPortAsync(int port, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpAsync(int port, IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask<IPAddress> ReceiveUdpEchonetLiteAsync(IBufferWriter<byte> buffer, CancellationToken cancellationToken = default) {}
public ValueTask SaveFlashMemoryAsync(SkStackFlashMemoryWriteRestriction restriction, CancellationToken cancellationToken = default) {}
internal protected ValueTask<SkStackResponse<TPayload>> SendCommandAsync<TPayload>(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments, SkStackSequenceParser<TPayload> parseResponsePayload, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
internal protected async ValueTask<SkStackResponse> SendCommandAsync(ReadOnlyMemory<byte> command, Action<ISkStackCommandLineWriter>? writeArguments = null, SkStackProtocolSyntax? syntax = null, bool throwIfErrorStatus = true, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKADDNBRAsync(IPAddress ipv6Address, PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<string>> SendSKAPPVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKDSLEEPAsync(bool waitUntilWakeUp = false, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKERASEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<(IPAddress LinkLocalAddress, PhysicalAddress MacAddress, SkStackChannel Channel, int PanId, int Addr16)>> SendSKINFOAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKJOINAsync(IPAddress ipv6address, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IPAddress>> SendSKLL64Async(PhysicalAddress macAddress, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKLOADAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IPAddress Address)> SendSKREJOINAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKRESETAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSAVEAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyList<SkStackPanDescription> PanDescriptions)> SendSKSCANActiveScanPairAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(TimeSpan duration = default, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, IReadOnlyDictionary<SkStackChannel, decimal> ScanResult)> SendSKSCANEnergyDetectScanAsync(int durationFactor, uint channelMask = uint.MaxValue, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPort port, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPAddress destinationAddress, int destinationPort, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKSENDTOAsync(SkStackUdpPortHandle handle, IPEndPoint destination, ReadOnlyMemory<byte> data, SkStackUdpEncryption encryption = SkStackUdpEncryption.EncryptIfAble, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(Action<IBufferWriter<byte>> writePassword, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<byte> password, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETPWDAsync(ReadOnlyMemory<char> password, CancellationToken cancellationToken = default) {}
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(Action<IBufferWriter<byte>> writeRBID, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<byte> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSETRBIDAsync(ReadOnlyMemory<char> id, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<TValue>> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKSREGAsync<TValue>(SkStackRegister.RegisterEntry<TValue> register, TValue @value, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<IPAddress>>> SendSKTABLEAvailableAddressListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyList<SkStackUdpPort>>> SendSKTABLEListeningPortListAsync(CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<IReadOnlyDictionary<IPAddress, PhysicalAddress>>> SendSKTABLENeighborCacheListAsync(CancellationToken cancellationToken = default) {}
public async ValueTask<(SkStackResponse Response, bool IsCompletedSuccessfully)> SendSKTERMAsync(CancellationToken cancellationToken = default) {}
public ValueTask<(SkStackResponse Response, SkStackUdpPort UdpPort)> SendSKUDPPORTAsync(SkStackUdpPortHandle handle, int port, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse> SendSKUDPPORTUnsetAsync(SkStackUdpPortHandle handle, CancellationToken cancellationToken = default) {}
public ValueTask<SkStackResponse<Version>> SendSKVERAsync(CancellationToken cancellationToken = default) {}
public ValueTask SendUdpEchonetLiteAsync(ReadOnlyMemory<byte> buffer, ResiliencePipeline? resiliencePipeline = null, CancellationToken cancellationToken = default) {}
protected async ValueTask SetFlashMemoryAutoLoadAsync(bool trueIfEnable, CancellationToken cancellationToken = default) {}
public void StartCapturingUdpReceiveEvents(int port) {}
public void StopCapturingUdpReceiveEvents(int port) {}
public ValueTask<bool> TerminatePanaSessionAsync(CancellationToken cancellationToken = default) {}
protected void ThrowIfDisposed() {}
internal protected void ThrowIfPanaSessionAlreadyEstablished() {}
internal protected void ThrowIfPanaSessionIsNotEstablished() {}
}
public class SkStackCommandNotSupportedException : SkStackErrorResponseException {
}
public class SkStackErrorResponseException : SkStackResponseException {
public SkStackErrorCode ErrorCode { get; }
public string ErrorText { get; }
public SkStackResponse Response { get; }
}
public class SkStackEventArgs : EventArgs {
public SkStackEventNumber EventNumber { get; }
}
public class SkStackFlashMemoryIOException : SkStackErrorResponseException {
}
public abstract class SkStackFlashMemoryWriteRestriction {
public static SkStackFlashMemoryWriteRestriction CreateGrantIfElapsed(TimeSpan interval) {}
public static SkStackFlashMemoryWriteRestriction DangerousCreateAlwaysGrant() {}
protected SkStackFlashMemoryWriteRestriction() {}
internal protected abstract bool IsRestricted();
}
public static class SkStackKnownPortNumbers {
public const int EchonetLite = 3610;
public const int Pana = 716;
}
public class SkStackPanaSessionEstablishmentException : SkStackPanaSessionException {
public SkStackChannel? Channel { get; }
public IPAddress? PaaAddress { get; }
public int? PanId { get; }
}
public sealed class SkStackPanaSessionEventArgs : SkStackEventArgs {
public IPAddress PanaSessionPeerAddress { get; }
}
public abstract class SkStackPanaSessionException : InvalidOperationException {
public IPAddress Address { get; }
public SkStackEventNumber EventNumber { get; }
}
public sealed class SkStackPanaSessionInfo {
public SkStackChannel Channel { get; }
public IPAddress LocalAddress { get; }
public PhysicalAddress LocalMacAddress { get; }
public int PanId { get; }
public IPAddress PeerAddress { get; }
public PhysicalAddress PeerMacAddress { get; }
}
public static class SkStackRegister {
public abstract class RegisterEntry<TValue> {
private protected delegate bool ExpectValueFunc(ref SequenceReader<byte> reader, out TValue @value);
public bool IsReadable { get; }
public bool IsWritable { get; }
public TValue MaxValue { get; }
public TValue MinValue { get; }
public string Name { get; }
}
public static SkStackRegister.RegisterEntry<bool> AcceptIcmpEcho { get; }
public static SkStackRegister.RegisterEntry<ulong> AccumulatedSendTimeInMilliseconds { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> Channel { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoLoad { get; }
public static SkStackRegister.RegisterEntry<bool> EnableAutoReauthentication { get; }
public static SkStackRegister.RegisterEntry<bool> EnableEchoback { get; }
public static SkStackRegister.RegisterEntry<bool> EncryptIPMulticast { get; }
public static SkStackRegister.RegisterEntry<uint> FrameCounter { get; }
public static SkStackRegister.RegisterEntry<bool> IsSendingRestricted { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> PairingId { get; }
public static SkStackRegister.RegisterEntry<ushort> PanId { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> PanaSessionLifetimeInSeconds { get; }
public static SkStackRegister.RegisterEntry<bool> RespondBeaconRequest { get; }
public static SkStackRegister.RegisterEntry<SkStackChannel> S02 { get; }
public static SkStackRegister.RegisterEntry<ushort> S03 { get; }
public static SkStackRegister.RegisterEntry<uint> S07 { get; }
public static SkStackRegister.RegisterEntry<ReadOnlyMemory<byte>> S0A { get; }
public static SkStackRegister.RegisterEntry<bool> S15 { get; }
public static SkStackRegister.RegisterEntry<TimeSpan> S16 { get; }
public static SkStackRegister.RegisterEntry<bool> S17 { get; }
public static SkStackRegister.RegisterEntry<bool> SA0 { get; }
public static SkStackRegister.RegisterEntry<bool> SA1 { get; }
public static SkStackRegister.RegisterEntry<bool> SFB { get; }
public static SkStackRegister.RegisterEntry<ulong> SFD { get; }
public static SkStackRegister.RegisterEntry<bool> SFE { get; }
public static SkStackRegister.RegisterEntry<bool> SFF { get; }
}
public class SkStackResponse {
public SkStackResponseStatus Status { get; }
public ReadOnlyMemory<byte> StatusText { get; }
public bool Success { get; }
}
public class SkStackResponseException : InvalidOperationException {
public SkStackResponseException() {}
public SkStackResponseException(string message) {}
public SkStackResponseException(string message, Exception? innerException = null) {}
}
public class SkStackResponse<TPayload> : SkStackResponse {
public TPayload Payload { get; }
}
public class SkStackUartIOException : SkStackErrorResponseException {
}
public class SkStackUdpSendFailedException : InvalidOperationException {
public SkStackUdpSendFailedException() {}
public SkStackUdpSendFailedException(string message) {}
public SkStackUdpSendFailedException(string message, Exception? innerException = null) {}
public SkStackUdpSendFailedException(string message, SkStackUdpPortHandle portHandle, IPAddress peerAddress, Exception? innerException = null) {}
public IPAddress? PeerAddress { get; }
public SkStackUdpPortHandle PortHandle { get; }
}
public class SkStackUdpSendResultIndeterminateException : InvalidOperationException {
public SkStackUdpSendResultIndeterminateException() {}
public SkStackUdpSendResultIndeterminateException(string message) {}
public SkStackUdpSendResultIndeterminateException(string message, Exception? innerException = null) {}
}
public readonly struct SkStackChannel :
IComparable<SkStackChannel>,
IEquatable<SkStackChannel>
{
public static readonly IReadOnlyDictionary<int, SkStackChannel> Channels; // = "System.Collections.Generic.Dictionary`2[System.Int32,Smdn.Net.SkStackIP.SkStackChannel]"
public static readonly SkStackChannel Empty; // = "0ch (S02=0x00, 0 MHz)"
public static SkStackChannel Channel33 { get; }
public static SkStackChannel Channel34 { get; }
public static SkStackChannel Channel35 { get; }
public static SkStackChannel Channel36 { get; }
public static SkStackChannel Channel37 { get; }
public static SkStackChannel Channel38 { get; }
public static SkStackChannel Channel39 { get; }
public static SkStackChannel Channel40 { get; }
public static SkStackChannel Channel41 { get; }
public static SkStackChannel Channel42 { get; }
public static SkStackChannel Channel43 { get; }
public static SkStackChannel Channel44 { get; }
public static SkStackChannel Channel45 { get; }
public static SkStackChannel Channel46 { get; }
public static SkStackChannel Channel47 { get; }
public static SkStackChannel Channel48 { get; }
public static SkStackChannel Channel49 { get; }
public static SkStackChannel Channel50 { get; }
public static SkStackChannel Channel51 { get; }
public static SkStackChannel Channel52 { get; }
public static SkStackChannel Channel53 { get; }
public static SkStackChannel Channel54 { get; }
public static SkStackChannel Channel55 { get; }
public static SkStackChannel Channel56 { get; }
public static SkStackChannel Channel57 { get; }
public static SkStackChannel Channel58 { get; }
public static SkStackChannel Channel59 { get; }
public static SkStackChannel Channel60 { get; }
public static bool operator == (SkStackChannel x, SkStackChannel y) {}
public static bool operator != (SkStackChannel x, SkStackChannel y) {}
public int ChannelNumber { get; }
public decimal FrequencyMHz { get; }
public bool IsEmpty { get; }
public bool Equals(SkStackChannel other) {}
public override bool Equals(object? obj) {}
public override int GetHashCode() {}
int IComparable<SkStackChannel>.CompareTo(SkStackChannel other) {}
public override string ToString() {}
}
public readonly struct SkStackPanDescription {
public SkStackChannel Channel { get; }
public int ChannelPage { get; }
public int Id { get; }
public PhysicalAddress MacAddress { get; }
public uint PairingId { get; }
public decimal Rssi { get; }
public override string ToString() {}
}
public readonly struct SkStackUdpPort {
public static readonly SkStackUdpPort Null; // = "0 (#0)"
public SkStackUdpPortHandle Handle { get; }
public bool IsNull { get; }
public bool IsUnused { get; }
public int Port { get; }
public override string ToString() {}
}
}
namespace Smdn.Net.SkStackIP.Protocol {
public delegate TResult SkStackSequenceParser<TResult>(ISkStackSequenceParserContext context);
public interface ISkStackCommandLineWriter {
void WriteMaskedToken(ReadOnlySpan<byte> token);
void WriteToken(ReadOnlySpan<byte> token);
}
public interface ISkStackSequenceParserContext {
ReadOnlySequence<byte> UnparsedSequence { get; }
void Complete();
void Complete(SequenceReader<byte> consumedReader);
void Continue();
ISkStackSequenceParserContext CreateCopy();
virtual SequenceReader<byte> CreateReader() {}
void Ignore();
void SetAsIncomplete();
void SetAsIncomplete(SequenceReader<byte> incompleteReader);
}
public abstract class SkStackProtocolSyntax {
public static SkStackProtocolSyntax Default { get; }
protected SkStackProtocolSyntax() {}
public abstract ReadOnlySpan<byte> EndOfCommandLine { get; }
public virtual ReadOnlySpan<byte> EndOfEchobackLine { get; }
public abstract ReadOnlySpan<byte> EndOfStatusLine { get; }
public abstract bool ExpectStatusLine { get; }
}
public static class SkStackTokenParser {
public static bool Expect<TValue>(ref SequenceReader<byte> reader, int length, Converter<ReadOnlySequence<byte>, TValue> converter, [NotNullWhen(true)] out TValue @value) {}
public static bool ExpectADDR16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectADDR64(ref SequenceReader<byte> reader, [NotNullWhen(true)] out PhysicalAddress? @value) {}
public static bool ExpectBinary(ref SequenceReader<byte> reader, out bool @value) {}
public static bool ExpectCHANNEL(ref SequenceReader<byte> reader, out SkStackChannel @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, [NotNullWhen(true)] out string? @value) {}
public static bool ExpectCharArray(ref SequenceReader<byte> reader, out ReadOnlyMemory<byte> @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, int length, out uint @value) {}
public static bool ExpectDecimalNumber(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectEndOfLine(ref SequenceReader<byte> reader) {}
public static bool ExpectIPADDR(ref SequenceReader<byte> reader, [NotNullWhen(true)] out IPAddress? @value) {}
public static bool ExpectSequence(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedSequence) {}
public static bool ExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
public static bool ExpectUINT16(ref SequenceReader<byte> reader, out ushort @value) {}
public static bool ExpectUINT32(ref SequenceReader<byte> reader, out uint @value) {}
public static bool ExpectUINT64(ref SequenceReader<byte> reader, out ulong @value) {}
public static bool ExpectUINT8(ref SequenceReader<byte> reader, out byte @value) {}
public static void ToByteSequence(ReadOnlySequence<byte> hexTextSequence, int byteSequenceLength, Span<byte> destination) {}
public static bool TryExpectStatusLine(ref SequenceReader<byte> reader, out SkStackResponseStatus status) {}
public static OperationStatus TryExpectToken(ref SequenceReader<byte> reader, ReadOnlySpan<byte> expectedToken) {}
}
public class SkStackUnexpectedResponseException : SkStackResponseException {
public string? CausedText { get; }
}
}
// 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)
--- Smdn.Net.SkStackIP.latest.nuspec
+++ Smdn.Net.SkStackIP.1.2.0.nuspec
@@ -1,43 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
+<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Smdn.Net.SkStackIP</id>
- <version>1.1.0</version>
+ <version>1.2.0</version>
<title>Smdn.Net.SkStackIP</title>
<authors>smdn</authors>
<license type="expression">MIT</license>
<licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
<icon>Smdn.Net.SkStackIP.png</icon>
<readme>README.md</readme>
<projectUrl>https://github.com/smdn/Smdn.Net.SkStackIP</projectUrl>
<description>Provides APIs for operating devices that implement Skyley Networks' SKSTACK IP.</description>
- <releaseNotes>https://github.com/smdn/Smdn.Net.SkStackIP/releases/tag/releases%2FSmdn.Net.SkStackIP-1.1.0</releaseNotes>
- <copyright>Copyright � 2021 smdn</copyright>
+ <releaseNotes>https://github.com/smdn/Smdn.Net.SkStackIP/releases/tag/releases%2FSmdn.Net.SkStackIP-1.2.0</releaseNotes>
+ <copyright>Copyright © 2021 smdn</copyright>
<tags>smdn.jp SKSTACK,SKSTACK-IP,PANA,Route-B,ECHONET,ECHONET-Lite</tags>
- <repository type="git" url="https://github.com/smdn/Smdn.Net.SkStackIP" branch="main" commit="b1231cf0cca65506f3356620e16e3ecd4cb811c1" />
+ <repository type="git" url="https://github.com/smdn/Smdn.Net.SkStackIP" commit="0e506f4265dfd6eb80e5f98b4486e10a5cda9d99" />
<dependencies>
<group targetFramework="net6.0">
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Polly.Core" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.ControlPicture" version="[3.0.0.1, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.PrintableEncoding.Hexadecimal" version="[3.0.0, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="System.IO.Pipelines" version="8.0.0" exclude="Build,Analyzers" />
</group>
<group targetFramework="net8.0">
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Polly.Core" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.ControlPicture" version="[3.0.0.1, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.PrintableEncoding.Hexadecimal" version="[3.0.0, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="System.IO.Pipelines" version="8.0.0" exclude="Build,Analyzers" />
</group>
<group targetFramework=".NETStandard2.1">
<dependency id="Microsoft.Extensions.Logging.Abstractions" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Polly.Core" version="8.0.0" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.ControlPicture" version="[3.0.0.1, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.Encoding.Buffer" version="[3.0.0, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="Smdn.Fundamental.PrintableEncoding.Hexadecimal" version="[3.0.0, 4.0.0)" exclude="Build,Analyzers" />
<dependency id="System.IO.Pipelines" version="8.0.0" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>
</package>
\ No newline at end of file
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP.csproj b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP.csproj
index 889f770..ea6840a 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP.csproj
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP.csproj
@@ -5,7 +5,7 @@ SPDX-License-Identifier: MIT
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0;netstandard2.1</TargetFrameworks>
- <VersionPrefix>1.1.0</VersionPrefix>
+ <VersionPrefix>1.2.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion>
<Nullable>enable</Nullable>
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackActiveScanOptions.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackActiveScanOptions.cs
index 8ffbb8a..57a96cd 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackActiveScanOptions.cs
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackActiveScanOptions.cs
@@ -11,7 +11,8 @@ namespace Smdn.Net.SkStackIP;
/// <summary>
/// The type for defining the scan intervals (scan duration factors) and the method that selects discovered PANA Authentication Agents (PAA) in the scan for PAA, by the <c>SKSCAN</c> command.
/// </summary>
-/// <seealso cref="SkStackClient.ActiveScanAsync" />
+/// <seealso cref="SkStackClient.ActiveScanAsync(Action{System.Buffers.IBufferWriter{byte}}, Action{System.Buffers.IBufferWriter{byte}}, Smdn.Net.SkStackIP.SkStackActiveScanOptions?, System.Threading.CancellationToken)" />
+/// <seealso cref="SkStackClient.ActiveScanAsync(ReadOnlyMemory{byte}, ReadOnlyMemory{byte}, Smdn.Net.SkStackIP.SkStackActiveScanOptions?, System.Threading.CancellationToken)" />
public abstract class SkStackActiveScanOptions : ICloneable {
/// <summary>
/// Gets the <see cref="SkStackActiveScanOptions"/> which selects the PAA which found at first during the scan.
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETPWD.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETPWD.cs
new file mode 100644
index 0000000..a30c20e
--- /dev/null
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETPWD.cs
@@ -0,0 +1,112 @@
+// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
+// SPDX-License-Identifier: MIT
+using System;
+using System.Buffers;
+#if SYSTEM_TEXT_ASCII
+using System.Text;
+#endif
+using System.Threading;
+using System.Threading.Tasks;
+
+using Smdn.Net.SkStackIP.Protocol;
+
+namespace Smdn.Net.SkStackIP;
+
+#pragma warning disable IDE0040
+partial class SkStackClient {
+#pragma warning restore IDE0040
+ private const int SKSETPWDMinLength = 1;
+ private const int SKSETPWDMaxLength = 32;
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETPWD</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.16. SKSETPWD' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(
+ ReadOnlyMemory<char> password,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (password.Length is not (>= SKSETPWDMinLength and <= SKSETPWDMaxLength))
+ throw new ArgumentException($"length of `{nameof(password)}` must be in range of {SKSETPWDMinLength}~{SKSETPWDMaxLength}", nameof(password));
+#if SYSTEM_TEXT_ASCII
+ if (!Ascii.IsValid(password.Span))
+ throw new ArgumentException($"`{nameof(password)}` contains invalid characters for ASCII sequence", paramName: nameof(password));
+#endif
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETPWD,
+ writeArguments: writer => {
+ writer.WriteTokenUINT8((byte)password.Length, zeroPadding: false);
+ writer.WriteMaskedToken(password.Span);
+ },
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETPWD</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.16. SKSETPWD' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(
+ ReadOnlyMemory<byte> password,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (password.Length is not (>= SKSETPWDMinLength and <= SKSETPWDMaxLength))
+ throw new ArgumentException($"length of `{nameof(password)}` must be in range of {SKSETPWDMinLength}~{SKSETPWDMaxLength}", nameof(password));
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETPWD,
+ writeArguments: writer => {
+ writer.WriteTokenUINT8((byte)password.Length, zeroPadding: false);
+ writer.WriteMaskedToken(password.Span);
+ },
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETPWD</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.16. SKSETPWD' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETPWDAsync(
+ Action<IBufferWriter<byte>> writePassword,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (writePassword is null)
+ throw new ArgumentNullException(nameof(writePassword));
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETPWD,
+ writeArguments: writer => {
+ var buffer = new ArrayBufferWriter<byte>(initialCapacity: SKSETPWDMaxLength);
+
+ try {
+ writePassword(buffer);
+
+ if (buffer.WrittenCount is not (>= SKSETPWDMinLength and <= SKSETPWDMaxLength))
+ throw new InvalidOperationException($"length of argument for {nameof(SkStackCommandNames.SKSETPWD)} must be in range of {SKSETPWDMinLength}~{SKSETPWDMaxLength}");
+
+ writer.WriteTokenUINT8((byte)buffer.WrittenCount, zeroPadding: false);
+ writer.WriteMaskedToken(buffer.WrittenSpan);
+ }
+ finally {
+ // ensure that the content written to the buffer is cleared
+ buffer.Clear();
+ }
+ },
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+}
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETRBID.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETRBID.cs
new file mode 100644
index 0000000..ac4cba4
--- /dev/null
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.SKSETRBID.cs
@@ -0,0 +1,104 @@
+// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
+// SPDX-License-Identifier: MIT
+using System;
+using System.Buffers;
+#if SYSTEM_TEXT_ASCII
+using System.Text;
+#endif
+using System.Threading;
+using System.Threading.Tasks;
+
+using Smdn.Net.SkStackIP.Protocol;
+
+namespace Smdn.Net.SkStackIP;
+
+#pragma warning disable IDE0040
+partial class SkStackClient {
+#pragma warning restore IDE0040
+ private const int SKSETRBIDLengthOfId = 32;
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETRBID</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.17. SKSETRBID' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(
+ ReadOnlyMemory<char> id,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (id.Length != SKSETRBIDLengthOfId)
+ throw new ArgumentException($"length of `{nameof(id)}` must be exact {SKSETRBIDLengthOfId}", nameof(id));
+#if SYSTEM_TEXT_ASCII
+ if (!Ascii.IsValid(id.Span))
+ throw new ArgumentException($"`{nameof(id)}` contains invalid characters for ASCII sequence", paramName: nameof(id));
+#endif
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETRBID,
+ writeArguments: writer => writer.WriteToken(id.Span),
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETRBID</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.17. SKSETRBID' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(
+ ReadOnlyMemory<byte> id,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (id.Length != SKSETRBIDLengthOfId)
+ throw new ArgumentException($"length of `{nameof(id)}` must be exact {SKSETRBIDLengthOfId}", nameof(id));
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETRBID,
+ writeArguments: writer => writer.WriteToken(id.Span),
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+
+ /// <summary>
+ /// <para>Sends a command <c>SKSETRBID</c>.</para>
+ /// </summary>
+ /// <remarks>
+ /// <para>See 'BP35A1コマンドリファレンス 3.17. SKSETRBID' for detailed specifications.</para>
+ /// </remarks>
+ public ValueTask<SkStackResponse> SendSKSETRBIDAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ CancellationToken cancellationToken = default
+ )
+ {
+ if (writeRBID is null)
+ throw new ArgumentNullException(nameof(writeRBID));
+
+ return SendCommandAsync(
+ command: SkStackCommandNames.SKSETRBID,
+ writeArguments: writer => {
+ var buffer = new ArrayBufferWriter<byte>(initialCapacity: SKSETPWDMaxLength);
+
+ try {
+ writeRBID(buffer);
+
+ if (buffer.WrittenCount != SKSETRBIDLengthOfId)
+ throw new InvalidOperationException($"length of argument for {nameof(SkStackCommandNames.SKSETRBID)} must be exact {SKSETRBIDLengthOfId}");
+
+ writer.WriteToken(buffer.WrittenSpan);
+ }
+ finally {
+ // ensure that the content written to the buffer is cleared
+ buffer.Clear();
+ }
+ },
+ throwIfErrorStatus: true,
+ cancellationToken: cancellationToken
+ );
+ }
+}
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.cs
index 4510743..02d3fe3 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.cs
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Commands.cs
@@ -5,9 +5,6 @@
using System;
using System.Net;
using System.Net.NetworkInformation;
-#if SYSTEM_TEXT_ASCII
-using System.Text;
-#endif
using System.Threading;
using System.Threading.Tasks;
@@ -85,113 +82,6 @@ partial class SkStackClient {
/// </remarks>
#endif
- private const int SKSETPWDMinLength = 1;
- private const int SKSETPWDMaxLength = 32;
-
- /// <summary>
- /// <para>Sends a command <c>SKSETPWD</c>.</para>
- /// </summary>
- /// <remarks>
- /// <para>See 'BP35A1コマンドリファレンス 3.16. SKSETPWD' for detailed specifications.</para>
- /// </remarks>
- public ValueTask<SkStackResponse> SendSKSETPWDAsync(
- ReadOnlyMemory<char> password,
- CancellationToken cancellationToken = default
- )
- {
- if (password.Length is not (>= SKSETPWDMinLength and <= SKSETPWDMaxLength))
- throw new ArgumentException($"length of `{nameof(password)}` must be in range of {SKSETPWDMinLength}~{SKSETPWDMaxLength}", nameof(password));
-#if SYSTEM_TEXT_ASCII
- if (!Ascii.IsValid(password.Span))
- throw new ArgumentException($"`{nameof(password)}` contains invalid characters for ASCII sequence", paramName: nameof(password));
-#endif
-
- return SendCommandAsync(
- command: SkStackCommandNames.SKSETPWD,
- writeArguments: writer => {
- writer.WriteTokenUINT8((byte)password.Length, zeroPadding: false);
- writer.WriteMaskedToken(password.Span);
- },
- throwIfErrorStatus: true,
- cancellationToken: cancellationToken
- );
- }
-
- /// <summary>
- /// <para>Sends a command <c>SKSETPWD</c>.</para>
- /// </summary>
- /// <remarks>
- /// <para>See 'BP35A1コマンドリファレンス 3.16. SKSETPWD' for detailed specifications.</para>
- /// </remarks>
- public ValueTask<SkStackResponse> SendSKSETPWDAsync(
- ReadOnlyMemory<byte> password,
- CancellationToken cancellationToken = default
- )
- {
- if (password.Length is not (>= SKSETPWDMinLength and <= SKSETPWDMaxLength))
- throw new ArgumentException($"length of `{nameof(password)}` must be in range of {SKSETPWDMinLength}~{SKSETPWDMaxLength}", nameof(password));
-
- return SendCommandAsync(
- command: SkStackCommandNames.SKSETPWD,
- writeArguments: writer => {
- writer.WriteTokenUINT8((byte)password.Length, zeroPadding: false);
- writer.WriteMaskedToken(password.Span);
- },
- throwIfErrorStatus: true,
- cancellationToken: cancellationToken
- );
- }
-
- private const int SKSETRBIDLengthOfId = 32;
-
- /// <summary>
- /// <para>Sends a command <c>SKSETRBID</c>.</para>
- /// </summary>
- /// <remarks>
- /// <para>See 'BP35A1コマンドリファレンス 3.17. SKSETRBID' for detailed specifications.</para>
- /// </remarks>
- public ValueTask<SkStackResponse> SendSKSETRBIDAsync(
- ReadOnlyMemory<char> id,
- CancellationToken cancellationToken = default
- )
- {
- if (id.Length != SKSETRBIDLengthOfId)
- throw new ArgumentException($"length of `{nameof(id)}` must be exact {SKSETRBIDLengthOfId}", nameof(id));
-#if SYSTEM_TEXT_ASCII
- if (!Ascii.IsValid(id.Span))
- throw new ArgumentException($"`{nameof(id)}` contains invalid characters for ASCII sequence", paramName: nameof(id));
-#endif
-
- return SendCommandAsync(
- command: SkStackCommandNames.SKSETRBID,
- writeArguments: writer => writer.WriteToken(id.Span),
- throwIfErrorStatus: true,
- cancellationToken: cancellationToken
- );
- }
-
- /// <summary>
- /// <para>Sends a command <c>SKSETRBID</c>.</para>
- /// </summary>
- /// <remarks>
- /// <para>See 'BP35A1コマンドリファレンス 3.17. SKSETRBID' for detailed specifications.</para>
- /// </remarks>
- public ValueTask<SkStackResponse> SendSKSETRBIDAsync(
- ReadOnlyMemory<byte> id,
- CancellationToken cancellationToken = default
- )
- {
- if (id.Length != SKSETRBIDLengthOfId)
- throw new ArgumentException($"length of `{nameof(id)}` must be exact {SKSETRBIDLengthOfId}", nameof(id));
-
- return SendCommandAsync(
- command: SkStackCommandNames.SKSETRBID,
- writeArguments: writer => writer.WriteToken(id.Span),
- throwIfErrorStatus: true,
- cancellationToken: cancellationToken
- );
- }
-
/// <summary>
/// <para>Sends a command <c>SKSAVE</c>.</para>
/// </summary>
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.ActiveScan.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.ActiveScan.cs
index 9d75be4..931d370 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.ActiveScan.cs
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.ActiveScan.cs
@@ -1,6 +1,7 @@
// SPDX-FileCopyrightText: 2023 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
using System;
+using System.Buffers;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
@@ -17,15 +18,28 @@ partial class SkStackClient {
CancellationToken cancellationToken = default
)
=> ActiveScanAsyncCore(
- rbid: rbid,
- password: password,
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
+ scanDurationFactorGenerator: (scanOptions ?? SkStackActiveScanOptions.Default).YieldScanDurationFactors(),
+ cancellationToken: cancellationToken
+ );
+
+ public ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
+ SkStackActiveScanOptions? scanOptions = null,
+ CancellationToken cancellationToken = default
+ )
+ => ActiveScanAsyncCore(
+ writeRBID: writeRBID ?? throw new ArgumentNullException(nameof(writeRBID)),
+ writePassword: writePassword ?? throw new ArgumentNullException(nameof(writePassword)),
scanDurationFactorGenerator: (scanOptions ?? SkStackActiveScanOptions.Default).YieldScanDurationFactors(),
cancellationToken: cancellationToken
);
private async ValueTask<IReadOnlyList<SkStackPanDescription>> ActiveScanAsyncCore(
- ReadOnlyMemory<byte>? rbid,
- ReadOnlyMemory<byte>? password,
+ Action<IBufferWriter<byte>>? writeRBID,
+ Action<IBufferWriter<byte>>? writePassword,
IEnumerable<int> scanDurationFactorGenerator,
CancellationToken cancellationToken = default
)
@@ -33,13 +47,11 @@ partial class SkStackClient {
if (scanDurationFactorGenerator is null)
throw new ArgumentNullException(nameof(scanDurationFactorGenerator));
- if (rbid is not null || password is not null) {
+ if (writeRBID is not null || writePassword is not null) {
// If RBID or password is supplied, set them before scanning.
await SetRouteBCredentialAsync(
- rbid: rbid,
- rbidParamName: nameof(rbid),
- password: password,
- passwordParamName: nameof(password),
+ writeRBID: writeRBID,
+ writePassword: writePassword,
cancellationToken: cancellationToken
).ConfigureAwait(false);
}
@@ -67,8 +79,8 @@ partial class SkStackClient {
)
{
var activeScanResult = await ActiveScanAsyncCore(
- rbid: null,
- password: null,
+ writeRBID: null,
+ writePassword: null,
scanDurationFactorGenerator: baseScanOptions.YieldScanDurationFactors(),
cancellationToken: cancellationToken
).ConfigureAwait(false);
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.AuthenticateAsPaC.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.AuthenticateAsPaC.cs
index 9499355..c92e114 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.AuthenticateAsPaC.cs
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.AuthenticateAsPaC.cs
@@ -15,7 +15,7 @@ partial class SkStackClient {
#pragma warning restore IDE0040
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="scanOptions">Options such as scanning behavior when performing active scanning.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
@@ -23,13 +23,31 @@ partial class SkStackClient {
ReadOnlyMemory<byte> password,
SkStackActiveScanOptions? scanOptions = null,
CancellationToken cancellationToken = default
+ )
+ => AuthenticateAsPanaClientAsync(
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
+ scanOptions: scanOptions,
+ cancellationToken: cancellationToken
+ );
+
+ /// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
+ /// <param name="writeRBID">A delegate to write Route-B ID used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="writePassword">A delegate to write Route-B password used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="scanOptions">Options such as scanning behavior when performing active scanning.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
+ SkStackActiveScanOptions? scanOptions = null,
+ CancellationToken cancellationToken = default
)
{
ThrowIfPanaSessionAlreadyEstablished();
return AuthenticateAsPanaClientAsyncCore(
- rbid: rbid,
- password: password,
+ writeRBID: writeRBID ?? throw new ArgumentNullException(nameof(writeRBID)),
+ writePassword: writePassword ?? throw new ArgumentNullException(nameof(writePassword)),
getPaaAddressTask: default,
channel: null,
panId: null,
@@ -40,7 +58,7 @@ partial class SkStackClient {
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="paaAddress">An <see cref="IPAddress"/> representing the IP address of the PANA Authentication Agent (PAA).</param>
/// <param name="channelNumber">A channel number to be used for PANA session.</param>
/// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
@@ -54,8 +72,8 @@ partial class SkStackClient {
CancellationToken cancellationToken = default
)
=> AuthenticateAsPanaClientAsync(
- rbid: rbid,
- password: password,
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
paaAddress: paaAddress,
channel: SkStackChannel.FindByChannelNumber(channelNumber, nameof(channelNumber)),
panId: panId,
@@ -64,7 +82,7 @@ partial class SkStackClient {
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="paaAddress">An <see cref="IPAddress"/> representing the IP address of the PANA Authentication Agent (PAA).</param>
/// <param name="channel">A <see cref="SkStackChannel"/> representing the channel to be used for PANA session.</param>
/// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
@@ -76,6 +94,30 @@ partial class SkStackClient {
SkStackChannel channel,
int panId,
CancellationToken cancellationToken = default
+ )
+ => AuthenticateAsPanaClientAsync(
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
+ paaAddress: paaAddress,
+ channel: channel,
+ panId: panId,
+ cancellationToken: cancellationToken
+ );
+
+ /// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
+ /// <param name="writeRBID">A delegate to write Route-B ID used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="writePassword">A delegate to write Route-B password used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="paaAddress">An <see cref="IPAddress"/> representing the IP address of the PANA Authentication Agent (PAA).</param>
+ /// <param name="channel">A <see cref="SkStackChannel"/> representing the channel to be used for PANA session.</param>
+ /// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
+ IPAddress paaAddress,
+ SkStackChannel channel,
+ int panId,
+ CancellationToken cancellationToken = default
)
{
ThrowIfPanaSessionAlreadyEstablished();
@@ -84,8 +126,8 @@ partial class SkStackClient {
throw new ArgumentException(message: "invalid channel (empty channel)", paramName: nameof(channel));
return AuthenticateAsPanaClientAsyncCore(
- rbid: rbid,
- password: password,
+ writeRBID: writeRBID ?? throw new ArgumentNullException(nameof(writeRBID)),
+ writePassword: writePassword ?? throw new ArgumentNullException(nameof(writePassword)),
getPaaAddressTask: new(paaAddress ?? throw new ArgumentNullException(nameof(paaAddress))),
channel: channel,
panId: ValidatePanIdAndThrowIfInvalid(panId, nameof(panId)),
@@ -96,7 +138,7 @@ partial class SkStackClient {
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="pan">A <see cref="SkStackPanDescription"/> representing the address of the PANA Authentication Agent (PAA), PAN ID, and channel used for PANA session.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
@@ -114,9 +156,29 @@ partial class SkStackClient {
cancellationToken: cancellationToken
);
+ /// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
+ /// <param name="writeRBID">A delegate to write Route-B ID used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="writePassword">A delegate to write Route-B password used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="pan">A <see cref="SkStackPanDescription"/> representing the address of the PANA Authentication Agent (PAA), PAN ID, and channel used for PANA session.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
+ SkStackPanDescription pan,
+ CancellationToken cancellationToken = default
+ )
+ => AuthenticateAsPanaClientAsync(
+ writeRBID: writeRBID,
+ writePassword: writePassword,
+ paaMacAddress: pan.MacAddress,
+ channel: pan.Channel,
+ panId: pan.Id,
+ cancellationToken: cancellationToken
+ );
+
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="paaMacAddress">A <see cref="PhysicalAddress"/> representing the MAC address of the PANA Authentication Agent (PAA).</param>
/// <param name="channelNumber">A channel number to be used for PANA session.</param>
/// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
@@ -130,8 +192,8 @@ partial class SkStackClient {
CancellationToken cancellationToken = default
)
=> AuthenticateAsPanaClientAsync(
- rbid: rbid,
- password: password,
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
paaMacAddress: paaMacAddress,
channel: SkStackChannel.FindByChannelNumber(channelNumber, nameof(channelNumber)),
panId: panId,
@@ -140,7 +202,7 @@ partial class SkStackClient {
/// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
/// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="password">A Route-B password used for PANA authentication.</param>
/// <param name="paaMacAddress">A <see cref="PhysicalAddress"/> representing the MAC address of the PANA Authentication Agent (PAA).</param>
/// <param name="channel">A <see cref="SkStackChannel"/> representing the channel to be used for PANA session.</param>
/// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
@@ -152,13 +214,37 @@ partial class SkStackClient {
SkStackChannel channel,
int panId,
CancellationToken cancellationToken = default
+ )
+ => AuthenticateAsPanaClientAsync(
+ writeRBID: CreateActionForWritingRBID(rbid, nameof(rbid)),
+ writePassword: CreateActionForWritingPassword(password, nameof(password)),
+ paaMacAddress: paaMacAddress,
+ channel: channel,
+ panId: panId,
+ cancellationToken: cancellationToken
+ );
+
+ /// <inheritdoc cref="AuthenticateAsPanaClientAsyncCore"/>
+ /// <param name="writeRBID">A delegate to write Route-B ID used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="writePassword">A delegate to write Route-B password used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="paaMacAddress">A <see cref="PhysicalAddress"/> representing the MAC address of the PANA Authentication Agent (PAA).</param>
+ /// <param name="channel">A <see cref="SkStackChannel"/> representing the channel to be used for PANA session.</param>
+ /// <param name="panId">A Personal Area Network (PAN) ID to be used for PANA session.</param>
+ /// <param name="cancellationToken">The <see cref="CancellationToken" /> to monitor for cancellation requests.</param>
+ public ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsync(
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
+ PhysicalAddress paaMacAddress,
+ SkStackChannel channel,
+ int panId,
+ CancellationToken cancellationToken = default
)
{
ThrowIfPanaSessionAlreadyEstablished();
return AuthenticateAsPanaClientAsyncCore(
- rbid: rbid,
- password: password,
+ writeRBID: writeRBID ?? throw new ArgumentNullException(nameof(writeRBID)),
+ writePassword: writePassword ?? throw new ArgumentNullException(nameof(writePassword)),
#pragma warning disable CA2012, CS8620
getPaaAddressTask: ConvertToIPv6LinkLocalAddressAsync(
paaMacAddress ?? throw new ArgumentNullException(nameof(paaMacAddress)),
@@ -183,8 +269,8 @@ partial class SkStackClient {
/// <summary>
/// Starts the PANA authentication sequence with the current instance as the PaC.
/// </summary>
- /// <param name="rbid">A Route-B ID used for PANA authentication.</param>
- /// <param name="password">A password ID used for PANA authentication.</param>
+ /// <param name="writeRBID">A delegate to write Route-B ID used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
+ /// <param name="writePassword">A delegate to write Route-B password used for PANA authentication to the <see cref="IBufferWriter{Byte}"/>.</param>
/// <param name="getPaaAddressTask">
/// An <see cref="ValueTask{IPAddress}"/> that returns IP address of the PANA Authentication Agent (PAA).
/// If returns <see langword="null"/>, an active scan will be performed to discover the PAAs.
@@ -205,8 +291,8 @@ partial class SkStackClient {
/// <seealso cref="SendSKSETRBIDAsync(ReadOnlyMemory{byte}, CancellationToken)"/>
/// <seealso cref="SendSKSETPWDAsync(ReadOnlyMemory{byte}, CancellationToken)"/>
private async ValueTask<SkStackPanaSessionInfo> AuthenticateAsPanaClientAsyncCore(
- ReadOnlyMemory<byte> rbid,
- ReadOnlyMemory<byte> password,
+ Action<IBufferWriter<byte>> writeRBID,
+ Action<IBufferWriter<byte>> writePassword,
ValueTask<IPAddress?> getPaaAddressTask,
SkStackChannel? channel,
int? panId,
@@ -220,10 +306,8 @@ partial class SkStackClient {
throw new NotSupportedException($"Supplied IP address is not an IPv6 link local address. PAA Address: {paaAddress}");
await SetRouteBCredentialAsync(
- rbid: rbid,
- rbidParamName: nameof(rbid),
- password: password,
- passwordParamName: nameof(password),
+ writeRBID: writeRBID,
+ writePassword: writePassword,
cancellationToken: cancellationToken
).ConfigureAwait(false);
@@ -318,7 +402,9 @@ partial class SkStackClient {
#endif
channelNotNull = channel.Value!;
panIdNotNull = panId.Value!;
+#if !DEBUG
#pragma warning restore CS8629
+#endif
}
// Set channel and PAN ID if needed.
diff --git a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.cs b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.cs
index 3fedde1..29afde5 100644
--- a/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.cs
+++ b/src/Smdn.Net.SkStackIP/Smdn.Net.SkStackIP/SkStackClient.Functions.PANA.cs
@@ -1,7 +1,8 @@
// SPDX-FileCopyrightText: 2021 smdn <smdn@smdn.jp>
// SPDX-License-Identifier: MIT
using System;
-#if SYSTEM_DIAGNOSTICS_CODEANALYSIS_MEMBERNOTNULLATTRIBUTE || SYSTEM_DIAGNOSTICS_CODEANALYSIS_MEMBERNOTNULLWHENATTRIBUTE
+using System.Buffers;
+#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES || SYSTEM_DIAGNOSTICS_CODEANALYSIS_MEMBERNOTNULLATTRIBUTE || SYSTEM_DIAGNOSTICS_CODEANALYSIS_MEMBERNOTNULLWHENATTRIBUTE
using System.Diagnostics.CodeAnalysis;
#endif
using System.Net;
@@ -39,30 +40,56 @@ partial class SkStackClient {
throw new InvalidOperationException("PANA session has been already established.");
}
- private async ValueTask SetRouteBCredentialAsync(
+#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES
+ [return: NotNullIfNotNull(nameof(rbid))]
+#endif
+ private static Action<IBufferWriter<byte>>? CreateActionForWritingRBID(
ReadOnlyMemory<byte>? rbid,
- string rbidParamName,
- ReadOnlyMemory<byte>? password,
- string passwordParamName,
- CancellationToken cancellationToken
+ string rbidParamName
)
{
- if (rbid is not null) {
+ if (rbid is null)
+ return null;
+
if (rbid.Value.IsEmpty)
throw new ArgumentException("must be non-empty string", rbidParamName ?? nameof(rbid));
- _ = await SendSKSETRBIDAsync(
- id: rbid.Value,
- cancellationToken: cancellationToken
- ).ConfigureAwait(false);
+ return new(writer => writer.Write(rbid.Value.Span));
}
- if (password is not null) {
+#if NULL_STATE_STATIC_ANALYSIS_ATTRIBUTES
+ [return: NotNullIfNotNull(nameof(password))]
+#endif
+ private static Action<IBufferWriter<byte>>? CreateActionForWritingPassword(
+ ReadOnlyMemory<byte>? password,
+ string passwordParamName
+ )
+ {
+ if (password is null)
+ return null;
+
if (password.Value.IsEmpty)
throw new ArgumentException("must be non-empty string", passwordParamName ?? nameof(password));
+ return new(writer => writer.Write(password.Value.Span));
+ }
+
+ private async ValueTask SetRouteBCredentialAsync(
+ Action<IBufferWriter<byte>>? writeRBID,
+ Action<IBufferWriter<byte>>? writePassword,
+ CancellationToken cancellationToken
+ )
+ {
+ if (writeRBID is not null) {
+ _ = await SendSKSETRBIDAsync(
+ writeRBID: writeRBID,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+
+ if (writePassword is not null) {
_ = await SendSKSETPWDAsync(
- password: password.Value,
+ writePassword: writePassword,
cancellationToken: cancellationToken
).ConfigureAwait(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment