Skip to content

Commit da52460

Browse files
committed
Regenerate 1.4 clusters (complete)
1 parent 77673fb commit da52460

File tree

146 files changed

+13734
-8391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+13734
-8391
lines changed

MatterDotNet/Clusters/Application/AccountLoginCluster.cs

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,41 @@
1818
using MatterDotNet.Protocol.Sessions;
1919
using MatterDotNet.Protocol.Subprotocols;
2020

21-
namespace MatterDotNet.Clusters.Application
21+
namespace MatterDotNet.Clusters.Media
2222
{
2323
/// <summary>
24-
/// Account Login Cluster
24+
/// This cluster provides commands that facilitate user account login on a Content App or a node. For example, a Content App running on a Video Player device, which is represented as an endpoint (see [TV Architecture]), can use this cluster to help make the user account on the Content App match the user account on the Client.
2525
/// </summary>
2626
[ClusterRevision(CLUSTER_ID, 2)]
27-
public class AccountLoginCluster : ClusterBase
27+
public class AccountLogin : ClusterBase
2828
{
29-
internal const uint CLUSTER_ID = 0x050E;
29+
internal const uint CLUSTER_ID = 0x050e;
3030

3131
/// <summary>
32-
/// Account Login Cluster
32+
/// This cluster provides commands that facilitate user account login on a Content App or a node. For example, a Content App running on a Video Player device, which is represented as an endpoint (see [TV Architecture]), can use this cluster to help make the user account on the Content App match the user account on the Client.
3333
/// </summary>
34-
public AccountLoginCluster(ushort endPoint) : base(CLUSTER_ID, endPoint) { }
34+
public AccountLogin(ushort endPoint) : base(CLUSTER_ID, endPoint) { }
3535
/// <inheritdoc />
36-
protected AccountLoginCluster(uint cluster, ushort endPoint) : base(cluster, endPoint) { }
36+
protected AccountLogin(uint cluster, ushort endPoint) : base(cluster, endPoint) { }
3737

3838
#region Payloads
3939
private record GetSetupPINPayload : TLVPayload {
4040
public required string TempAccountIdentifier { get; set; }
4141
internal override void Serialize(TLVWriter writer, long structNumber = -1) {
4242
writer.StartStructure(structNumber);
43-
writer.WriteString(0, TempAccountIdentifier, 100, 16);
43+
writer.WriteString(0, TempAccountIdentifier, 100);
4444
writer.EndContainer();
4545
}
4646
}
4747

48-
/// <summary>
49-
/// Get Setup PIN Response - Reply from server
50-
/// </summary>
51-
public struct GetSetupPINResponse() {
52-
public required string SetupPIN { get; set; }
53-
}
54-
5548
private record LoginPayload : TLVPayload {
5649
public required string TempAccountIdentifier { get; set; }
5750
public required string SetupPIN { get; set; }
5851
public ulong? Node { get; set; }
5952
internal override void Serialize(TLVWriter writer, long structNumber = -1) {
6053
writer.StartStructure(structNumber);
61-
writer.WriteString(0, TempAccountIdentifier, 100, 16);
62-
writer.WriteString(1, SetupPIN, int.MaxValue, 8);
54+
writer.WriteString(0, TempAccountIdentifier, 100);
55+
writer.WriteString(1, SetupPIN);
6356
if (Node != null)
6457
writer.WriteULong(2, Node);
6558
writer.EndContainer();
@@ -75,15 +68,22 @@ internal override void Serialize(TLVWriter writer, long structNumber = -1) {
7568
writer.EndContainer();
7669
}
7770
}
71+
72+
/// <summary>
73+
/// Get Setup PIN Response - Reply from server
74+
/// </summary>
75+
public struct GetSetupPINResponse() {
76+
public required string SetupPIN { get; set; }
77+
}
7878
#endregion Payloads
7979

8080
#region Commands
8181
/// <summary>
8282
/// Get Setup PIN
8383
/// </summary>
84-
public async Task<GetSetupPINResponse?> GetSetupPIN(SecureSession session, ushort commandTimeoutMS, string TempAccountIdentifier) {
84+
public async Task<GetSetupPINResponse?> GetSetupPIN(SecureSession session, ushort commandTimeoutMS, string tempAccountIdentifier) {
8585
GetSetupPINPayload requestFields = new GetSetupPINPayload() {
86-
TempAccountIdentifier = TempAccountIdentifier,
86+
TempAccountIdentifier = tempAccountIdentifier,
8787
};
8888
InvokeResponseIB resp = await InteractionManager.ExecTimedCommand(session, endPoint, cluster, 0x00, commandTimeoutMS, requestFields);
8989
if (!ValidateResponse(resp))
@@ -96,11 +96,11 @@ internal override void Serialize(TLVWriter writer, long structNumber = -1) {
9696
/// <summary>
9797
/// Login
9898
/// </summary>
99-
public async Task<bool> Login(SecureSession session, ushort commandTimeoutMS, string TempAccountIdentifier, string SetupPIN, ulong? Node) {
99+
public async Task<bool> Login(SecureSession session, ushort commandTimeoutMS, string tempAccountIdentifier, string setupPIN, ulong? node) {
100100
LoginPayload requestFields = new LoginPayload() {
101-
TempAccountIdentifier = TempAccountIdentifier,
102-
SetupPIN = SetupPIN,
103-
Node = Node,
101+
TempAccountIdentifier = tempAccountIdentifier,
102+
SetupPIN = setupPIN,
103+
Node = node,
104104
};
105105
InvokeResponseIB resp = await InteractionManager.ExecTimedCommand(session, endPoint, cluster, 0x02, commandTimeoutMS, requestFields);
106106
return ValidateResponse(resp);
@@ -109,9 +109,9 @@ public async Task<bool> Login(SecureSession session, ushort commandTimeoutMS, st
109109
/// <summary>
110110
/// Logout
111111
/// </summary>
112-
public async Task<bool> Logout(SecureSession session, ushort commandTimeoutMS, ulong? Node) {
112+
public async Task<bool> Logout(SecureSession session, ushort commandTimeoutMS, ulong? node) {
113113
LogoutPayload requestFields = new LogoutPayload() {
114-
Node = Node,
114+
Node = node,
115115
};
116116
InvokeResponseIB resp = await InteractionManager.ExecTimedCommand(session, endPoint, cluster, 0x03, commandTimeoutMS, requestFields);
117117
return ValidateResponse(resp);
@@ -121,7 +121,7 @@ public async Task<bool> Logout(SecureSession session, ushort commandTimeoutMS, u
121121

122122
/// <inheritdoc />
123123
public override string ToString() {
124-
return "Account Login Cluster";
124+
return "Account Login";
125125
}
126126
}
127127
}

0 commit comments

Comments
 (0)