Skip to content

Commit 96e6885

Browse files
authored
Merge branch 'master' into 0307_good_lock
2 parents 03a1a67 + bf7241d commit 96e6885

File tree

54 files changed

+1196
-752
lines changed

Some content is hidden

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

54 files changed

+1196
-752
lines changed

examples/android/CHIPTool/app/src/main/java/com/google/chip/chiptool/ChipClient.kt

+4-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ object ChipClient {
7474
AndroidBleManager(context),
7575
PreferencesKeyValueStoreManager(context),
7676
PreferencesConfigurationManager(context),
77-
NsdManagerServiceResolver(context),
77+
NsdManagerServiceResolver(
78+
context,
79+
NsdManagerServiceResolver.NsdManagerResolverAvailState()
80+
),
7881
NsdManagerServiceBrowser(context),
7982
ChipMdnsCallbackImpl(),
8083
DiagnosticDataProviderImpl(context)

examples/darwin-framework-tool/BUILD.gn

+5
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ executable("darwin-framework-tool") {
193193
"commands/common/MTRLogging.h",
194194
"commands/common/RemoteDataModelLogger.h",
195195
"commands/common/RemoteDataModelLogger.mm",
196+
"commands/configuration/Commands.h",
197+
"commands/configuration/ResetMRPParametersCommand.h",
198+
"commands/configuration/ResetMRPParametersCommand.mm",
199+
"commands/configuration/SetMRPParametersCommand.h",
200+
"commands/configuration/SetMRPParametersCommand.mm",
196201
"commands/delay/Commands.h",
197202
"commands/delay/SleepCommand.h",
198203
"commands/delay/SleepCommand.mm",

examples/darwin-framework-tool/commands/common/CHIPCommandBridge.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ inline constexpr char kIdentityGamma[] = "gamma";
3434

3535
class CHIPCommandBridge : public Command {
3636
public:
37-
CHIPCommandBridge(const char * commandName)
38-
: Command(commandName)
37+
CHIPCommandBridge(const char * commandName, const char * helpText = nullptr)
38+
: Command(commandName, helpText)
3939
{
4040
AddArgument("commissioner-name", &mCommissionerName);
4141
AddArgument("commissioner-nodeId", 0, UINT64_MAX, &mCommissionerNodeId,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*
17+
*/
18+
19+
#pragma once
20+
21+
#import <Matter/Matter.h>
22+
23+
#include "ResetMRPParametersCommand.h"
24+
#include "SetMRPParametersCommand.h"
25+
26+
void registerCommandsConfiguration(Commands & commands)
27+
{
28+
const char * clusterName = "Configuration";
29+
30+
commands_list clusterCommands = {
31+
make_unique<SetMRPParametersCommand>(),
32+
make_unique<ResetMRPParametersCommand>(),
33+
};
34+
35+
commands.RegisterCommandSet(clusterName, clusterCommands, "Commands for configuring various state of the Matter framework.");
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#pragma once
19+
20+
#import <Matter/Matter.h>
21+
22+
#include "../common/CHIPCommandBridge.h"
23+
24+
class ResetMRPParametersCommand : public CHIPCommandBridge
25+
{
26+
public:
27+
ResetMRPParametersCommand() : CHIPCommandBridge("reset-mrp-parameters", "Reset MRP parameters to default values.") {}
28+
29+
protected:
30+
/////////// CHIPCommandBridge Interface /////////
31+
CHIP_ERROR RunCommand() override;
32+
33+
// Our command is synchronous, so no need to wait.
34+
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::kZero; }
35+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "ResetMRPParametersCommand.h"
19+
20+
CHIP_ERROR ResetMRPParametersCommand::RunCommand()
21+
{
22+
MTRSetMessageReliabilityParameters(nil, nil, nil, nil);
23+
return CHIP_NO_ERROR;
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#pragma once
19+
20+
#import <Matter/Matter.h>
21+
22+
#include "../common/CHIPCommandBridge.h"
23+
24+
class SetMRPParametersCommand : public CHIPCommandBridge
25+
{
26+
public:
27+
SetMRPParametersCommand() :
28+
CHIPCommandBridge("set-mrp-parameters", "Set various MRP parameters. At least one value must be provided.")
29+
{
30+
AddArgument("idle-interval", 0, UINT32_MAX, &mIdleRetransmitMs,
31+
"Our MRP idle interval (SII) in milliseconds. Defaults to current value if not set.");
32+
AddArgument("active-interval", 0, UINT32_MAX, &mActiveRetransmitMs,
33+
"Our MRP active interval (SAI) in milliseconds. Defaults to current value if not set.");
34+
AddArgument("active-threshold", 0, UINT32_MAX, &mActiveThresholdMs,
35+
"Our MRP active threshold: how long we stay in active mode before transitioning to idle mode. Defaults to "
36+
"current value if not set.");
37+
AddArgument("additional-retransmit-delay", 0, UINT32_MAX, &mAdditionalRetransmitDelayMs,
38+
"Additional delay between retransmits that we do. Defaults to current value if not set.");
39+
}
40+
41+
protected:
42+
/////////// CHIPCommandBridge Interface /////////
43+
CHIP_ERROR RunCommand() override;
44+
45+
// Our command is synchronous, so no need to wait.
46+
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::kZero; }
47+
48+
chip::Optional<uint32_t> mIdleRetransmitMs;
49+
chip::Optional<uint32_t> mActiveRetransmitMs;
50+
chip::Optional<uint32_t> mActiveThresholdMs;
51+
chip::Optional<uint64_t> mAdditionalRetransmitDelayMs;
52+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2024 Project CHIP Authors
3+
* All rights reserved.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
#include "SetMRPParametersCommand.h"
19+
20+
using namespace chip;
21+
22+
namespace {
23+
24+
template <typename T>
25+
NSNumber * _Nullable AsNumber(const Optional<T> & value)
26+
{
27+
if (!value.HasValue()) {
28+
return nil;
29+
}
30+
31+
return @(value.Value());
32+
}
33+
34+
} // anonymous namespace
35+
36+
CHIP_ERROR SetMRPParametersCommand::RunCommand()
37+
{
38+
if (!mIdleRetransmitMs.HasValue() && !mActiveRetransmitMs.HasValue() && !mActiveThresholdMs.HasValue() && !mAdditionalRetransmitDelayMs.HasValue()) {
39+
ChipLogError(chipTool, "set-mrp-parameters needs to have at least one argument provided");
40+
return CHIP_ERROR_INVALID_ARGUMENT;
41+
}
42+
43+
MTRSetMessageReliabilityParameters(AsNumber(mIdleRetransmitMs),
44+
AsNumber(mActiveRetransmitMs),
45+
AsNumber(mActiveThresholdMs),
46+
AsNumber(mAdditionalRetransmitDelayMs));
47+
return CHIP_NO_ERROR;
48+
}

examples/darwin-framework-tool/main.mm

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include "commands/bdx/Commands.h"
2424
#include "commands/common/Commands.h"
25+
#include "commands/configuration/Commands.h"
2526
#include "commands/delay/Commands.h"
2627
#include "commands/discover/Commands.h"
2728
#include "commands/interactive/Commands.h"
@@ -46,6 +47,7 @@ int main(int argc, const char * argv[])
4647
registerCommandsPayload(commands);
4748
registerClusterOtaSoftwareUpdateProviderInteractive(commands);
4849
registerCommandsStorage(commands);
50+
registerCommandsConfiguration(commands);
4951
registerClusters(commands);
5052
return commands.Run(argc, (char **) argv);
5153
}

examples/lighting-app/silabs/src/AppTask.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
#include <platform/CHIPDeviceLayer.h>
4242

43-
#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
43+
#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT
4444
#define LIGHT_LED 1
4545
#else
4646
#define LIGHT_LED 0

examples/platform/silabs/BaseApplication.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
#define APP_EVENT_QUEUE_SIZE 10
8383
#define EXAMPLE_VENDOR_ID 0xcafe
8484

85-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
85+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
8686
#define SYSTEM_STATE_LED 0
8787
#endif // ENABLE_WSTK_LEDS
8888
#define APP_FUNCTION_BUTTON 0
@@ -104,7 +104,7 @@ TimerHandle_t sLightTimer;
104104
TaskHandle_t sAppTaskHandle;
105105
QueueHandle_t sAppEventQueue;
106106

107-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
107+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
108108
LEDWidget sStatusLED;
109109
#endif // ENABLE_WSTK_LEDS
110110

@@ -270,7 +270,7 @@ CHIP_ERROR BaseApplication::Init()
270270
ConfigurationMgr().LogDeviceConfig();
271271

272272
OutputQrCode(true /*refreshLCD at init*/);
273-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
273+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
274274
LEDWidget::InitGpio();
275275
sStatusLED.Init(SYSTEM_STATE_LED);
276276
#endif // ENABLE_WSTK_LEDS
@@ -321,7 +321,7 @@ void BaseApplication::FunctionEventHandler(AppEvent * aEvent)
321321
bool BaseApplication::ActivateStatusLedPatterns()
322322
{
323323
bool isPatternSet = false;
324-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
324+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
325325
#ifdef MATTER_DM_PLUGIN_IDENTIFY_SERVER
326326
if (gIdentify.mActive)
327327
{
@@ -427,7 +427,7 @@ void BaseApplication::LightEventHandler()
427427
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
428428

429429
#if defined(ENABLE_WSTK_LEDS)
430-
#if (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917))
430+
#ifdef SL_CATALOG_SIMPLE_LED_LED1_PRESENT
431431
// Update the status LED if factory reset has not been initiated.
432432
//
433433
// If system has "full connectivity", keep the LED On constantly.
@@ -563,7 +563,7 @@ void BaseApplication::StartFactoryResetSequence()
563563
StartStatusLEDTimer();
564564
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER
565565

566-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
566+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
567567
// Turn off all LEDs before starting blink to make sure blink is
568568
// co-ordinated.
569569
sStatusLED.Set(false);
@@ -596,7 +596,7 @@ void BaseApplication::StartStatusLEDTimer()
596596

597597
void BaseApplication::StopStatusLEDTimer()
598598
{
599-
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT) || defined(SIWX_917)))
599+
#if (defined(ENABLE_WSTK_LEDS) && (defined(SL_CATALOG_SIMPLE_LED_LED1_PRESENT)))
600600
sStatusLED.Set(false);
601601
#endif // ENABLE_WSTK_LEDS
602602

examples/platform/silabs/FreeRTOSConfig.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ extern "C" {
107107

108108
#include <stdint.h>
109109

110-
#ifdef SIWX_917
110+
#ifdef SLI_SI91X_MCU_INTERFACE
111111
#include "si91x_device.h"
112112
extern uint32_t SystemCoreClock;
113113
#else // For EFR32
@@ -169,23 +169,23 @@ extern uint32_t SystemCoreClock;
169169
#define configTIMER_QUEUE_LENGTH (10)
170170
#define configTIMER_TASK_STACK_DEPTH (1024)
171171

172-
#ifdef SIWX_917
172+
#ifdef SLI_SI91X_MCU_INTERFACE
173173
#ifdef __NVIC_PRIO_BITS
174174
#undef __NVIC_PRIO_BITS
175175
#endif
176176
#define configPRIO_BITS 6 /* 6 priority levels. */
177-
#endif // SIWX_917
177+
#endif // SLI_SI91X_MCU_INTERFACE
178178

179179
/* Interrupt priorities used by the kernel port layer itself. These are generic
180180
to all Cortex-M ports, and do not rely on any particular library functions. */
181181
#define configKERNEL_INTERRUPT_PRIORITY (255)
182182
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
183183
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
184-
#ifdef SIWX_917
184+
#ifdef SLI_SI91X_MCU_INTERFACE
185185
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 20
186186
#else
187187
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 48
188-
#endif // SIWX_917
188+
#endif // SLI_SI91X_MCU_INTERFACE
189189

190190
#define configENABLE_FPU 0
191191
#define configENABLE_MPU 0
@@ -232,11 +232,11 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
232232
#ifndef configTOTAL_HEAP_SIZE
233233
#ifdef SL_WIFI
234234
#ifdef DIC_ENABLE
235-
#ifdef SIWX_917
235+
#ifdef SLI_SI91X_MCU_INTERFACE
236236
#define configTOTAL_HEAP_SIZE ((size_t) ((75 + EXTRA_HEAP_k) * 1024))
237237
#else
238238
#define configTOTAL_HEAP_SIZE ((size_t) ((68 + EXTRA_HEAP_k) * 1024))
239-
#endif // SIWX_917
239+
#endif // SLI_SI91X_MCU_INTERFACE
240240
#else
241241
#define configTOTAL_HEAP_SIZE ((size_t) ((42 + EXTRA_HEAP_k) * 1024))
242242
#endif // DIC

0 commit comments

Comments
 (0)