Skip to content

Commit

Permalink
[Silabs] Add hooks into the Silabs performance testing functionality (#…
Browse files Browse the repository at this point in the history
…29160)

* Add hooks into the Silabs performance testing functionality

* Documentation syntax corrections

* Restyled by whitespace

* Restyled by clang-format

* Fix comment typo

---------

Co-authored-by: Restyled.io <commits@restyled.io>
  • Loading branch information
2 people authored and pull[bot] committed Oct 19, 2023
1 parent 5f0a2a7 commit e982f41
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/guides/silabs_efr32_software_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ all of the EFR32 example applications.
- In a terminal start the Provider app passing to it the path to the Matter
OTA file created in the previous step:

rm -r /tmp/chip_*
./out/debug/chip-ota-provider-app -f chip-efr32-lighting-example.ota
rm -r /tmp/chip_kvs_provider
./out/debug/chip-ota-provider-app --KVS /tmp/chip_kvs_provider -f chip-efr32-lighting-example.ota

- In a separate terminal run the chip-tool commands to provision the Provider:

Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/silabs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ combination with JLinkRTTClient as follows:
```
chip-tool pairing ble-thread 1 hex:<operationalDataset> 20202021 3840
chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<chip-tool-node-id>], "targets": null }{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' <lighting-node-id> 0
chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<chip-tool-node-id>], "targets": null },{"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [1], "targets": null }]' <lighting-node-id> 0
chip-tool binding write binding '[{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster":6}]' 1 1
```
Expand Down
8 changes: 8 additions & 0 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
#include "dic_control.h"
#endif // DIC_ENABLE

#ifdef PERFORMANCE_TEST_ENABLED
#include <performance_test_commands.h>
#endif // PERFORMANCE_TEST_ENABLED

/**********************************************************
* Defines and Constants
*********************************************************/
Expand Down Expand Up @@ -248,6 +252,10 @@ CHIP_ERROR BaseApplication::Init()

OutputQrCode(true /*refreshLCD at init*/);

#ifdef PERFORMANCE_TEST_ENABLED
RegisterPerfTestCommands();
#endif // PERFORMANCE_TEST_ENABLED

PlatformMgr().AddEventHandler(OnPlatformEvent, 0);
#ifdef SL_WIFI
sIsProvisioned = ConnectivityMgr().IsWiFiStationProvisioned();
Expand Down
10 changes: 10 additions & 0 deletions examples/platform/silabs/FreeRTOSConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,19 @@ standard names. */
#define SysTick_Handler xPortSysTickHandler

/* Thread local storage pointers used by the SDK */
#ifdef PERFORMANCE_TEST_ENABLED
// ot_debug_channel component uses thread-local storage
#define configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS 2
#ifndef configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS
#define configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS 0
#define configNUM_THREAD_LOCAL_STORAGE_POINTERS \
(configNUM_USER_THREAD_LOCAL_STORAGE_POINTERS + configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS)
#endif
#else /* PERFORMANCE_TEST_ENABLED */
#ifndef configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS
#define configNUM_SDK_THREAD_LOCAL_STORAGE_POINTERS 0
#endif
#endif /* PERFORMANCE_TEST_ENABLED */

#if defined(__GNUC__)
/* For the linker. */
Expand Down
10 changes: 10 additions & 0 deletions examples/platform/silabs/MatterConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys

#include <lib/support/BytesToHex.h>

#ifdef PERFORMANCE_TEST_ENABLED
#include <performance_test_commands.h>
#endif

#if CHIP_ENABLE_OPENTHREAD
#include <inet/EndPointStateOpenThread.h>
#include <openthread/cli.h>
Expand Down Expand Up @@ -226,6 +230,12 @@ CHIP_ERROR SilabsMatterConfig::InitMatter(const char * appName)
initParams.operationalKeystore = &gOperationalKeystore;
#endif

#ifdef PERFORMANCE_TEST_ENABLED
// Set up Test Event Trigger command of the General Diagnostics cluster. Used only in performance testing
static SilabsTestEventTriggerDelegate testEventTriggerDelegate{ ByteSpan(kTestEventTriggerEnableKey) };
initParams.testEventTriggerDelegate = &testEventTriggerDelegate;
#endif

// Initialize the remaining (not overridden) providers to the SDK example defaults
(void) initParams.InitializeStaticResourcesBeforeServerInit();

Expand Down

0 comments on commit e982f41

Please sign in to comment.