Skip to content

Commit ec07b0e

Browse files
committed
Fixed SDK following update to the position type.
1 parent 23b1c6b commit ec07b0e

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ CHIP_ERROR RvcServiceAreaDelegate::Init()
4141
// Location A has name, floor number, uses map XX
4242
GetInstance()->AddSupportedLocation(supportedAreaID_A, DataModel::Nullable<uint32_t>(supportedMapId_XX), "My Location A"_span,
4343
DataModel::Nullable<int16_t>(4), DataModel::Nullable<Globals::AreaTypeTag>(),
44-
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::PositionTag>());
44+
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::RelativePositionTag>());
4545

4646
// Location B has name, uses map XX
4747
GetInstance()->AddSupportedLocation(supportedAreaID_B, DataModel::Nullable<uint32_t>(supportedMapId_XX), "My Location B"_span,
4848
DataModel::Nullable<int16_t>(), DataModel::Nullable<Globals::AreaTypeTag>(),
49-
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::PositionTag>());
49+
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::RelativePositionTag>());
5050

5151
// Location C has full SemData, no name, Map YY
5252
GetInstance()->AddSupportedLocation(supportedAreaID_C, DataModel::Nullable<uint32_t>(supportedMapId_YY), CharSpan(),

src/app/clusters/service-area-server/service-area-cluster-objects.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
3939
AreaStructureWrapper()
4040
{
4141
Set(0, 0, CharSpan(), DataModel::Nullable<int16_t>(), DataModel::Nullable<Globals::AreaTypeTag>(),
42-
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::PositionTag>());
42+
DataModel::Nullable<Globals::LandmarkTag>(), DataModel::Nullable<Globals::RelativePositionTag>());
4343
}
4444

