Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jdomnitz committed Nov 15, 2024
1 parent 489770c commit 70d3ba4
Show file tree
Hide file tree
Showing 127 changed files with 1,315 additions and 275 deletions.
25 changes: 25 additions & 0 deletions ZWaveDotNet/CommandClassReports/EmptyReport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ZWaveDotNet Copyright (C) 2024
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

namespace ZWaveDotNet.CommandClassReports
{
/// <summary>
/// An empty report
/// </summary>
public class EmptyReport : ICommandClassReport
{
public override string ToString()
{
return "Empty Report";
}
}
}
29 changes: 29 additions & 0 deletions ZWaveDotNet/CommandClassReports/ProprietaryReport.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// ZWaveDotNet Copyright (C) 2024
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY, without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Affero General Public License for more details.
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

namespace ZWaveDotNet.CommandClassReports
{
/// <summary>
/// Proprietary Information
/// </summary>
public class ProprietaryReport : ICommandClassReport
{
/// <summary>
/// The raw data
/// </summary>
public readonly Memory<byte> Data;
internal ProprietaryReport(Memory<byte> payload)
{
Data = payload;
}
}
}
10 changes: 8 additions & 2 deletions ZWaveDotNet/CommandClasses/Alarm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.Alarm, 1, 2)]
public class Alarm : CommandClassBase

Check warning on line 24 in ZWaveDotNet/CommandClasses/Alarm.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'Alarm'
{
/// <summary>
/// Unsolicited Alarm Report
/// </summary>
public event CommandClassEvent<AlarmReport>? Updated;

enum AlarmCommand
Expand All @@ -34,7 +37,7 @@ enum AlarmCommand
SupportedReport = 0x08
}

public Alarm(Node node, byte endpoint) : base(node, endpoint, CommandClass.Alarm) { }
internal Alarm(Node node, byte endpoint) : base(node, endpoint, CommandClass.Alarm) { }

public async Task<AlarmReport> Get(CancellationToken cancellationToken = default)

Check warning on line 42 in ZWaveDotNet/CommandClasses/Alarm.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'Alarm.Get(CancellationToken)'
{
Expand All @@ -54,7 +57,10 @@ public async Task<AlarmSupportedReport> SupportedGet(CancellationToken cancellat
return new AlarmSupportedReport(response.Payload.Span);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)AlarmCommand.Report)
{
Expand Down
7 changes: 5 additions & 2 deletions ZWaveDotNet/CommandClasses/AntiTheftUnlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.AntiTheftUnlock, 1)]
public class AntiTheftUnlock : CommandClassBase
{
/// <summary>
/// Unsolicited AntiTheft Unlock Report
/// </summary>
public event CommandClassEvent<AntiTheftUnlockReport>? Report;

enum AntiTheftUnlockCommand : byte
Expand All @@ -35,7 +38,7 @@ enum AntiTheftUnlockCommand : byte

}

public AntiTheftUnlock(Node node, byte endpoint) : base(node, endpoint, CommandClass.AntiTheftUnlock) { }
internal AntiTheftUnlock(Node node, byte endpoint) : base(node, endpoint, CommandClass.AntiTheftUnlock) { }

