Skip to content

Commit

Permalink
Fix member naming for the MultiPressComplete event. (#23895)
Browse files Browse the repository at this point in the history
It's called PreviousPosition, not NewPosition.

Fixes #23872
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Feb 14, 2024
1 parent eb2fcd9 commit 1744436
Show file tree
Hide file tree
Showing 42 changed files with 100 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1514,7 +1514,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/bridge-app/bridge-common/bridge-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_fan_7N2TobIlOX.matter
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/lighting-common/lighting-app.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app1/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ client cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down Expand Up @@ -1210,7 +1210,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions examples/placeholder/linux/apps/app2/config.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ client cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down Expand Up @@ -1210,7 +1210,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ server cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
4 changes: 2 additions & 2 deletions src/app/clusters/switch-server/switch-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ void SwitchServer::OnMultiPressOngoing(EndpointId endpoint, uint8_t newPosition,
}
}

void SwitchServer::OnMultiPressComplete(EndpointId endpoint, uint8_t newPosition, uint8_t count)
void SwitchServer::OnMultiPressComplete(EndpointId endpoint, uint8_t previousPosition, uint8_t count)
{
ChipLogProgress(Zcl, "SwitchServer: OnMultiPressComplete");

// Record MultiPressComplete event
EventNumber eventNumber;
Events::MultiPressComplete::Type event{ newPosition, count };
Events::MultiPressComplete::Type event{ previousPosition, count };

if (CHIP_NO_ERROR != LogEvent(event, endpoint, eventNumber))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Interactions with the switch device are exposed as attributes (for the latching
</event>
<event side="server" code="0x06" priority="info" name="MultiPressComplete" optional="true">
<description>MultiPress Complete</description>
<field id="0" name="NewPosition" type="INT8U" />
<field id="0" name="PreviousPosition" type="INT8U" />
<field id="1" name="TotalNumberOfPressesCounted" type="INT8U" />
</event>

Expand Down
2 changes: 1 addition & 1 deletion src/controller/data_model/controller-clusters.matter
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ client cluster Switch = 59 {
}

info event MultiPressComplete = 6 {
INT8U newPosition = 0;
INT8U previousPosition = 0;
INT8U totalNumberOfPressesCounted = 1;
}

Expand Down
14 changes: 7 additions & 7 deletions src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/controller/python/chip/clusters/Objects.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions src/darwin/Framework/CHIP/templates/MTRStructsObjc-src.zapt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ NS_ASSUME_NONNULL_BEGIN
return descriptionString;
}

{{#if (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) "Switch")}}
{{#if (isStrEqual (asUpperCamelCase name preserveAcronyms=true) "MultiPressComplete")}}
{{! Workaround for the name being mis-spelled in XML previously }}
- (void)setNewPosition:(NSNumber * _Nonnull)newPosition
{
self.previousPosition = newPosition;
}

- (NSNumber * _Nonnull)newPosition
{
return self.previousPosition;
}

{{/if}}
{{/if}}
@end
{{#unless (isStrEqual (asUpperCamelCase parent.name preserveAcronyms=true) (compatClusterNameRemapping parent.name))}}

Expand Down
Loading

0 comments on commit 1744436

Please sign in to comment.