4545
/**
@@ -51,7 +51,7 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
5151
* @param[in] aAreaTypeTag A common namespace Area tag - indicates an association of the location with an indoor or outdoor area
5252
* of a home.
5353
* @param[in] aLandmarkTag A common namespace Landmark tag - indicates an association of the location with a home landmark.
54-
* @param[in] aPositionTag A common namespace Position tag - indicates the position of the location with respect to the
54+
* @param[in] aRelativePositionTag A common namespace Relative Position tag - indicates the position of the location with respect to the
5555
* landmark.
5656
*
5757
* @note Requirements regarding what combinations of fields and values are valid are not checked by this class.
@@ -62,9 +62,9 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
6262
const DataModel::Nullable<int16_t> & aFloorNumber,
6363
const DataModel::Nullable<Globals::AreaTypeTag> & aAreaTypeTag,
6464
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
65-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag)
65+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag)
6666
{
67-
Set(aAreaID, aMapId, aLocationName, aFloorNumber, aAreaTypeTag, aLandmarkTag, aPositionTag);
67+
Set(aAreaID, aMapId, aLocationName, aFloorNumber, aAreaTypeTag, aLandmarkTag, aRelativePositionTag);
6868
}
6969

7070
/**
@@ -136,7 +136,7 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
136136
* @param[in] aAreaTypeTag A common namespace Area tag - indicates an association of the location with an indoor or outdoor area
137137
* of a home.
138138
* @param[in] aLandmarkTag A common namespace Landmark tag - indicates an association of the location with a home landmark.
139-
* @param[in] aPositionTag A common namespace Position tag - indicates the position of the location with respect to the
139+
* @param[in] aRelativePositionTag A common namespace Relative Position tag - indicates the position of the location with respect to the
140140
* landmark.
141141
*
142142
* @note Requirements regarding what combinations of fields and values are valid are not checked by this class.
@@ -146,7 +146,7 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
146146
void Set(uint32_t aAreaID, const DataModel::Nullable<uint32_t> & aMapId, const CharSpan & aLocationName,
147147
const DataModel::Nullable<int16_t> & aFloorNumber, const DataModel::Nullable<Globals::AreaTypeTag> & aAreaType,
148148
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
149-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag)
149+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag)
150150
{
151151
areaID = aAreaID;
152152
mapID = aMapId;
@@ -174,14 +174,14 @@ struct AreaStructureWrapper : public chip::app::Clusters::ServiceArea::Structs::
174174
{
175175
areaDesc.landmarkInfo.SetNonNull();
176176
areaDesc.landmarkInfo.Value().landmarkTag = aLandmarkTag.Value();
177-
if (aPositionTag.IsNull())
177+
if (aRelativePositionTag.IsNull())
178178
{
179179
areaDesc.landmarkInfo.Value().positionTag.SetNull();
180180
}
181181
else
182182
{
183183
areaDesc.landmarkInfo.Value().positionTag.SetNonNull();
184-
areaDesc.landmarkInfo.Value().positionTag.Value() = aPositionTag.Value();
184+
areaDesc.landmarkInfo.Value().positionTag.Value() = aRelativePositionTag.Value();
185185
}
186186
}
187187

src/app/clusters/service-area-server/service-area-server.cpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -580,12 +580,10 @@ bool Instance::AddSupportedLocation(uint32_t aAreaId, const DataModel::Nullable<
580580
const DataModel::Nullable<int16_t> & aFloorNumber,
581581
const DataModel::Nullable<Globals::AreaTypeTag> & aAreaType,
582582
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
583-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag)
583+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag)
584584
{
585585
// Create location object for validation.
586-
AreaStructureWrapper aNewArea(aAreaId, aMapId, aLocationName, aFloorNumber, aAreaType, aLandmarkTag, aPositionTag);
587-
588-
ChipLogError(Zcl, "AddSupportedLocation - 1 - area name: %.*s", static_cast<int>(aLocationName.size()), aLocationName.data());
586+
AreaStructureWrapper aNewArea(aAreaId, aMapId, aLocationName, aFloorNumber, aAreaType, aLandmarkTag, aRelativePositionTag);
589587

590588
// Does device mode allow this attribute to be updated?
591589
if (!mDelegate->IsSupportedAreasChangeAllowed())
@@ -632,7 +630,7 @@ bool Instance::ModifySupportedLocation(uint32_t aAreaId, const DataModel::Nullab
632630
const CharSpan & aLocationName, const DataModel::Nullable<int16_t> & aFloorNumber,
633631
const DataModel::Nullable<Globals::AreaTypeTag> & aAreaType,
634632
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
635-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag)
633+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag)
636634
{
637635
bool mapIDChanged = false;
638636
uint32_t listIndex;
@@ -659,7 +657,7 @@ bool Instance::ModifySupportedLocation(uint32_t aAreaId, const DataModel::Nullab
659657
}
660658

661659
// create new location object for validation
662-
AreaStructureWrapper aNewArea(aAreaId, aMapId, aLocationName, aFloorNumber, aAreaType, aLandmarkTag, aPositionTag);
660+
AreaStructureWrapper aNewArea(aAreaId, aMapId, aLocationName, aFloorNumber, aAreaType, aLandmarkTag, aRelativePositionTag);
663661

664662
// verify cluster requirements concerning valid fields and field relationships
665663
if (!IsValidSupportedLocation(aNewArea))

src/app/clusters/service-area-server/service-area-server.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
177177
* @param[in] aAreaType common namespace Area tag - indicates an association of the location with an indoor or outdoor area of a
178178
* home.
179179
* @param[in] aLandmarkTag common namespace Landmark tag - indicates an association of the location with a home landmark.
180-
* @param[in] aPositionTag common namespace Position tag - indicates the position of the location with respect to the landmark.
180+
* @param[in] aRelativePositionTag common namespace Relative Position tag - indicates the position of the location with respect to the landmark.
181181
* @return true if the new location passed validation checks and was successfully added to the list.
182182
*
183183
* @note if aLocationName is larger than kLocationNameMaxSize, it will be truncated.
@@ -186,7 +186,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
186186
const DataModel::Nullable<int16_t> & aFloorNumber,
187187
const DataModel::Nullable<Globals::AreaTypeTag> & aAreaType,
188188
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
189-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag);
189+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag);
190190

191191
/**
192192
* @brief Modify/replace an existing location in the supported locations list.
@@ -197,7 +197,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
197197
* @param[in] aAreaType common namespace Area tag - indicates an association of the location with an indoor or outdoor area of a
198198
* home.
199199
* @param[in] aLandmarkTag common namespace Landmark tag - indicates an association of the location with a home landmark.
200-
* @param[in] aPositionTag common namespace Position tag - indicates the position of the location with respect to the landmark.
200+
* @param[in] aRelativePositionTag common namespace Relative Position tag - indicates the position of the location with respect to the landmark.
201201
* @return true if the location is a member of supported locations, the modifications pass all validation checks and the
202202
* location was modified.
203203
*
@@ -208,7 +208,7 @@ class Instance : public AttributeAccessInterface, public CommandHandlerInterface
208208
const DataModel::Nullable<int16_t> & aFloorNumber,
209209
const DataModel::Nullable<Globals::AreaTypeTag> & aAreaType,
210210
const DataModel::Nullable<Globals::LandmarkTag> & aLandmarkTag,
211-
const DataModel::Nullable<Globals::PositionTag> & aPositionTag);
211+
const DataModel::Nullable<Globals::RelativePositionTag> & aRelativePositionTag);
212212

213213
/**
214214
* @return true if the SupportedAreas attribute was not already null.

0 commit comments

Comments
 (0)