/// <summary>
/// <b>Version 1</b>: This command is used to request the locked/unlocked state of the node.
Expand Down Expand Up @@ -64,7 +67,7 @@ public async Task Set(byte[] magicCode, CancellationToken cancellationToken = de
await SendCommand(AntiTheftUnlockCommand.Set, cancellationToken, magicCode);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)AntiTheftUnlockCommand.Report)
{
Expand Down
7 changes: 5 additions & 2 deletions ZWaveDotNet/CommandClasses/ApplicationCapability.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ public class ApplicationCapability : CommandClassBase
{
public event CommandClassEvent<ApplicationCapabilityReport>? CommandClassUnsupported;

Check warning on line 29 in ZWaveDotNet/CommandClasses/ApplicationCapability.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'ApplicationCapability.CommandClassUnsupported'

public ApplicationCapability(Node node, byte endpoint) : base(node, endpoint, CommandClass.ApplicationCapability) { }
internal ApplicationCapability(Node node, byte endpoint) : base(node, endpoint, CommandClass.ApplicationCapability) { }

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
await FireEvent(CommandClassUnsupported, new ApplicationCapabilityReport(message.Payload.Span));
return SupervisionStatus.Success;
Expand Down
9 changes: 6 additions & 3 deletions ZWaveDotNet/CommandClasses/ApplicationStatus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,20 @@ namespace ZWaveDotNet.CommandClasses
public class ApplicationStatus : CommandClassBase
{
public event CommandClassEvent<ApplicationStatusReport>? ApplicationBusy;
public event CommandClassEvent<ReportMessage>? RequestRejected;
public event CommandClassEvent<EmptyReport>? RequestRejected;

enum ApplicationStatusCommands
{
Busy = 0x1,
RejectedRequest = 0x2
}

public ApplicationStatus(Node node, byte endpoint) : base(node, endpoint, CommandClass.ApplicationStatus) { }
internal ApplicationStatus(Node node, byte endpoint) : base(node, endpoint, CommandClass.ApplicationStatus) { }

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
switch ((ApplicationStatusCommands)message.Command)
{
Expand Down
8 changes: 6 additions & 2 deletions ZWaveDotNet/CommandClasses/Association.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enum AssociationCommand
SpecificGroupGet = 0x0B,
SpecificGroupReport = 0x0C
}
public Association(Node node, byte endpoint) : base(node, endpoint, CommandClass.Association) { }
internal Association(Node node, byte endpoint) : base(node, endpoint, CommandClass.Association) { }

/// <summary>
/// <b>Version 1</b>: Request the current destinations of a given association group
Expand Down Expand Up @@ -98,13 +98,17 @@ public async Task<AssociationGroupsReport> GetGroups(CancellationToken cancellat
return new AssociationGroupsReport(response.Payload.Span);
}

///
/// <inheritdoc />
///
public override async Task Interview(CancellationToken cancellationToken = default)
{
await Add(LIFELINE_GROUP, cancellationToken, (byte)controller.ID);
Log.Information("Assigned Lifeline Group");
}

protected override Task<SupervisionStatus> Handle(ReportMessage message)
/// <inheritdoc />
internal override Task<SupervisionStatus> Handle(ReportMessage message)
{
//Nothing Unsolicited
return Task.FromResult(SupervisionStatus.NoSupport);
Expand Down
10 changes: 8 additions & 2 deletions ZWaveDotNet/CommandClasses/AssociationGroupInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.AssociationGroupInformation, 1, 3)]
public class AssociationGroupInformation : CommandClassBase
{
/// <summary>
/// Unsolicited Association Group Info Report
/// </summary>
public event CommandClassEvent<AssociationGroupsInfoReport>? Report;
enum AssociationGroupCommand : byte
{
Expand All @@ -38,7 +41,7 @@ enum AssociationGroupCommand : byte
CommandListReport = 0x6,
}

public AssociationGroupInformation(Node node, byte endpoint) : base(node, endpoint, CommandClass.AssociationGroupInformation) { }
internal AssociationGroupInformation(Node node, byte endpoint) : base(node, endpoint, CommandClass.AssociationGroupInformation) { }

/// <summary>
/// <b>Version 1</b>: Request the properties of one or more association group
Expand Down Expand Up @@ -88,7 +91,10 @@ public async Task<AssociationGroupCommandListReport> GetCommandList(byte groupNu
return new AssociationGroupCommandListReport(response.Payload.Span);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)AssociationGroupCommand.InfoReport)
{
Expand Down
7 changes: 5 additions & 2 deletions ZWaveDotNet/CommandClasses/BarrierOperator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ enum BarrierOperatorCommand : byte
SignalReport = 0x08
}

public BarrierOperator(Node node, byte endpoint) : base(node, endpoint, CommandClass.BarrierOperator) { }
internal BarrierOperator(Node node, byte endpoint) : base(node, endpoint, CommandClass.BarrierOperator) { }

/// <summary>
/// Request the current state of a barrier operator device
Expand Down Expand Up @@ -117,7 +117,10 @@ public async Task<KeyValuePair<BarrierSignal, bool>> SignalGet(BarrierSignal sig
return KeyValuePair.Create((BarrierSignal)response.Payload.Span[0], response.Payload.Span[1] != 0x0);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)BarrierOperatorCommand.Report)
{
Expand Down
7 changes: 5 additions & 2 deletions ZWaveDotNet/CommandClasses/Basic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.Basic, 2)]
public class Basic : CommandClassBase
{
/// <summary>
/// Unsolicited Basic Report
/// </summary>
public event CommandClassEvent<BasicReport>? Report;

enum BasicCommand : byte
Expand All @@ -34,7 +37,7 @@ enum BasicCommand : byte
Report = 0x03
}

public Basic(Node node, byte endpoint) : base(node, endpoint, CommandClass.Basic) { }
internal Basic(Node node, byte endpoint) : base(node, endpoint, CommandClass.Basic) { }

/// <summary>
/// <b>Version 1</b>: Request the status of a supporting device
Expand All @@ -61,7 +64,7 @@ public async Task Set(byte value, CancellationToken cancellationToken = default)
await SendCommand(BasicCommand.Set, cancellationToken, value);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)BasicCommand.Report)
{
Expand Down
10 changes: 8 additions & 2 deletions ZWaveDotNet/CommandClasses/BasicTariff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.BasicTariff)]
public class BasicTariff : CommandClassBase
{
/// <summary>
/// Unsolicited Basic Tariff Report
/// </summary>
public event CommandClassEvent<BasicTariffReport>? Report;

enum BasicTariffCommand : byte
Expand All @@ -30,7 +33,7 @@ enum BasicTariffCommand : byte
Report = 0x02
}

