Skip to content

Commit

Permalink
Rename ArraySize() to MATTER_ARRAY_SIZE() (#37660)
Browse files Browse the repository at this point in the history
* Rename ArraySize() to MATTER_ARRAY_SIZE

* Updated usages of ArraySize() to MATTER_ARRAY_SIZE()

* Restyled by clang-format

* Guard with #ifndef

* fix recently introduced usage in chime

* fix typo

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
soares-sergio and restyled-commits authored Feb 21, 2025
1 parent 5fd96ed commit 9e718b0
Show file tree
Hide file tree
Showing 185 changed files with 607 additions and 567 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ void SensorManager::SensorTimerEventHandler(void * arg)
static uint8_t simulatedIndex = 0;

// Ensure the simulatedIndex wraps around the array size to avoid out-of-bounds access
simulatedIndex = simulatedIndex % ArraySize(mSimulatedAirQuality);
simulatedIndex = simulatedIndex % MATTER_ARRAY_SIZE(mSimulatedAirQuality);
// Retrieve the current air quality value from the simulated data array using the simulatedIndex
air_quality = mSimulatedAirQuality[simulatedIndex];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void DishwasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Comma

CHIP_ERROR DishwasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -50,7 +50,7 @@ CHIP_ERROR DishwasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::

CHIP_ERROR DishwasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -60,7 +60,7 @@ CHIP_ERROR DishwasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_

CHIP_ERROR DishwasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ EPrefDelegate::~EPrefDelegate()

size_t EPrefDelegate::GetNumEnergyBalances(chip::EndpointId aEndpoint)
{
return (ArraySize(gsEnergyBalances));
return (MATTER_ARRAY_SIZE(gsEnergyBalances));
}

size_t EPrefDelegate::GetNumLowPowerModeSensitivities(chip::EndpointId aEndpoint)
{
return (ArraySize(gsEnergyBalances));
return (MATTER_ARRAY_SIZE(gsEnergyBalances));
}

CHIP_ERROR
Expand Down Expand Up @@ -104,7 +104,7 @@ EPrefDelegate::GetEnergyPriorityAtIndex(chip::EndpointId aEndpoint, size_t aInde
{
static EnergyPriorityEnum priorities[] = { EnergyPriorityEnum::kEfficiency, EnergyPriorityEnum::kComfort };

if (aIndex < ArraySize(priorities))
if (aIndex < MATTER_ARRAY_SIZE(priorities))
{
priority = priorities[aIndex];
return CHIP_NO_ERROR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LaundryDryerControlDelegate LaundryDryerControlDelegate::instance;
// TODO: Add EndpointId to the API so that different values per endpoint may be possible in some implementations.
CHIP_ERROR LaundryDryerControlDelegate::GetSupportedDrynessLevelAtIndex(size_t index, DrynessLevelEnum & supportedDrynessLevel)
{
if (index >= ArraySize(supportedDrynessLevelOptions))
if (index >= MATTER_ARRAY_SIZE(supportedDrynessLevelOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ LaundryWasherControlDelegate LaundryWasherControlDelegate::instance;

CHIP_ERROR LaundryWasherControlDelegate::GetSpinSpeedAtIndex(size_t index, MutableCharSpan & spinSpeed)
{
if (index >= ArraySize(spinSpeedsNameOptions))
if (index >= MATTER_ARRAY_SIZE(spinSpeedsNameOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -47,7 +47,7 @@ CHIP_ERROR LaundryWasherControlDelegate::GetSpinSpeedAtIndex(size_t index, Mutab

CHIP_ERROR LaundryWasherControlDelegate::GetSupportedRinseAtIndex(size_t index, NumberOfRinsesEnum & supportedRinse)
{
if (index >= ArraySize(supportRinsesOptions))
if (index >= MATTER_ARRAY_SIZE(supportRinsesOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void LaundryWasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Co

CHIP_ERROR LaundryWasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -49,7 +49,7 @@ CHIP_ERROR LaundryWasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chi

CHIP_ERROR LaundryWasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -59,7 +59,7 @@ CHIP_ERROR LaundryWasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uin

CHIP_ERROR LaundryWasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void ExampleMicrowaveOvenModeDelegate::HandleChangeToMode(uint8_t NewMode,

CHIP_ERROR ExampleMicrowaveOvenModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -51,7 +51,7 @@ CHIP_ERROR ExampleMicrowaveOvenModeDelegate::GetModeLabelByIndex(uint8_t modeInd

CHIP_ERROR ExampleMicrowaveOvenModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -61,7 +61,7 @@ CHIP_ERROR ExampleMicrowaveOvenModeDelegate::GetModeValueByIndex(uint8_t modeInd

CHIP_ERROR ExampleMicrowaveOvenModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void OvenModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::C

CHIP_ERROR OvenModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -51,7 +51,7 @@ CHIP_ERROR OvenModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::Mutabl

CHIP_ERROR OvenModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -61,7 +61,7 @@ CHIP_ERROR OvenModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & va

CHIP_ERROR OvenModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
12 changes: 6 additions & 6 deletions examples/all-clusters-app/all-clusters-common/src/rvc-modes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void RvcRunModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands:

CHIP_ERROR RvcRunModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -77,7 +77,7 @@ CHIP_ERROR RvcRunModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::Muta

CHIP_ERROR RvcRunModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -87,7 +87,7 @@ CHIP_ERROR RvcRunModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t &

CHIP_ERROR RvcRunModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down Expand Up @@ -161,7 +161,7 @@ void RvcCleanModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Command

CHIP_ERROR RvcCleanModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -170,7 +170,7 @@ CHIP_ERROR RvcCleanModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::Mu

CHIP_ERROR RvcCleanModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -180,7 +180,7 @@ CHIP_ERROR RvcCleanModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t

CHIP_ERROR RvcCleanModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void TccModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::Ch

CHIP_ERROR TccModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -49,7 +49,7 @@ CHIP_ERROR TccModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::Mutable

CHIP_ERROR TccModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand All @@ -59,7 +59,7 @@ CHIP_ERROR TccModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & val

CHIP_ERROR TccModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List<ModeTagStructType> & tags)
{
if (modeIndex >= ArraySize(kModeOptions))
if (modeIndex >= MATTER_ARRAY_SIZE(kModeOptions))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
Expand Down
41 changes: 23 additions & 18 deletions examples/all-clusters-app/ameba/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -584,32 +584,37 @@ static void RegisterSwitchCommands()

// Register groups command
sShellSwitchGroupsIdentifySubCommands.RegisterCommands(sSwitchGroupsIdentifySubCommands,
ArraySize(sSwitchGroupsIdentifySubCommands));
sShellSwitchGroupsOnOffSubCommands.RegisterCommands(sSwitchGroupsOnOffSubCommands, ArraySize(sSwitchGroupsOnOffSubCommands));
MATTER_ARRAY_SIZE(sSwitchGroupsIdentifySubCommands));
sShellSwitchGroupsOnOffSubCommands.RegisterCommands(sSwitchGroupsOnOffSubCommands,
MATTER_ARRAY_SIZE(sSwitchGroupsOnOffSubCommands));
sShellSwitchGroupsLevelControlSubCommands.RegisterCommands(sSwitchGroupsLevelControlSubCommands,
ArraySize(sSwitchGroupsLevelControlSubCommands));
MATTER_ARRAY_SIZE(sSwitchGroupsLevelControlSubCommands));
sShellSwitchGroupsColorControlSubCommands.RegisterCommands(sSwitchGroupsColorControlSubCommands,
ArraySize(sSwitchGroupsColorControlSubCommands));
MATTER_ARRAY_SIZE(sSwitchGroupsColorControlSubCommands));
sShellSwitchGroupsThermostatSubCommands.RegisterCommands(sSwitchGroupsThermostatSubCommands,
ArraySize(sSwitchGroupsThermostatSubCommands));
MATTER_ARRAY_SIZE(sSwitchGroupsThermostatSubCommands));

// Register commands
sShellSwitchIdentifySubCommands.RegisterCommands(sSwitchIdentifySubCommands, ArraySize(sSwitchIdentifySubCommands));
sShellSwitchIdentifyReadSubCommands.RegisterCommands(sSwitchIdentifyReadSubCommands, ArraySize(sSwitchIdentifyReadSubCommands));
sShellSwitchOnOffSubCommands.RegisterCommands(sSwitchOnOffSubCommands, ArraySize(sSwitchOnOffSubCommands));
sShellSwitchOnOffReadSubCommands.RegisterCommands(sSwitchOnOffReadSubCommands, ArraySize(sSwitchOnOffReadSubCommands));
sShellSwitchLevelControlSubCommands.RegisterCommands(sSwitchLevelControlSubCommands, ArraySize(sSwitchLevelControlSubCommands));
sShellSwitchIdentifySubCommands.RegisterCommands(sSwitchIdentifySubCommands, MATTER_ARRAY_SIZE(sSwitchIdentifySubCommands));
sShellSwitchIdentifyReadSubCommands.RegisterCommands(sSwitchIdentifyReadSubCommands,
MATTER_ARRAY_SIZE(sSwitchIdentifyReadSubCommands));
sShellSwitchOnOffSubCommands.RegisterCommands(sSwitchOnOffSubCommands, MATTER_ARRAY_SIZE(sSwitchOnOffSubCommands));
sShellSwitchOnOffReadSubCommands.RegisterCommands(sSwitchOnOffReadSubCommands, MATTER_ARRAY_SIZE(sSwitchOnOffReadSubCommands));
sShellSwitchLevelControlSubCommands.RegisterCommands(sSwitchLevelControlSubCommands,
MATTER_ARRAY_SIZE(sSwitchLevelControlSubCommands));
sShellSwitchLevelControlReadSubCommands.RegisterCommands(sSwitchLevelControlReadSubCommands,
ArraySize(sSwitchLevelControlReadSubCommands));
sShellSwitchColorControlSubCommands.RegisterCommands(sSwitchColorControlSubCommands, ArraySize(sSwitchColorControlSubCommands));
MATTER_ARRAY_SIZE(sSwitchLevelControlReadSubCommands));
sShellSwitchColorControlSubCommands.RegisterCommands(sSwitchColorControlSubCommands,
MATTER_ARRAY_SIZE(sSwitchColorControlSubCommands));
sShellSwitchColorControlReadSubCommands.RegisterCommands(sSwitchColorControlReadSubCommands,
ArraySize(sSwitchColorControlReadSubCommands));
sShellSwitchThermostatSubCommands.RegisterCommands(sSwitchThermostatSubCommands, ArraySize(sSwitchThermostatSubCommands));
MATTER_ARRAY_SIZE(sSwitchColorControlReadSubCommands));
sShellSwitchThermostatSubCommands.RegisterCommands(sSwitchThermostatSubCommands,
MATTER_ARRAY_SIZE(sSwitchThermostatSubCommands));
sShellSwitchThermostatReadSubCommands.RegisterCommands(sSwitchThermostatReadSubCommands,
ArraySize(sSwitchThermostatReadSubCommands));
sShellSwitchGroupsSubCommands.RegisterCommands(sSwitchGroupsSubCommands, ArraySize(sSwitchGroupsSubCommands));
sShellSwitchBindingSubCommands.RegisterCommands(sSwitchBindingSubCommands, ArraySize(sSwitchBindingSubCommands));
sShellSwitchSubCommands.RegisterCommands(sSwitchSubCommands, ArraySize(sSwitchSubCommands));
MATTER_ARRAY_SIZE(sSwitchThermostatReadSubCommands));
sShellSwitchGroupsSubCommands.RegisterCommands(sSwitchGroupsSubCommands, MATTER_ARRAY_SIZE(sSwitchGroupsSubCommands));
sShellSwitchBindingSubCommands.RegisterCommands(sSwitchBindingSubCommands, MATTER_ARRAY_SIZE(sSwitchBindingSubCommands));
sShellSwitchSubCommands.RegisterCommands(sSwitchSubCommands, MATTER_ARRAY_SIZE(sSwitchSubCommands));

Engine::Root().RegisterCommands(&sSwitchCommand, 1);
}
Expand Down
22 changes: 12 additions & 10 deletions examples/all-clusters-app/ameba/main/ManualOperationCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,22 @@ static void RegisterManualOperationCommands()
"Manual Operation commands. Usage: manual <subcommand>" };

// Register commands
sShellManualOperationSubCommands.RegisterCommands(sManualOperationSubCommands, ArraySize(sManualOperationSubCommands));
sShellManualOperationSubCommands.RegisterCommands(sManualOperationSubCommands, MATTER_ARRAY_SIZE(sManualOperationSubCommands));
sShellManualOperationalStateSubCommands.RegisterCommands(sManualOperationalStateSubCommands,
ArraySize(sManualOperationalStateSubCommands));
sShellManualRVCSubCommands.RegisterCommands(sManualRVCSubCommands, ArraySize(sManualRVCSubCommands));
MATTER_ARRAY_SIZE(sManualOperationalStateSubCommands));
sShellManualRVCSubCommands.RegisterCommands(sManualRVCSubCommands, MATTER_ARRAY_SIZE(sManualRVCSubCommands));
sShellManualRVCOperationalStateSubCommands.RegisterCommands(sManualRVCOperationalStateSubCommands,
ArraySize(sManualRVCOperationalStateSubCommands));
sShellManualRVCRunModeSubCommands.RegisterCommands(sManualRVCRunModeSubCommands, ArraySize(sManualRVCRunModeSubCommands));
sShellManualRVCCleanModeSubCommands.RegisterCommands(sManualRVCCleanModeSubCommands, ArraySize(sManualRVCCleanModeSubCommands));
MATTER_ARRAY_SIZE(sManualRVCOperationalStateSubCommands));
sShellManualRVCRunModeSubCommands.RegisterCommands(sManualRVCRunModeSubCommands,
MATTER_ARRAY_SIZE(sManualRVCRunModeSubCommands));
sShellManualRVCCleanModeSubCommands.RegisterCommands(sManualRVCCleanModeSubCommands,
MATTER_ARRAY_SIZE(sManualRVCCleanModeSubCommands));
sShellManualRefrigeratorAlarmStateSubCommands.RegisterCommands(sManualRefrigeratorAlarmStateSubCommands,
ArraySize(sManualRefrigeratorAlarmStateSubCommands));
MATTER_ARRAY_SIZE(sManualRefrigeratorAlarmStateSubCommands));
sShellManualDishWasherAlarmStateSubCommands.RegisterCommands(sManualDishWasherAlarmSubCommands,
ArraySize(sManualDishWasherAlarmSubCommands));
sShellManualOvenCavityOperationalStateSubCommands.RegisterCommands(sManualOvenCavityOperationalStateSubCommands,
ArraySize(sManualOvenCavityOperationalStateSubCommands));
MATTER_ARRAY_SIZE(sManualDishWasherAlarmSubCommands));
sShellManualOvenCavityOperationalStateSubCommands.RegisterCommands(
sManualOvenCavityOperationalStateSubCommands, MATTER_ARRAY_SIZE(sManualOvenCavityOperationalStateSubCommands));

Engine::Root().RegisterCommands(&sManualOperationCommand, 1);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/ShellCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void OnOffCommands::Register()
static const shell_command_t subCommands[] = { { &OnLightHandler, "on", "Usage: OnOff on endpoint-id" },
{ &OffLightHandler, "off", "Usage: OnOff off endpoint-id" },
{ &ToggleLightHandler, "toggle", "Usage: OnOff toggle endpoint-id" } };
sSubShell.RegisterCommands(subCommands, ArraySize(subCommands));
sSubShell.RegisterCommands(subCommands, MATTER_ARRAY_SIZE(subCommands));

// Register the root `OnOff` command in the top-level shell.
static const shell_command_t onOffCommand = { &OnOffHandler, "OnOff", "OnOff commands" };
Expand All @@ -43,7 +43,7 @@ void CASECommands::Register()
static const shell_command_t subCommands[] = {
{ &ConnectToNodeHandler, "connect", "Establish CASESession to a node, Usage: case connect <fabric-index> <node-id>" },
};
sSubShell.RegisterCommands(subCommands, ArraySize(subCommands));
sSubShell.RegisterCommands(subCommands, MATTER_ARRAY_SIZE(subCommands));

static const shell_command_t CASECommand = { &CASEHandler, "case", "Case Commands" };
Engine::Root().RegisterCommands(&CASECommand, 1);
Expand Down
Loading

0 comments on commit 9e718b0

Please sign in to comment.