Skip to content

Commit c53d771

Browse files
Updates Service Area with name changes since 0.7 (#34711)
* Updated the golabl data type's XMLs, removing the cluster entries. * Zap generated after XML update. * Fixed namespaces used of global structs. * Restyled by clang-format * Renamed LocationInfoStruct to AreaInfoStruct. * Zap generated after XML update. * Renamed LocationStruct to AreaStruct and its LocationID and LocationDesc fields. * Zap generated after XML update. * Updated SDK and example code to match the new naming. * Updated the ProgressStruct's LocationID name to AreaID. * Zap generated after XML update. * Updated the SDK code following name changes. * Updated the SelectLocationsStatus and SkipLocationStatus enum names and some of their enums. * Zap generated after XML update. * Updated the SelectLocationsStatus and SkipCurrentLocationStatus names and their enum names. * Updated the names of the SupportedLocations, SelectedLocations and CurrentLocation attributes. * Zap generated after XML update. * Updated the changed names in the SDK. * Updated the service area command names in XML. * Zap generated after XML update. * Updated the service area command names in the SDK. * Updated the rvc-example zap file. * Refactored LocationStructureWrapper to AreaStructureWrapper. * Restyled by clang-format * Regenerated zap files due to changes upsteram. * Removed unused generated file. * spacing changes form zap regen. * Fixed minor mistake during merge. --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent bbef51a commit c53d771

File tree

55 files changed

+1418
-1465
lines changed

Some content is hidden

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

55 files changed

+1418
-1465
lines changed

examples/rvc-app/rvc-common/include/rvc-service-area-delegate.h

+18-18
Original file line numberDiff line numberDiff line change
@@ -35,39 +35,39 @@ class RvcServiceAreaDelegate : public Delegate
3535
{
3636
private:
3737
// containers for array attributes.
38-
std::vector<ServiceArea::LocationStructureWrapper> mSupportedLocations;
38+
std::vector<ServiceArea::AreaStructureWrapper> mSupportedAreas;
3939
std::vector<ServiceArea::MapStructureWrapper> mSupportedMaps;
40-
std::vector<uint32_t> mSelectedLocations;
40+
std::vector<uint32_t> mSelectedAreas;
4141
std::vector<ServiceArea::Structs::ProgressStruct::Type> mProgressList;
4242

4343
public:
4444
CHIP_ERROR Init() override;
4545

4646
// command support
47-
bool IsSetSelectedLocationsAllowed(MutableCharSpan statusText) override;
47+
bool IsSetSelectedAreasAllowed(MutableCharSpan statusText) override;
4848

49-
bool IsValidSelectLocationsSet(const ServiceArea::Commands::SelectLocations::DecodableType & req,
50-
ServiceArea::SelectLocationsStatus & locationStatus, MutableCharSpan statusText) override;
49+
bool IsValidSelectAreasSet(const ServiceArea::Commands::SelectAreas::DecodableType & req,
50+
ServiceArea::SelectAreasStatus & locationStatus, MutableCharSpan statusText) override;
5151

52-
bool HandleSkipCurrentLocation(MutableCharSpan skipStatusText) override;
52+
bool HandleSkipCurrentArea(MutableCharSpan skipStatusText) override;
5353

5454
//*************************************************************************
5555
// Supported Locations accessors
5656

57-
bool IsSupportedLocationsChangeAllowed() override;
57+
bool IsSupportedAreasChangeAllowed() override;
5858

59-
uint32_t GetNumberOfSupportedLocations() override;
59+
uint32_t GetNumberOfSupportedAreas() override;
6060

61-
bool GetSupportedLocationByIndex(uint32_t listIndex, ServiceArea::LocationStructureWrapper & supportedLocation) override;
61+
bool GetSupportedLocationByIndex(uint32_t listIndex, ServiceArea::AreaStructureWrapper & supportedLocation) override;
6262

63-
bool GetSupportedLocationById(uint32_t aLocationId, uint32_t & listIndex,
64-
ServiceArea::LocationStructureWrapper & supportedLocation) override;
63+
bool GetSupportedLocationById(uint32_t aAreaId, uint32_t & listIndex,
64+
ServiceArea::AreaStructureWrapper & supportedLocation) override;
6565

66-
bool AddSupportedLocation(const ServiceArea::LocationStructureWrapper & newLocation, uint32_t & listIndex) override;
66+
bool AddSupportedLocation(const ServiceArea::AreaStructureWrapper & newArea, uint32_t & listIndex) override;
6767

68-
bool ModifySupportedLocation(uint32_t listIndex, const ServiceArea::LocationStructureWrapper & modifiedLocation) override;
68+
bool ModifySupportedLocation(uint32_t listIndex, const ServiceArea::AreaStructureWrapper & modifiedLocation) override;
6969

70-
bool ClearSupportedLocations() override;
70+
bool ClearSupportedAreas() override;
7171

7272
//*************************************************************************
7373
// Supported Maps accessors
@@ -89,15 +89,15 @@ class RvcServiceAreaDelegate : public Delegate
8989
//*************************************************************************
9090
// Selected Locations accessors
9191

92-
uint32_t GetNumberOfSelectedLocations() override;
92+
uint32_t GetNumberOfSelectedAreas() override;
9393

9494
bool GetSelectedLocationByIndex(uint32_t listIndex, uint32_t & selectedLocation) override;
9595

9696
// IsSelectedLocation() no override
9797

98-
bool AddSelectedLocation(uint32_t aLocationId, uint32_t & listIndex) override;
98+
bool AddSelectedLocation(uint32_t aAreaId, uint32_t & listIndex) override;
9999

100-
bool ClearSelectedLocations() override;
100+
bool ClearSelectedAreas() override;
101101

102102
//*************************************************************************
103103
// Progress accessors
@@ -106,7 +106,7 @@ class RvcServiceAreaDelegate : public Delegate
106106

107107
bool GetProgressElementByIndex(uint32_t listIndex, ServiceArea::Structs::ProgressStruct::Type & aProgressElement) override;
108108

109-
bool GetProgressElementById(uint32_t aLocationId, uint32_t & listIndex,
109+
bool GetProgressElementById(uint32_t aAreaId, uint32_t & listIndex,
110110
ServiceArea::Structs::ProgressStruct::Type & aProgressElement) override;
111111

112112
bool AddProgressElement(const ServiceArea::Structs::ProgressStruct::Type & newProgressElement, uint32_t & listIndex) override;

examples/rvc-app/rvc-common/rvc-app.matter

+30-30
Original file line numberDiff line numberDiff line change
@@ -1421,17 +1421,17 @@ provisional cluster ServiceArea = 336 {
14211421
kCompleted = 3;
14221422
}
14231423

1424-
enum SelectLocationsStatus : enum8 {
1424+
enum SelectAreasStatus : enum8 {
14251425
kSuccess = 0;
1426-
kUnsupportedLocation = 1;
1427-
kDuplicatedLocations = 2;
1426+
kUnsupportedArea = 1;
1427+
kDuplicatedAreas = 2;
14281428
kInvalidInMode = 3;
14291429
kInvalidSet = 4;
14301430
}
14311431

1432-
enum SkipCurrentLocationStatus : enum8 {
1432+
enum SkipAreaStatus : enum8 {
14331433
kSuccess = 0;
1434-
kInvalidLocationList = 1;
1434+
kInvalidAreaList = 1;
14351435
kInvalidInMode = 2;
14361436
}
14371437

@@ -1440,17 +1440,17 @@ provisional cluster ServiceArea = 336 {
14401440
kSelectWhileRunning = 0x2;
14411441
}
14421442

1443-
struct LocationInfoStruct {
1443+
struct AreaInfoStruct {
14441444
nullable LocationDescriptorStruct locationInfo = 0;
14451445
nullable LandmarkTag landmarkTag = 1;
14461446
nullable PositionTag positionTag = 2;
14471447
nullable FloorSurfaceTag surfaceTag = 3;
14481448
}
14491449

1450-
struct LocationStruct {
1451-
int32u locationID = 0;
1450+
struct AreaStruct {
1451+
int32u areaID = 0;
14521452
nullable int8u mapID = 1;
1453-
LocationInfoStruct locationInfo = 2;
1453+
AreaInfoStruct areaDesc = 2;
14541454
}
14551455

14561456
struct MapStruct {
@@ -1459,16 +1459,16 @@ provisional cluster ServiceArea = 336 {
14591459
}
14601460

14611461
struct ProgressStruct {
1462-
int32u locationID = 0;
1462+
int32u areaID = 0;
14631463
OperationalStatusEnum status = 1;
14641464
optional nullable elapsed_s totalOperationalTime = 2;
14651465
optional nullable elapsed_s estimatedTime = 3;
14661466
}
14671467

1468-
readonly attribute LocationStruct supportedLocations[] = 0;
1468+
readonly attribute AreaStruct supportedAreas[] = 0;
14691469
readonly attribute nullable MapStruct supportedMaps[] = 1;
1470-
readonly attribute nullable int32u selectedLocations[] = 2;
1471-
readonly attribute optional nullable int32u currentLocation = 3;
1470+
readonly attribute nullable int32u selectedAreas[] = 2;
1471+
readonly attribute optional nullable int32u currentArea = 3;
14721472
readonly attribute optional nullable epoch_s estimatedEndTime = 4;
14731473
readonly attribute optional nullable ProgressStruct progress[] = 5;
14741474
readonly attribute command_id generatedCommandList[] = 65528;
@@ -1478,24 +1478,24 @@ provisional cluster ServiceArea = 336 {
14781478
readonly attribute bitmap32 featureMap = 65532;
14791479
readonly attribute int16u clusterRevision = 65533;
14801480

1481-
request struct SelectLocationsRequest {
1482-
nullable int32u newLocations[] = 0;
1481+
request struct SelectAreasRequest {
1482+
nullable int32u newAreas[] = 0;
14831483
}
14841484

1485-
response struct SelectLocationsResponse = 1 {
1486-
SelectLocationsStatus status = 0;
1485+
response struct SelectAreasResponse = 1 {
1486+
SelectAreasStatus status = 0;
14871487
optional char_string<256> statusText = 1;
14881488
}
14891489

1490-
response struct SkipCurrentLocationResponse = 3 {
1491-
SkipCurrentLocationStatus status = 0;
1490+
response struct SkipAreaResponse = 3 {
1491+
SkipAreaStatus status = 0;
14921492
optional char_string<256> statusText = 1;
14931493
}
14941494

1495-
/** Command used to select a set of device locations, where the device is to operate */
1496-
command SelectLocations(SelectLocationsRequest): SelectLocationsResponse = 0;
1497-
/** This command is used to skip the current location where the device operates. */
1498-
command SkipCurrentLocation(): SkipCurrentLocationResponse = 2;
1495+
/** Command used to select a set of device areas, where the device is to operate. */
1496+
command SelectAreas(SelectAreasRequest): SelectAreasResponse = 0;
1497+
/** This command is used to skip an area where the device operates. */
1498+
command SkipArea(): SkipAreaResponse = 2;
14991499
}
15001500

15011501
endpoint 0 {
@@ -1755,10 +1755,10 @@ endpoint 1 {
17551755
}
17561756

17571757
server cluster ServiceArea {
1758-
callback attribute supportedLocations;
1758+
callback attribute supportedAreas;
17591759
callback attribute supportedMaps;
1760-
callback attribute selectedLocations;
1761-
callback attribute currentLocation;
1760+
callback attribute selectedAreas;
1761+
callback attribute currentArea;
17621762
callback attribute estimatedEndTime;
17631763
callback attribute progress;
17641764
callback attribute generatedCommandList;
@@ -1768,10 +1768,10 @@ endpoint 1 {
17681768
callback attribute featureMap;
17691769
ram attribute clusterRevision default = 1;
17701770

1771-
handle command SelectLocations;
1772-
handle command SelectLocationsResponse;
1773-
handle command SkipCurrentLocation;
1774-
handle command SkipCurrentLocationResponse;
1771+
handle command SelectAreas;
1772+
handle command SelectAreasResponse;
1773+
handle command SkipArea;
1774+
handle command SkipAreaResponse;
17751775
}
17761776
}
17771777

examples/rvc-app/rvc-common/rvc-app.zap

+11-10
Original file line numberDiff line numberDiff line change
@@ -2885,33 +2885,34 @@
28852885
"define": "SERVICE_AREA_CLUSTER",
28862886
"side": "server",
28872887
"enabled": 1,
2888+
"apiMaturity": "provisional",
28882889
"commands": [
28892890
{
2890-
"name": "SelectLocations",
2891+
"name": "SelectAreas",
28912892
"code": 0,
28922893
"mfgCode": null,
28932894
"source": "client",
28942895
"isIncoming": 1,
28952896
"isEnabled": 1
28962897
},
28972898
{
2898-
"name": "SelectLocationsResponse",
2899+
"name": "SelectAreasResponse",
28992900
"code": 1,
29002901
"mfgCode": null,
29012902
"source": "server",
29022903
"isIncoming": 0,
29032904
"isEnabled": 1
29042905
},
29052906
{
2906-
"name": "SkipCurrent",
2907+
"name": "SkipArea",
29072908
"code": 2,
29082909
"mfgCode": null,
29092910
"source": "client",
29102911
"isIncoming": 1,
29112912
"isEnabled": 1
29122913
},
29132914
{
2914-
"name": "SkipCurrentResponse",
2915+
"name": "SkipAreaResponse",
29152916
"code": 3,
29162917
"mfgCode": null,
29172918
"source": "server",
@@ -2921,7 +2922,7 @@
29212922
],
29222923
"attributes": [
29232924
{
2924-
"name": "SupportedLocations",
2925+
"name": "SupportedAreas",
29252926
"code": 0,
29262927
"mfgCode": null,
29272928
"side": "server",
@@ -2953,7 +2954,7 @@
29532954
"reportableChange": 0
29542955
},
29552956
{
2956-
"name": "SelectedLocations",
2957+
"name": "SelectedAreas",
29572958
"code": 2,
29582959
"mfgCode": null,
29592960
"side": "server",
@@ -2969,7 +2970,7 @@
29692970
"reportableChange": 0
29702971
},
29712972
{
2972-
"name": "CurrentLocation",
2973+
"name": "CurrentArea",
29732974
"code": 3,
29742975
"mfgCode": null,
29752976
"side": "server",
@@ -2978,7 +2979,7 @@
29782979
"storageOption": "External",
29792980
"singleton": 0,
29802981
"bounded": 0,
2981-
"defaultValue": "",
2982+
"defaultValue": null,
29822983
"reportable": 1,
29832984
"minInterval": 1,
29842985
"maxInterval": 65534,
@@ -2994,7 +2995,7 @@
29942995
"storageOption": "External",
29952996
"singleton": 0,
29962997
"bounded": 0,
2997-
"defaultValue": "",
2998+
"defaultValue": null,
29982999
"reportable": 1,
29993000
"minInterval": 1,
30003001
"maxInterval": 65534,
@@ -3090,7 +3091,7 @@
30903091
"storageOption": "External",
30913092
"singleton": 0,
30923093
"bounded": 0,
3093-
"defaultValue": "0",
3094+
"defaultValue": null,
30943095
"reportable": 1,
30953096
"minInterval": 1,
30963097
"maxInterval": 65534,

0 commit comments

Comments
 (0)