public BasicTariff(Node node, byte endpoint) : base(node, endpoint, CommandClass.BasicTariff) { }
internal BasicTariff(Node node, byte endpoint) : base(node, endpoint, CommandClass.BasicTariff) { }

public async Task<BasicTariffReport> Get(CancellationToken cancellationToken = default)
{
Expand All @@ -41,7 +44,10 @@ public async Task<BasicTariffReport> Get(CancellationToken cancellationToken = d
return new BasicTariffReport(response.Payload.Span);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)BasicTariffCommand.Report)
{
Expand Down
4 changes: 2 additions & 2 deletions ZWaveDotNet/CommandClasses/BasicWindowCovering.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ enum BasicCommand : byte
StopLevelChange = 0x02
}

public BasicWindowCovering(Node node, byte endpoint) : base(node, endpoint, CommandClass.BasicWindowCovering) { }
internal BasicWindowCovering(Node node, byte endpoint) : base(node, endpoint, CommandClass.BasicWindowCovering) { }


public async Task StartLevelChange(bool close, CancellationToken cancellationToken = default)
Expand All @@ -39,7 +39,7 @@ public async Task StopLevelChange(CancellationToken cancellationToken = default)
await SendCommand(BasicCommand.StopLevelChange, cancellationToken);
}

protected override Task<SupervisionStatus> Handle(ReportMessage message)
internal override Task<SupervisionStatus> Handle(ReportMessage message)
{
//No Reports
return Task.FromResult(SupervisionStatus.NoSupport);
Expand Down
10 changes: 8 additions & 2 deletions ZWaveDotNet/CommandClasses/Battery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace ZWaveDotNet.CommandClasses
[CCVersion(CommandClass.Battery, 3)]
public class Battery : CommandClassBase
{
/// <summary>
/// Unsolicited Battery Level Report
/// </summary>
public event CommandClassEvent<BatteryLevelReport>? Status;

enum BatteryCommand
Expand All @@ -35,7 +38,7 @@ enum BatteryCommand
HealthReport = 0x05
}

public Battery(Node node, byte endpoint) : base(node, endpoint, CommandClass.Battery) { }
internal Battery(Node node, byte endpoint) : base(node, endpoint, CommandClass.Battery) { }

/// <summary>
/// <b>Version 1</b>: The Battery Get Command is used to request the level of a battery.
Expand All @@ -59,7 +62,10 @@ public async Task<BatteryHealthReport> GetHealth(CancellationToken cancellationT
return new BatteryHealthReport(response.Payload.Span);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)BatteryCommand.Report)
{
Expand Down
4 changes: 2 additions & 2 deletions ZWaveDotNet/CommandClasses/CRC16.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public enum CRC16Command
Encap = 0x01
}

public CRC16(Node node, byte endpoint) : base(node, endpoint, CommandClass.CRC16) { }
internal CRC16(Node node, byte endpoint) : base(node, endpoint, CommandClass.CRC16) { }

internal static bool IsEncapsulated(ReportMessage msg)
{
Expand Down Expand Up @@ -63,7 +63,7 @@ internal static void Unwrap(ReportMessage msg)
msg.Flags |= ReportFlags.EnhancedChecksum;
}

protected override Task<SupervisionStatus> Handle(ReportMessage message)
internal override Task<SupervisionStatus> Handle(ReportMessage message)
{
//No Reports
return Task.FromResult(SupervisionStatus.NoSupport);
Expand Down
7 changes: 5 additions & 2 deletions ZWaveDotNet/CommandClasses/CentralScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum CentralSceneCommand : byte
ConfigReport = 0x06
}

public CentralScene(Node node, byte endpoint) : base(node, endpoint, CommandClass.CentralScene) { }
internal CentralScene(Node node, byte endpoint) : base(node, endpoint, CommandClass.CentralScene) { }

public async Task<CentralSceneSupportedReport> GetSupported(CancellationToken cancellationToken = default)
{
Expand All @@ -61,7 +61,10 @@ public async Task SetConfiguration(bool slowRefresh, CancellationToken cancellat
await SendCommand(CentralSceneCommand.ConfigSet, cancellationToken, slowRefresh ? (byte)0x80 : (byte)0x0);
}

protected override async Task<SupervisionStatus> Handle(ReportMessage message)
///
/// <inheritdoc />
///
internal override async Task<SupervisionStatus> Handle(ReportMessage message)
{
if (message.Command == (byte)CentralSceneCommand.Notification)
{
Expand Down
Loading

0 comments on commit 70d3ba4

Please sign in to comment.