Skip to content

Commit 1b9021e

Browse files
committed
Regen_all checked in.
1 parent cf2e8ab commit 1b9021e

File tree

35 files changed

+756
-342
lines changed

35 files changed

+756
-342
lines changed

examples/all-clusters-app/all-clusters-common/all-clusters-app.matter

+18-8
Original file line numberDiff line numberDiff line change
@@ -4069,7 +4069,7 @@ cluster ElectricalEnergyMeasurement = 145 {
40694069

40704070
/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */
40714071
provisional cluster DeviceEnergyManagement = 152 {
4072-
revision 3;
4072+
revision 4;
40734073

40744074
enum AdjustmentCauseEnum : enum8 {
40754075
kLocalOptimization = 0;
@@ -4130,6 +4130,12 @@ provisional cluster DeviceEnergyManagement = 152 {
41304130
kOptOut = 3;
41314131
}
41324132

4133+
enum PowerAdjustReasonEnum : enum8 {
4134+
kNoAdjustment = 0;
4135+
kLocalOptimizationAdjustment = 1;
4136+
kGridOptimizationAdjustment = 2;
4137+
}
4138+
41334139
bitmap Feature : bitmap32 {
41344140
kPowerAdjustment = 0x1;
41354141
kPowerForecastReporting = 0x2;
@@ -4153,7 +4159,7 @@ provisional cluster DeviceEnergyManagement = 152 {
41534159
elapsed_s defaultDuration = 2;
41544160
elapsed_s elapsedSlotTime = 3;
41554161
elapsed_s remainingSlotTime = 4;
4156-
optional boolean slotIsPauseable = 5;
4162+
optional boolean slotIsPausable = 5;
41574163
optional elapsed_s minPauseDuration = 6;
41584164
optional elapsed_s maxPauseDuration = 7;
41594165
optional int16u manufacturerESAState = 8;
@@ -4169,13 +4175,13 @@ provisional cluster DeviceEnergyManagement = 152 {
41694175
}
41704176

41714177
struct ForecastStruct {
4172-
int16u forecastId = 0;
4178+
int32u forecastId = 0;
41734179
nullable int16u activeSlotNumber = 1;
41744180
epoch_s startTime = 2;
41754181
epoch_s endTime = 3;
41764182
optional nullable epoch_s earliestStartTime = 4;
41774183
optional epoch_s latestEndTime = 5;
4178-
boolean isPauseable = 6;
4184+
boolean isPausable = 6;
41794185
SlotStruct slots[] = 7;
41804186
ForecastUpdateReasonEnum forecastUpdateReason = 8;
41814187
}
@@ -4193,11 +4199,12 @@ provisional cluster DeviceEnergyManagement = 152 {
41934199
power_mw maxPower = 1;
41944200
elapsed_s minDuration = 2;
41954201
elapsed_s maxDuration = 3;
4202+
PowerAdjustReasonEnum cause = 4;
41964203
}
41974204

41984205
struct SlotAdjustmentStruct {
41994206
int8u slotIndex = 0;
4200-
power_mw nominalPower = 1;
4207+
optional power_mw nominalPower = 1;
42014208
elapsed_s duration = 2;
42024209
}
42034210

@@ -4279,7 +4286,7 @@ provisional cluster DeviceEnergyManagement = 152 {
42794286

42804287
/** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */
42814288
cluster EnergyEvse = 153 {
4282-
revision 2;
4289+
revision 4;
42834290

42844291
enum EnergyTransferStoppedReasonEnum : enum8 {
42854292
kEVStopped = 0;
@@ -4323,6 +4330,7 @@ cluster EnergyEvse = 153 {
43234330
kDischargingEnabled = 2;
43244331
kDisabledError = 3;
43254332
kDisabledDiagnostics = 4;
4333+
kEnabled = 5;
43264334
}
43274335

43284336
bitmap Feature : bitmap32 {
@@ -4350,8 +4358,8 @@ cluster EnergyEvse = 153 {
43504358
}
43514359

43524360
struct ChargingTargetScheduleStruct {
4353-
TargetDayOfWeekBitmap dayOfWeekForSequence = 0;
4354-
ChargingTargetStruct chargingTargets[] = 1;
4361+
optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0;
4362+
optional ChargingTargetStruct chargingTargets[] = 1;
43554363
}
43564364

43574365
info event EVConnected = 0 {
@@ -4370,13 +4378,15 @@ cluster EnergyEvse = 153 {
43704378
int32u sessionID = 0;
43714379
StateEnum state = 1;
43724380
amperage_ma maximumCurrent = 2;
4381+
optional amperage_ma maximumDischargingCurrent = 3;
43734382
}
43744383

43754384
info event EnergyTransferStopped = 3 {
43764385
int32u sessionID = 0;
43774386
StateEnum state = 1;
43784387
EnergyTransferStoppedReasonEnum reason = 2;
43794388
energy_mwh energyTransferred = 4;
4389+
optional energy_mwh energyDischarged = 5;
43804390
}
43814391

43824392
critical event Fault = 4 {

src/controller/data_model/controller-clusters.matter

+18-8
Original file line numberDiff line numberDiff line change
@@ -4594,7 +4594,7 @@ provisional cluster Messages = 151 {
45944594

45954595
/** This cluster allows a client to manage the power draw of a device. An example of such a client could be an Energy Management System (EMS) which controls an Energy Smart Appliance (ESA). */
45964596
provisional cluster DeviceEnergyManagement = 152 {
4597-
revision 3;
4597+
revision 4;
45984598

45994599
enum AdjustmentCauseEnum : enum8 {
46004600
kLocalOptimization = 0;
@@ -4655,6 +4655,12 @@ provisional cluster DeviceEnergyManagement = 152 {
46554655
kOptOut = 3;
46564656
}
46574657

4658+
enum PowerAdjustReasonEnum : enum8 {
4659+
kNoAdjustment = 0;
4660+
kLocalOptimizationAdjustment = 1;
4661+
kGridOptimizationAdjustment = 2;
4662+
}
4663+
46584664
bitmap Feature : bitmap32 {
46594665
kPowerAdjustment = 0x1;
46604666
kPowerForecastReporting = 0x2;
@@ -4678,7 +4684,7 @@ provisional cluster DeviceEnergyManagement = 152 {
46784684
elapsed_s defaultDuration = 2;
46794685
elapsed_s elapsedSlotTime = 3;
46804686
elapsed_s remainingSlotTime = 4;
4681-
optional boolean slotIsPauseable = 5;
4687+
optional boolean slotIsPausable = 5;
46824688
optional elapsed_s minPauseDuration = 6;
46834689
optional elapsed_s maxPauseDuration = 7;
46844690
optional int16u manufacturerESAState = 8;
@@ -4694,13 +4700,13 @@ provisional cluster DeviceEnergyManagement = 152 {
46944700
}
46954701

46964702
struct ForecastStruct {
4697-
int16u forecastId = 0;
4703+
int32u forecastId = 0;
46984704
nullable int16u activeSlotNumber = 1;
46994705
epoch_s startTime = 2;
47004706
epoch_s endTime = 3;
47014707
optional nullable epoch_s earliestStartTime = 4;
47024708
optional epoch_s latestEndTime = 5;
4703-
boolean isPauseable = 6;
4709+
boolean isPausable = 6;
47044710
SlotStruct slots[] = 7;
47054711
ForecastUpdateReasonEnum forecastUpdateReason = 8;
47064712
}
@@ -4718,11 +4724,12 @@ provisional cluster DeviceEnergyManagement = 152 {
47184724
power_mw maxPower = 1;
47194725
elapsed_s minDuration = 2;
47204726
elapsed_s maxDuration = 3;
4727+
PowerAdjustReasonEnum cause = 4;
47214728
}
47224729

47234730
struct SlotAdjustmentStruct {
47244731
int8u slotIndex = 0;
4725-
power_mw nominalPower = 1;
4732+
optional power_mw nominalPower = 1;
47264733
elapsed_s duration = 2;
47274734
}
47284735

@@ -4804,7 +4811,7 @@ provisional cluster DeviceEnergyManagement = 152 {
48044811

48054812
/** Electric Vehicle Supply Equipment (EVSE) is equipment used to charge an Electric Vehicle (EV) or Plug-In Hybrid Electric Vehicle. This cluster provides an interface to the functionality of Electric Vehicle Supply Equipment (EVSE) management. */
48064813
cluster EnergyEvse = 153 {
4807-
revision 2;
4814+
revision 4;
48084815

48094816
enum EnergyTransferStoppedReasonEnum : enum8 {
48104817
kEVStopped = 0;
@@ -4848,6 +4855,7 @@ cluster EnergyEvse = 153 {
48484855
kDischargingEnabled = 2;
48494856
kDisabledError = 3;
48504857
kDisabledDiagnostics = 4;
4858+
kEnabled = 5;
48514859
}
48524860

48534861
bitmap Feature : bitmap32 {
@@ -4875,8 +4883,8 @@ cluster EnergyEvse = 153 {
48754883
}
48764884

48774885
struct ChargingTargetScheduleStruct {
4878-
TargetDayOfWeekBitmap dayOfWeekForSequence = 0;
4879-
ChargingTargetStruct chargingTargets[] = 1;
4886+
optional TargetDayOfWeekBitmap dayOfWeekForSequence = 0;
4887+
optional ChargingTargetStruct chargingTargets[] = 1;
48804888
}
48814889

48824890
info event EVConnected = 0 {
@@ -4895,13 +4903,15 @@ cluster EnergyEvse = 153 {
48954903
int32u sessionID = 0;
48964904
StateEnum state = 1;
48974905
amperage_ma maximumCurrent = 2;
4906+
optional amperage_ma maximumDischargingCurrent = 3;
48984907
}
48994908

49004909
info event EnergyTransferStopped = 3 {
49014910
int32u sessionID = 0;
49024911
StateEnum state = 1;
49034912
EnergyTransferStoppedReasonEnum reason = 2;
49044913
energy_mwh energyTransferred = 4;
4914+
optional energy_mwh energyDischarged = 5;
49054915
}
49064916

49074917
critical event Fault = 4 {

src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java

+34-4
Original file line numberDiff line numberDiff line change
@@ -4323,25 +4323,30 @@ public static class EnergyEvseClusterEnergyTransferStartedEvent {
43234323
public Long sessionID;
43244324
public Integer state;
43254325
public Long maximumCurrent;
4326+
public Optional<Long> maximumDischargingCurrent;
43264327
private static final long SESSION_I_D_ID = 0L;
43274328
private static final long STATE_ID = 1L;
43284329
private static final long MAXIMUM_CURRENT_ID = 2L;
4330+
private static final long MAXIMUM_DISCHARGING_CURRENT_ID = 3L;
43294331

43304332
public EnergyEvseClusterEnergyTransferStartedEvent(
43314333
Long sessionID,
43324334
Integer state,
4333-
Long maximumCurrent
4335+
Long maximumCurrent,
4336+
Optional<Long> maximumDischargingCurrent
43344337
) {
43354338
this.sessionID = sessionID;
43364339
this.state = state;
43374340
this.maximumCurrent = maximumCurrent;
4341+
this.maximumDischargingCurrent = maximumDischargingCurrent;
43384342
}
43394343

43404344
public StructType encodeTlv() {
43414345
ArrayList<StructElement> values = new ArrayList<>();
43424346
values.add(new StructElement(SESSION_I_D_ID, new UIntType(sessionID)));
43434347
values.add(new StructElement(STATE_ID, new UIntType(state)));
43444348
values.add(new StructElement(MAXIMUM_CURRENT_ID, new IntType(maximumCurrent)));
4349+
values.add(new StructElement(MAXIMUM_DISCHARGING_CURRENT_ID, maximumDischargingCurrent.<BaseTLVType>map((nonOptionalmaximumDischargingCurrent) -> new IntType(nonOptionalmaximumDischargingCurrent)).orElse(new EmptyType())));
43454350

43464351
return new StructType(values);
43474352
}
@@ -4353,6 +4358,7 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType
43534358
Long sessionID = null;
43544359
Integer state = null;
43554360
Long maximumCurrent = null;
4361+
Optional<Long> maximumDischargingCurrent = Optional.empty();
43564362
for (StructElement element: ((StructType)tlvValue).value()) {
43574363
if (element.contextTagNum() == SESSION_I_D_ID) {
43584364
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -4369,12 +4375,18 @@ public static EnergyEvseClusterEnergyTransferStartedEvent decodeTlv(BaseTLVType
43694375
IntType castingValue = element.value(IntType.class);
43704376
maximumCurrent = castingValue.value(Long.class);
43714377
}
4378+
} else if (element.contextTagNum() == MAXIMUM_DISCHARGING_CURRENT_ID) {
4379+
if (element.value(BaseTLVType.class).type() == TLVType.Int) {
4380+
IntType castingValue = element.value(IntType.class);
4381+
maximumDischargingCurrent = Optional.of(castingValue.value(Long.class));
4382+
}
43724383
}
43734384
}
43744385
return new EnergyEvseClusterEnergyTransferStartedEvent(
43754386
sessionID,
43764387
state,
4377-
maximumCurrent
4388+
maximumCurrent,
4389+
maximumDischargingCurrent
43784390
);
43794391
}
43804392

@@ -4391,6 +4403,9 @@ public String toString() {
43914403
output.append("\tmaximumCurrent: ");
43924404
output.append(maximumCurrent);
43934405
output.append("\n");
4406+
output.append("\tmaximumDischargingCurrent: ");
4407+
output.append(maximumDischargingCurrent);
4408+
output.append("\n");
43944409
output.append("}\n");
43954410
return output.toString();
43964411
}
@@ -4400,21 +4415,25 @@ public static class EnergyEvseClusterEnergyTransferStoppedEvent {
44004415
public Integer state;
44014416
public Integer reason;
44024417
public Long energyTransferred;
4418+
public Optional<Long> energyDischarged;
44034419
private static final long SESSION_I_D_ID = 0L;
44044420
private static final long STATE_ID = 1L;
44054421
private static final long REASON_ID = 2L;
44064422
private static final long ENERGY_TRANSFERRED_ID = 4L;
4423+
private static final long ENERGY_DISCHARGED_ID = 5L;
44074424

44084425
public EnergyEvseClusterEnergyTransferStoppedEvent(
44094426
Long sessionID,
44104427
Integer state,
44114428
Integer reason,
4412-
Long energyTransferred
4429+
Long energyTransferred,
4430+
Optional<Long> energyDischarged
44134431
) {
44144432
this.sessionID = sessionID;
44154433
this.state = state;
44164434
this.reason = reason;
44174435
this.energyTransferred = energyTransferred;
4436+
this.energyDischarged = energyDischarged;
44184437
}
44194438

44204439
public StructType encodeTlv() {
@@ -4423,6 +4442,7 @@ public StructType encodeTlv() {
44234442
values.add(new StructElement(STATE_ID, new UIntType(state)));
44244443
values.add(new StructElement(REASON_ID, new UIntType(reason)));
44254444
values.add(new StructElement(ENERGY_TRANSFERRED_ID, new IntType(energyTransferred)));
4445+
values.add(new StructElement(ENERGY_DISCHARGED_ID, energyDischarged.<BaseTLVType>map((nonOptionalenergyDischarged) -> new IntType(nonOptionalenergyDischarged)).orElse(new EmptyType())));
44264446

44274447
return new StructType(values);
44284448
}
@@ -4435,6 +4455,7 @@ public static EnergyEvseClusterEnergyTransferStoppedEvent decodeTlv(BaseTLVType
44354455
Integer state = null;
44364456
Integer reason = null;
44374457
Long energyTransferred = null;
4458+
Optional<Long> energyDischarged = Optional.empty();
44384459
for (StructElement element: ((StructType)tlvValue).value()) {
44394460
if (element.contextTagNum() == SESSION_I_D_ID) {
44404461
if (element.value(BaseTLVType.class).type() == TLVType.UInt) {
@@ -4456,13 +4477,19 @@ public static EnergyEvseClusterEnergyTransferStoppedEvent decodeTlv(BaseTLVType
44564477
IntType castingValue = element.value(IntType.class);
44574478
energyTransferred = castingValue.value(Long.class);
44584479
}
4480+
} else if (element.contextTagNum() == ENERGY_DISCHARGED_ID) {
4481+
if (element.value(BaseTLVType.class).type() == TLVType.Int) {
4482+
IntType castingValue = element.value(IntType.class);
4483+
energyDischarged = Optional.of(castingValue.value(Long.class));
4484+
}
44594485
}
44604486
}
44614487
return new EnergyEvseClusterEnergyTransferStoppedEvent(
44624488
sessionID,
44634489
state,
44644490
reason,
4465-
energyTransferred
4491+
energyTransferred,
4492+
energyDischarged
44664493
);
44674494
}
44684495

@@ -4482,6 +4509,9 @@ public String toString() {
44824509
output.append("\tenergyTransferred: ");
44834510
output.append(energyTransferred);
44844511
output.append("\n");
4512+
output.append("\tenergyDischarged: ");
4513+
output.append(energyDischarged);
4514+
output.append("\n");
44854515
output.append("}\n");
44864516
return output.toString();
44874517
}

0 commit comments

Comments
 (0)