Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of service area server #33991

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
0a7ecbd
Add definitions for common HomeLocationStruct and types - see connect…
johnfierke May 22, 2024
234c103
Add definition for Service Area Cluster - see connectedhomeip-spec PR…
johnfierke May 22, 2024
ac17ea0
Add semantic tag definitions needed for Service Area Cluster - see co…
johnfierke May 22, 2024
e70eaa8
Update Service Area Cluster definition of LocationInfoStruct - see co…
johnfierke May 22, 2024
c115aa6
Rename SurfaceTag to FloorSurfaceTag - spec PR 8937 commit 431739b3e3…
johnfierke May 22, 2024
08219ee
Fix Carport typo, remove IsGroundFloor field (spec change)
johnfierke May 23, 2024
b6bcd68
Update home location definitions per spec PR 8933 commit f04958166412…
johnfierke May 25, 2024
893333d
update generated files
johnfierke May 25, 2024
0099124
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
johnfierke May 25, 2024
7fdbde7
Update Service Area Cluster definitions per spec PR 8937 up to commit…
johnfierke May 25, 2024
a969dbc
update generated files
johnfierke May 25, 2024
4330887
Initial implementations of service-area-cluster per spec PR 8937 up t…
johnfierke May 29, 2024
6f74d9d
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 3, 2024
8aaa2dc
Regenerated zap files after merge.
hicklin Jun 3, 2024
ca9d207
Moved the AreaTypeTag namespace definition to namespaces.xml.
hicklin Jun 3, 2024
9837b22
Moved the HomeLoc global struct into global-sturcts.xml.
hicklin Jun 3, 2024
71e6931
Updated the AreaTypeTag namespace to match the latest spec definition.
hicklin Jun 3, 2024
def38fc
Updated the AreaTypeTag namespace to match the latest spec definition.
hicklin Jun 3, 2024
d132cfb
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 3, 2024
3811e36
Updated the matterlint rules with the changes in the xml files.
hicklin Jun 3, 2024
568eb3f
Reverted changes to the rvc zap file.
hicklin Jun 3, 2024
a562e2b
Addded global xml files to relevant lists of xmls.
hicklin Jun 3, 2024
7d61a65
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 4, 2024
cf62628
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 4, 2024
7d60124
Added the Position, Landmark and Floor Surface Namespaces.
hicklin Jun 4, 2024
7dd222e
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 4, 2024
9d34335
Removed namespace tag definitions from the service area cluters XML.
hicklin Jun 4, 2024
61181f2
Regenerated zap files.
hicklin Jun 4, 2024
ebe9010
Rewrite service-area-server and delegate to avoid disallowed c++ cont…
johnfierke Jun 4, 2024
cd5e1af
Merge branch 'Add-xml-definition-for-service-area-cluster' into Imple…
johnfierke Jun 4, 2024
77f84f3
Regenerated zap files.
johnfierke Jun 4, 2024
0079d86
Regenerated zap files.
hicklin Jun 5, 2024
abad92f
Explicitly set the conformance.
hicklin Jun 7, 2024
b827762
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 7, 2024
4a15763
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 7, 2024
672936c
Fixed typos in the service-area clusters XML from review.
hicklin Jun 7, 2024
fea95d4
Used a more feature rich method for defining the cluster's features.
hicklin Jun 7, 2024
2f17ccc
Reordered data-type definitions to match the order in the spec.
hicklin Jun 7, 2024
6bea5e9
Regenerated zap files.
hicklin Jun 7, 2024
e4d5ee8
Merge branch 'master' into Add-xml-definition-for-service-area-cluster
hicklin Jun 7, 2024
15174f7
Merge branch 'Add-xml-definition-for-service-area-cluster' into Imple…
hicklin Jun 7, 2024
c6c8019
Updated the service area type names following fixes to the XMLs.
hicklin Jun 12, 2024
de43985
Updated the rvc-example type names following fixes to the XMLs.
hicklin Jun 12, 2024
6892faa
Simplified some of the logic in the service-area cluster objects.
hicklin Jun 12, 2024
f6cbe72
Added an InEqual method to the LocationSturctureWrapper and simplifie…
hicklin Jun 13, 2024
221a9e7
Removed the handle volotile methos as the delegate should be responsi…
hicklin Jun 13, 2024
4b73d4d
Apply editorial suggestions from code review.
hicklin Jun 13, 2024
e50c9bc
Replaced Location Location in the logging text with Service Area.
hicklin Jun 13, 2024
d8b1765
Implemented some renaming and editorial changes from review. Moved so…
hicklin Jun 13, 2024
4a50553
Added the ServicArea to the controller init.py
hicklin Jun 13, 2024
fea48f5
Moved the HandleSupportedLocationsUpdated method form the instance to…
hicklin Jun 14, 2024
67b1e72
Moved delegate implementations to the .cpp
hicklin Jun 14, 2024
24f8fae
Removed calling the HandleSupportedLocationsUpdate when adding a new …
hicklin Jun 14, 2024
3fbc755
Removed calling the HandleSupportedLocationsUpdate when adding a new …
hicklin Jun 14, 2024
7874fc4
Renamed a delegate method and updated it's documentation.
hicklin Jun 14, 2024
ce643e3
Reverted a change to the darwin file for apple engineers to make.
hicklin Jun 17, 2024
598179e
Removed the optional cluster id prameter from the service area Instan…
hicklin Jun 17, 2024
ddc9544
Removed unneeded check.
hicklin Jun 18, 2024
b62cb25
Added a way to get the Service Area instance from the delegate. Added…
hicklin Jun 18, 2024
24b63c6
Moved the rvc service area delegate impl out of the rvc device class …
hicklin Jun 18, 2024
37dd235
Comment chages to the service area delegate in the rvc example app.
hicklin Jun 18, 2024
a9012f1
Added github issue to a comment.
hicklin Jun 18, 2024
b343f80
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 18, 2024
60c831c
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 18, 2024
01e6975
Merge branch 'Add-xml-definition-for-service-area-cluster' into Imple…
hicklin Jun 18, 2024
17080d3
Restyled by whitespace
restyled-commits Jun 18, 2024
30338f6
Restyled by clang-format
restyled-commits Jun 18, 2024
fe980a2
Restyled by gn
restyled-commits Jun 18, 2024
015cb18
Restyled by isort
restyled-commits Jun 18, 2024
b356de3
zap regen after pull.
hicklin Jun 19, 2024
f1bb116
Updated the Service Area code documentation following a review commen…
hicklin Jun 19, 2024
39efd55
Restyled by whitespace
restyled-commits Jun 19, 2024
df99cb2
Restyled by clang-format
restyled-commits Jun 19, 2024
f6816f9
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 20, 2024
cb592f2
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 20, 2024
cfd87e4
Merge branch 'Add-xml-definition-for-service-area-cluster' into Imple…
hicklin Jun 20, 2024
c1b9e31
Renamed DoseNameMatch to IsNameEqual.
hicklin Jun 20, 2024
66851dc
Replaced the multiple bool inputs of the IsEqual method with a BitMask.
hicklin Jun 20, 2024
683b0fe
Removed the use of ret_value to improve readability.
hicklin Jun 20, 2024
86f4b1b
Removed redundant ;
hicklin Jun 20, 2024
d5d2d35
Removed redundant use of the namespaces.
hicklin Jun 20, 2024
baa8a41
Moved the empty impl of MatterServiceAreaPluginServerInitCallback to …
hicklin Jun 20, 2024
2b9f112
Simplified some method returns.
hicklin Jun 20, 2024
3965601
Updated a log level.
hicklin Jun 20, 2024
2ab2f93
Removed extra logs while reading attributes.
hicklin Jun 20, 2024
c432550
Removed else after if return.
hicklin Jun 20, 2024
e2ef26e
Fixed sizeof-array-decay warning.
hicklin Jun 20, 2024
113b80f
Cast all std::vector.size() returns in the RVC service area delegate …
hicklin Jun 21, 2024
078a3c9
Change the way the Delegate and Instance classes are stopped from bei…
hicklin Jun 21, 2024
fea9eed
Fixed a bug that was causing the clang-tidy CI test to seg fault.
hicklin Jun 24, 2024
4e8aee8
Restyled by clang-format
restyled-commits Jun 24, 2024
8fe8493
Renamed namespaces.xml to semantic-tag-namespace-enums.xml.
hicklin Jun 24, 2024
7d03706
Merge branch 'master' into Add-common-definitions-for-Home-Location
hicklin Jun 24, 2024
9a48e48
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 24, 2024
12d2543
Missed some rename locations.
hicklin Jun 24, 2024
e624fdc
Merge branch 'Add-common-definitions-for-Home-Location' into Add-xml-…
hicklin Jun 24, 2024
a828b91
Merge branch 'Add-xml-definition-for-service-area-cluster' into Imple…
hicklin Jun 24, 2024
6d61965
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jun 26, 2024
982ebfb
Regenerated zap files after sync with upstream.
hicklin Jun 26, 2024
fe0106e
Fixed typos from review.
hicklin Jun 27, 2024
2921b8a
Fixed the termination of the Location and Map structure wrappers' nam…
hicklin Jun 27, 2024
38a7e7a
- Replaced the use of `char *` with `MutableCharSpan`.
hicklin Jun 28, 2024
3ecf461
Restyled by clang-format
restyled-commits Jun 28, 2024
63a7ae8
Refactored out the use of ret_value.
hicklin Jul 2, 2024
06f26ad
Removed an unused method in the rvc-app
hicklin Jul 3, 2024
1b04830
Refactored rvc-app to use static casts.
hicklin Jul 3, 2024
b1d680e
Fixed missing ;
hicklin Jul 3, 2024
e62be60
Restyled by clang-format
restyled-commits Jul 3, 2024
232b7e7
Rplaced the use of fromCharSpan with _span in the rvc-app.
hicklin Jul 3, 2024
87646aa
Removed unneeded casting.
hicklin Jul 4, 2024
1054f73
Removed unnecessary null terminations in the service area struct wrap…
hicklin Jul 4, 2024
e17c3c1
Fixed an error in the docs.
hicklin Jul 4, 2024
a834976
Restyled by clang-format
restyled-commits Jul 4, 2024
419bfbf
Moved the responsibility of checking for duplicates in the selected l…
hicklin Jul 4, 2024
9a38308
Restyled by clang-format
restyled-commits Jul 4, 2024
e344d0d
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jul 17, 2024
d5f855e
Removed unneccessary memset.
hicklin Jul 17, 2024
263011f
Updated some docs.
hicklin Jul 19, 2024
26cf03f
Removed unneeded Raw() call.
hicklin Jul 19, 2024
55c69a9
Added attribute ID to reading log.
hicklin Jul 19, 2024
e48f10d
Removed the use of __func__
hicklin Jul 19, 2024
c8358f1
Fixed incorrect command handling statuses.
hicklin Jul 19, 2024
efafc7c
Fixed some code documentation.
hicklin Jul 19, 2024
5cffc68
Fixed bug in handling of errorStatusTexts from the delegate.
hicklin Jul 19, 2024
9346ef5
Rnamed dummy vars as ignored.
hicklin Jul 24, 2024
57818b7
Fixed the printing of map name.
hicklin Jul 24, 2024
6cf2ea7
Replaced use of Nullable<type> with NullNullable.
hicklin Jul 24, 2024
7104c9e
Added a log that was commented out.
hicklin Jul 24, 2024
555fac8
Added non-list service area attributes to the list of attributeAccess…
hicklin Jul 24, 2024
e68858d
Fixed bug relateing to getting a null value.
hicklin Jul 24, 2024
0ed4491
Improved the readability of the logic for determining if a change to …
hicklin Jul 25, 2024
53f9dbe
Do not report CurrentLocation change if it does not change.
hicklin Jul 25, 2024
37680c6
Simplified logic returns
hicklin Jul 26, 2024
d0cb275
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jul 26, 2024
9befe4d
Restyled by whitespace
restyled-commits Jul 26, 2024
cf99c9f
Restyled by clang-format
restyled-commits Jul 26, 2024
7a971e8
Restyled by prettier-json
restyled-commits Jul 26, 2024
265d59c
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jul 26, 2024
ea64ae8
Changed the way the Commond Handler Interface is registered following…
hicklin Jul 26, 2024
2df0c57
Made all delegate methods public. Removed the Instance class from bei…
hicklin Jul 26, 2024
8588959
Restyled by clang-format
restyled-commits Jul 26, 2024
cdc5bc0
Reduced the socope of variabels to improve readability.
hicklin Jul 29, 2024
6ab4cf7
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jul 29, 2024
187dc49
Regenerated zap files after sync with upstream.
hicklin Jul 29, 2024
38651cf
Fixed name change of LocationDescriptorStruct
hicklin Jul 29, 2024
aee7b9e
Restyled by clang-format
restyled-commits Jul 29, 2024
9dbe4a4
Added FeatureMap to the list of attributeAccessInterfaceAttributes.
hicklin Jul 30, 2024
f4535db
Do not consider list of 0 as error.
hicklin Jul 30, 2024
93ae0b8
Fixed attribute ID printing.
hicklin Jul 30, 2024
d25c5e6
Apply suggestions from code review
hicklin Jul 30, 2024
2e707f8
Merge branch 'master' into Implementation-of-service-area-server
hicklin Jul 30, 2024
56abce4
Generated zap code after merge.
hicklin Jul 30, 2024
af7d1ba
Fixed the logic of the ReportEstimatedEndTimeChange method.
hicklin Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/rvc-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ executable("chip-rvc-app") {
"${chip_root}/examples/rvc-app/rvc-common/src/rvc-device.cpp",
"${chip_root}/examples/rvc-app/rvc-common/src/rvc-mode-delegates.cpp",
"${chip_root}/examples/rvc-app/rvc-common/src/rvc-operational-state-delegate.cpp",
"${chip_root}/examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp",
"RvcAppCommandDelegate.cpp",
"include/CHIPProjectAppConfig.h",
"main.cpp",
Expand Down
9 changes: 8 additions & 1 deletion examples/rvc-app/rvc-common/include/rvc-device.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

#include "rvc-mode-delegates.h"
#include "rvc-operational-state-delegate.h"
#include "rvc-service-area-delegate.h"
#include <app/clusters/mode-base-server/mode-base-server.h>
#include <app/clusters/operational-state-server/operational-state-server.h>
#include <app/clusters/service-area-server/service-area-delegate.h>
#include <app/clusters/service-area-server/service-area-server.h>

#include <string>

Expand All @@ -23,6 +26,9 @@ class RvcDevice
RvcOperationalState::RvcOperationalStateDelegate mOperationalStateDelegate;
RvcOperationalState::Instance mOperationalStateInstance;

ServiceArea::RvcServiceAreaDelegate mServiceAreaDelegate;
ServiceArea::Instance mServiceAreaInstance;

bool mDocked = false;
bool mCharging = false;

Expand All @@ -37,7 +43,8 @@ class RvcDevice
explicit RvcDevice(EndpointId aRvcClustersEndpoint) :
mRunModeDelegate(), mRunModeInstance(&mRunModeDelegate, aRvcClustersEndpoint, RvcRunMode::Id, 0), mCleanModeDelegate(),
mCleanModeInstance(&mCleanModeDelegate, aRvcClustersEndpoint, RvcCleanMode::Id, 0), mOperationalStateDelegate(),
mOperationalStateInstance(&mOperationalStateDelegate, aRvcClustersEndpoint)
mOperationalStateInstance(&mOperationalStateDelegate, aRvcClustersEndpoint), mServiceAreaDelegate(),
mServiceAreaInstance(&mServiceAreaDelegate, aRvcClustersEndpoint, BitMask<ServiceArea::Feature>(0))
{
// set the current-mode at start-up
mRunModeInstance.UpdateCurrentMode(RvcRunMode::ModeIdle);
Expand Down
124 changes: 124 additions & 0 deletions examples/rvc-app/rvc-common/include/rvc-service-area-delegate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include <app/clusters/service-area-server/service-area-server.h>
#include <app/util/config.h>
#include <cstring>
#include <utility>

namespace chip {
namespace app {
namespace Clusters {

class RvcDevice;

namespace ServiceArea {

class RvcServiceAreaDelegate : public Delegate
{
private:
// containers for array attributes.
std::vector<ServiceArea::LocationStructureWrapper> mSupportedLocations;
std::vector<ServiceArea::MapStructureWrapper> mSupportedMaps;
std::vector<uint32_t> mSelectedLocations;
std::vector<ServiceArea::Structs::ProgressStruct::Type> mProgressList;

public:
CHIP_ERROR Init() override;

// command support
bool IsSetSelectedLocationsAllowed(MutableCharSpan statusText) override;

bool IsValidSelectLocationsSet(const ServiceArea::Commands::SelectLocations::DecodableType & req,
ServiceArea::SelectLocationsStatus & locationStatus, MutableCharSpan statusText) override;

bool HandleSkipCurrentLocation(MutableCharSpan skipStatusText) override;

//*************************************************************************
// Supported Locations accessors

bool IsSupportedLocationsChangeAllowed() override;

uint32_t GetNumberOfSupportedLocations() override;

bool GetSupportedLocationByIndex(uint32_t listIndex, ServiceArea::LocationStructureWrapper & supportedLocation) override;

bool GetSupportedLocationById(uint32_t aLocationId, uint32_t & listIndex,
ServiceArea::LocationStructureWrapper & supportedLocation) override;

bool AddSupportedLocation(const ServiceArea::LocationStructureWrapper & newLocation, uint32_t & listIndex) override;

bool ModifySupportedLocation(uint32_t listIndex, const ServiceArea::LocationStructureWrapper & modifiedLocation) override;

bool ClearSupportedLocations() override;

//*************************************************************************
// Supported Maps accessors

bool IsSupportedMapChangeAllowed() override;

uint32_t GetNumberOfSupportedMaps() override;

bool GetSupportedMapByIndex(uint32_t listIndex, ServiceArea::MapStructureWrapper & supportedMap) override;

bool GetSupportedMapById(uint8_t aMapId, uint32_t & listIndex, ServiceArea::MapStructureWrapper & supportedMap) override;

bool AddSupportedMap(const ServiceArea::MapStructureWrapper & newMap, uint32_t & listIndex) override;

bool ModifySupportedMap(uint32_t listIndex, const ServiceArea::MapStructureWrapper & newMap) override;

bool ClearSupportedMaps() override;

//*************************************************************************
// Selected Locations accessors

uint32_t GetNumberOfSelectedLocations() override;

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

// IsSelectedLocation() no override

bool AddSelectedLocation(uint32_t aLocationId, uint32_t & listIndex) override;

bool ClearSelectedLocations() override;

//*************************************************************************
// Progress accessors

uint32_t GetNumberOfProgressElements() override;

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

bool GetProgressElementById(uint32_t aLocationId, uint32_t & listIndex,
ServiceArea::Structs::ProgressStruct::Type & aProgressElement) override;

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

bool ModifyProgressElement(uint32_t listIndex,
const ServiceArea::Structs::ProgressStruct::Type & modifiedProgressElement) override;

bool ClearProgress() override;
};

} // namespace ServiceArea

} // namespace Clusters
} // namespace app
} // namespace chip
Loading
Loading