Skip to content

Commit 8ae0f44

Browse files
committed
Documentation
1 parent 623b939 commit 8ae0f44

19 files changed

+242
-23
lines changed

ZWaveDotNet/CommandClasses/ApplicationCapability.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
namespace ZWaveDotNet.CommandClasses
2222
{
23+
/// <summary>
24+
/// The Application Capability Command Class comprises commands for handling issues related to dynamic support for command classes.
25+
/// </summary>
2326
[CCVersion(CommandClass.ApplicationCapability)]
2427
public class ApplicationCapability : CommandClassBase
2528
{

ZWaveDotNet/CommandClasses/ApplicationStatus.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818

1919
namespace ZWaveDotNet.CommandClasses
2020
{
21+
/// <summary>
22+
/// This command class contains commands that are not directly related to a specific functionality in the application,
23+
/// but are useful for maintaining an optimal Z-Wave system.
24+
/// </summary>
2125
[CCVersion(CommandClass.ApplicationStatus)]
2226
public class ApplicationStatus : CommandClassBase
2327
{

ZWaveDotNet/CommandClasses/Association.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
namespace ZWaveDotNet.CommandClasses
2121
{
22+
/// <summary>
23+
/// The Association Command Class is used to manage associations to NodeID destinations.
24+
/// A NodeID destination may be a simple device or the Root Device of a Multi Channel device.
25+
/// </summary>
2226
[CCVersion(CommandClass.Association, 1, 3)]
2327
public class Association : CommandClassBase
2428
{
@@ -36,28 +40,58 @@ enum AssociationCommand
3640
}
3741
public Association(Node node, byte endpoint) : base(node, endpoint, CommandClass.Association) { }
3842

43+
/// <summary>
44+
/// <b>Version 1</b>: Request the current destinations of a given association group
45+
/// </summary>
46+
/// <param name="groupID"></param>
47+
/// <param name="cancellationToken"></param>
48+
/// <returns></returns>
3949
public async Task<AssociationReport> Get(byte groupID, CancellationToken cancellationToken = default)
4050
{
4151
ReportMessage response = await SendReceive(AssociationCommand.Get, AssociationCommand.Report, cancellationToken, groupID);
4252
return new AssociationReport(response.Payload.Span);
4353
}
4454

55+
/// <summary>
56+
/// <b>Version 2</b>: This command allows a portable controller to interactively create associations from a multi-button device to a destination that is out of direct range.
57+
/// </summary>
58+
/// <param name="cancellationToken"></param>
59+
/// <returns></returns>
4560
public async Task<byte> GetSpecific(CancellationToken cancellationToken = default)
4661
{
4762
var response = await SendReceive(AssociationCommand.SpecificGroupGet, AssociationCommand.SpecificGroupReport, cancellationToken);
4863
return response.Payload.Span[0];
4964
}
5065

66+
/// <summary>
67+
/// <b>Version 1</b>: Add destinations to a given association group
68+
/// </summary>
69+
/// <param name="groupID"></param>
70+
/// <param name="cancellationToken"></param>
71+
/// <param name="nodeIDs"></param>
72+
/// <returns></returns>
5173
public async Task Add(byte groupID, CancellationToken cancellationToken, params byte[] nodeIDs)
5274
{
5375
await SendCommand(AssociationCommand.Set, cancellationToken, nodeIDs.Prepend(groupID).ToArray());
5476
}
5577

78+
/// <summary>
79+
/// <b>Version 1</b>: Remove destinations from a given association group
80+
/// </summary>
81+
/// <param name="groupID"></param>
82+
/// <param name="cancellationToken"></param>
83+
/// <param name="nodeIDs"></param>
84+
/// <returns></returns>
5685
public async Task Remove(byte groupID, CancellationToken cancellationToken, params byte[] nodeIDs)
5786
{
5887
await SendCommand(AssociationCommand.Remove, cancellationToken, nodeIDs.Prepend(groupID).ToArray());
5988
}
6089

90+
/// <summary>
91+
/// <b>Version 1</b>: Request the number of association groups that this node supports
92+
/// </summary>
93+
/// <param name="cancellationToken"></param>
94+
/// <returns></returns>
6195
public async Task<AssociationGroupsReport> GetGroups(CancellationToken cancellationToken = default)
6296
{
6397
ReportMessage response = await SendReceive(AssociationCommand.GroupingsGet, AssociationCommand.GroupingsReport, cancellationToken);

ZWaveDotNet/CommandClasses/BarrierOperator.cs

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
namespace ZWaveDotNet.CommandClasses
2424
{
25+
/// <summary>
26+
/// The Barrier Operator Command Class is used to control and query the status of motorized barriers.
27+
/// </summary>
2528
[CCVersion(CommandClass.BarrierOperator, 1)]
2629
public class BarrierOperator : CommandClassBase
2730
{
@@ -41,6 +44,12 @@ enum BarrierOperatorCommand : byte
4144

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

47+
/// <summary>
48+
/// Request the current state of a barrier operator device
49+
/// </summary>
50+
/// <param name="cancellationToken"></param>
51+
/// <returns></returns>
52+
/// <exception cref="MethodAccessException"></exception>
4453
public async Task<BarrierReport> Get(CancellationToken cancellationToken = default)
4554
{
4655
if (node.ID == Node.BROADCAST_ID)
@@ -49,11 +58,22 @@ public async Task<BarrierReport> Get(CancellationToken cancellationToken = defau
4958
return new BarrierReport(response.Payload.Span);
5059
}
5160

61+
/// <summary>
62+
/// Initiate an unattended change in state of the barrier
63+
/// </summary>
64+
/// <param name="open"></param>
65+
/// <param name="cancellationToken"></param>
66+
/// <returns></returns>
5267
public async Task Set(bool open, CancellationToken cancellationToken = default)
5368
{
5469
await SendCommand(BarrierOperatorCommand.Set, cancellationToken, open ? (byte)0xFF : (byte)0x00);
5570
}
5671

72+
/// <summary>
73+
/// Query a device for available subsystems which may be controlled via Z-Wave
74+
/// </summary>
75+
/// <param name="cancellationToken"></param>
76+
/// <returns></returns>
5777
public async Task<BarrierSignal[]> GetSupportedSignals(CancellationToken cancellationToken = default)
5878
{
5979
ReportMessage response = await SendReceive(BarrierOperatorCommand.SupportedGet, BarrierOperatorCommand.SupportedReport, cancellationToken);
@@ -67,11 +87,26 @@ public async Task<BarrierSignal[]> GetSupportedSignals(CancellationToken cancell
6787
return supportedTypes.ToArray();
6888
}
6989

90+
/// <summary>
91+
/// Turn on or off an event signaling subsystem that is supported by the device
92+
/// </summary>
93+
/// <param name="signal"></param>
94+
/// <param name="active"></param>
95+
/// <param name="cancellationToken"></param>
96+
/// <returns></returns>
7097
public async Task SignalSet(BarrierSignal signal, bool active, CancellationToken cancellationToken = default)
7198
{
7299
await SendCommand(BarrierOperatorCommand.Set, cancellationToken, (byte)signal, active ? (byte)0xFF : (byte)0x00);
73100
}
74101

102+
/// <summary>
103+
/// Request the state of a signaling subsystem to a supporting node
104+
/// </summary>
105+
/// <param name="signal"></param>
106+
/// <param name="cancellationToken"></param>
107+
/// <returns></returns>
108+
/// <exception cref="MethodAccessException"></exception>
109+
/// <exception cref="DataException"></exception>
75110
public async Task<KeyValuePair<BarrierSignal, bool>> SignalGet(BarrierSignal signal, CancellationToken cancellationToken = default)
76111
{
77112
if (node.ID == Node.BROADCAST_ID)

ZWaveDotNet/CommandClasses/Basic.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919

2020
namespace ZWaveDotNet.CommandClasses
2121
{
22+
/// <summary>
23+
/// The Basic Command Class allows a controlling device to operate the primary functionality of a supporting device without any further knowledge.
24+
/// </summary>
2225
[CCVersion(CommandClass.Basic, 2)]
2326
public class Basic : CommandClassBase
2427
{
@@ -33,6 +36,12 @@ enum BasicCommand : byte
3336

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

39+
/// <summary>
40+
/// <b>Version 1</b>: Request the status of a supporting device
41+
/// </summary>
42+
/// <param name="cancellationToken"></param>
43+
/// <returns></returns>
44+
/// <exception cref="MethodAccessException"></exception>
3645
public async Task<BasicReport> Get(CancellationToken cancellationToken = default)
3746
{
3847
if (node.ID == Node.BROADCAST_ID)
@@ -41,6 +50,12 @@ public async Task<BasicReport> Get(CancellationToken cancellationToken = default
4150
return new BasicReport(response.Payload.Span);
4251
}
4352

53+
/// <summary>
54+
/// <b>Version 1</b>: Set a value in a supporting device
55+
/// </summary>
56+
/// <param name="value"></param>
57+
/// <param name="cancellationToken"></param>
58+
/// <returns></returns>
4459
public async Task Set(byte value, CancellationToken cancellationToken = default)
4560
{
4661
await SendCommand(BasicCommand.Set, cancellationToken, value);

ZWaveDotNet/CommandClasses/CRC16.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ public enum CRC16Command
3030

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

33-
public static bool IsEncapsulated(ReportMessage msg)
33+
internal static bool IsEncapsulated(ReportMessage msg)
3434
{
3535
return msg.CommandClass == CommandClass.CRC16 && msg.Command == (byte)CRC16Command.Encap;
3636
}
3737

38-
public static void Encapsulate (List<byte> payload)
38+
internal static void Encapsulate (List<byte> payload)
3939
{
4040
byte[] header = new byte[]
4141
{

ZWaveDotNet/CommandClasses/DeviceResetLocally.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
// You should have received a copy of the GNU Affero General Public License
1111
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1212

13-
using ZWaveDotNet.Entities;
14-
using ZWaveDotNet.SerialAPI;
15-
using ZWaveDotNet.Enums;
1613
using Serilog;
1714
using ZWaveDotNet.CommandClassReports.Enums;
15+
using ZWaveDotNet.Entities;
16+
using ZWaveDotNet.Enums;
17+
using ZWaveDotNet.SerialAPI;
1818

1919
namespace ZWaveDotNet.CommandClasses
2020
{
21+
/// <summary>
22+
/// This Command Class is used to notify central controllers that a Z-Wave device is resetting its network specific parameters.
23+
/// </summary>
2124
[CCVersion(CommandClass.DeviceResetLocally)]
2225
public class DeviceResetLocally : CommandClassBase
2326
{

ZWaveDotNet/CommandClasses/MultiChannel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ public async Task<List<byte>> GetAggregatedMembers(byte endpointId, Cancellation
7878
return ret;
7979
}
8080

81-
public static bool IsEncapsulated(ReportMessage msg)
81+
internal static bool IsEncapsulated(ReportMessage msg)
8282
{
8383
return msg.CommandClass == CommandClass.MultiChannel && msg.Command == (byte)MultiChannelCommand.Encap;
8484
}
8585

86-
public static void Encapsulate (List<byte> payload, byte destinationEndpoint)
86+
internal static void Encapsulate (List<byte> payload, byte destinationEndpoint)
8787
{
8888
byte[] header = new byte[]
8989
{

ZWaveDotNet/CommandClasses/MultiCommand.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ public enum MultiCommandCommand
2626
}
2727
public MultiCommand(Node node, byte endpoint) : base(node, endpoint, CommandClass.MultiCommand) { }
2828

29-
public static bool IsEncapsulated(ReportMessage msg)
29+
internal static bool IsEncapsulated(ReportMessage msg)
3030
{
3131
return msg.CommandClass == CommandClass.MultiCommand && msg.Command == (byte)MultiCommandCommand.Encap;
3232
}
3333

34-
public static void Encapsulate (List<byte> payload, List<CommandMessage> commands)
34+
internal static void Encapsulate (List<byte> payload, List<CommandMessage> commands)
3535
{
3636
payload.Clear();
3737
payload.Add((byte)CommandClass.MultiCommand);

ZWaveDotNet/CommandClasses/SceneActivation.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818

1919
namespace ZWaveDotNet.CommandClasses
2020
{
21+
/// <summary>
22+
/// This Command Class is used for launching scenes in a number of actuator nodes e.g. another scene-controlling unit, a multilevel switch, a binary switch etc.
23+
/// </summary>
2124
[CCVersion(CommandClass.SceneActivation)]
2225
public class SceneActivation : CommandClassBase
2326
{
@@ -28,9 +31,15 @@ enum SceneActivationCommand : byte
2831

2932
public SceneActivation(Node node, byte endpoint) : base(node, endpoint, CommandClass.SceneActivation) { }
3033

34+
/// <summary>
35+
/// Activate the scene associated to the scene ID
36+
/// </summary>
37+
/// <param name="sceneId"></param>
38+
/// <param name="duration"></param>
39+
/// <param name="cancellationToken"></param>
40+
/// <returns></returns>
3141
public async Task Set(byte sceneId, TimeSpan duration, CancellationToken cancellationToken = default)
3242
{
33-
3443
await SendCommand(SceneActivationCommand.Set, cancellationToken, sceneId, PayloadConverter.GetByte(duration));
3544
}
3645

0 commit comments

Comments
 (0)