Skip to content

Commit

Permalink
Merge branch 'master' into develop/bump_west_version
Browse files Browse the repository at this point in the history
  • Loading branch information
axelnxp authored Aug 9, 2024
2 parents ed3bc78 + 6cff19c commit fe70cdb
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 27 deletions.
11 changes: 11 additions & 0 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,17 @@ void BaseApplicationDelegate::OnCommissioningWindowClosed()
}
}
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917
if (BaseApplication::GetProvisionStatus())
{
#ifdef DISPLAY_ENABLED
#ifdef QR_CODE_ENABLED
SilabsLCD::Screen_e screen;
slLCD.GetScreen(screen);
VerifyOrReturn(screen == SilabsLCD::Screen_e::QRCodeScreen);
slLCD.SetScreen(SilabsLCD::Screen_e::DemoScreen);
#endif // QR_CODE_ENABLED
#endif // DISPLAY_ENABLED
}
}

void BaseApplicationDelegate::OnFabricCommitted(const FabricTable & fabricTable, FabricIndex fabricIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ class RvcServiceAreaDelegate : public Delegate
CHIP_ERROR Init() override;

// command support
bool IsSetSelectedAreasAllowed(MutableCharSpan statusText) override;
bool IsSetSelectedAreasAllowed(MutableCharSpan & statusText) override;

bool IsValidSelectAreasSet(const ServiceArea::Commands::SelectAreas::DecodableType & req,
ServiceArea::SelectAreasStatus & areaStatus, MutableCharSpan statusText) override;
ServiceArea::SelectAreasStatus & areaStatus, MutableCharSpan & statusText) override;

bool HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan skipStatusText) override;
bool HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan & skipStatusText) override;

//*************************************************************************
// Supported Areas accessors
Expand Down
6 changes: 3 additions & 3 deletions examples/rvc-app/rvc-common/src/rvc-service-area-delegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ CHIP_ERROR RvcServiceAreaDelegate::Init()
//*************************************************************************
// command support

bool RvcServiceAreaDelegate::IsSetSelectedAreasAllowed(MutableCharSpan statusText)
bool RvcServiceAreaDelegate::IsSetSelectedAreasAllowed(MutableCharSpan & statusText)
{
// TODO IMPLEMENT
return true;
};

bool RvcServiceAreaDelegate::IsValidSelectAreasSet(const Commands::SelectAreas::DecodableType & req, SelectAreasStatus & areaStatus,
MutableCharSpan statusText)
MutableCharSpan & statusText)
{
// TODO IMPLEMENT
return true;
};

bool RvcServiceAreaDelegate::HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan skipStatusText)
bool RvcServiceAreaDelegate::HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan & skipStatusText)
{
// TODO IMPLEMENT
return true;
Expand Down
6 changes: 3 additions & 3 deletions src/app/clusters/service-area-server/service-area-delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Delegate
* @note The statusText field SHOULD indicate why the request is not allowed, given the current mode
* of the device, which may involve other clusters.
*/
virtual bool IsSetSelectedAreasAllowed(MutableCharSpan statusText) = 0;
virtual bool IsSetSelectedAreasAllowed(MutableCharSpan & statusText) = 0;

/**
* Given a set of locations to be set to the SelectedAreas attribute, this method should check that
Expand All @@ -92,7 +92,7 @@ class Delegate
* device must stop.
*/
virtual bool IsValidSelectAreasSet(const Commands::SelectAreas::DecodableType & req, SelectAreasStatus & locationStatus,
MutableCharSpan statusText) = 0;
MutableCharSpan & statusText) = 0;

/**
* @brief The server instance ensures that the SelectedAreas and CurrentArea attributes are not null before
Expand Down Expand Up @@ -121,7 +121,7 @@ class Delegate
* InvalidInMode, the StatusText field SHOULD indicate why the request is not allowed, given the current mode of the device,
* which may involve other clusters.
*/
virtual bool HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan skipStatusText)
virtual bool HandleSkipCurrentArea(uint32_t skippedArea, MutableCharSpan & skipStatusText)
{
// device support of this command is optional
CopyCharSpanToMutableCharSpan("Skip Current Area command not supported by device"_span, skipStatusText);
Expand Down
31 changes: 13 additions & 18 deletions src/app/clusters/service-area-server/service-area-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,8 @@ void Instance::HandleSkipCurrentAreaCmd(HandlerContext & ctx, const Commands::Sk
exitResponse(SkipAreaStatus::kInvalidInMode, skipStatusText);
return;
}

exitResponse(SkipAreaStatus::kSuccess, ""_span);
}

//*************************************************************************
Expand Down Expand Up @@ -469,35 +471,28 @@ bool Instance::IsValidSupportedArea(const AreaStructureWrapper & aArea)
}

// The mapID field SHALL be null if SupportedMaps is not supported or SupportedMaps is an empty list.
bool shouldMapsBeNull = false;
if (mFeature.Has(Feature::kMaps))
if (mFeature.Has(Feature::kMaps) && (mDelegate->GetNumberOfSupportedMaps() > 0))
{
if (mDelegate->GetNumberOfSupportedMaps() == 0)
if (aArea.mapID.IsNull())
{
shouldMapsBeNull = true;
ChipLogDetail(Zcl, "IsValidSupportedArea %u - map Id should not be null when there are supported maps", aArea.areaID);
return false;
}
}
else
{
shouldMapsBeNull = true;
}

if (shouldMapsBeNull)
{
if (!aArea.mapID.IsNull())
// If the SupportedMaps attribute is not null, mapID SHALL be the ID of an entry from the SupportedMaps attribute.
if (!IsSupportedMap(aArea.mapID.Value()))
{
ChipLogDetail(Zcl, "IsValidSupportedArea %u - map Id %u is not in empty supported map list", aArea.areaID,
aArea.mapID.Value());
ChipLogError(Zcl, "IsValidSupportedArea %u - map Id %u is not in supported map list", aArea.areaID,
aArea.mapID.Value());
return false;
}
}
else
{
// If the SupportedMaps attribute is not null, mapID SHALL be the ID of an entry from the SupportedMaps attribute.
if (!IsSupportedMap(aArea.mapID.Value()))
if (!aArea.mapID.IsNull())
{
ChipLogError(Zcl, "IsValidSupportedArea %u - map Id %u is not in supported map list", aArea.areaID,
aArea.mapID.Value());
ChipLogDetail(Zcl, "IsValidSupportedArea %u - map Id %u is not in empty supported map list", aArea.areaID,
aArea.mapID.Value());
return false;
}
}
Expand Down

0 comments on commit fe70cdb

Please sign in to comment.