Skip to content

Commit 5b74b8b

Browse files
authored
Merge branch 'master' into remove-no-longer-needed-script
2 parents aef89ed + 60edbf5 commit 5b74b8b

Some content is hidden

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

44 files changed

+5948
-9221
lines changed

.restyled.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ exclude:
7474
- "examples/chef/sample_app_util/test_files/*.yaml"
7575
- "examples/chef/zzz_generated/**/*"
7676
- "examples/platform/nxp/k32w/k32w0/scripts/demo_generated_certs/**/*"
77+
- "examples/tv-casting-app/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/*" # zap-generated files
7778
- "integrations/cloudbuild/*.yaml" # uglier long command line content
7879
- "scripts/run_codegen_targets.sh" # shellharden breaks for loops over command outputs
7980
- "scripts/tagging/tag_new_release.sh" # shellharden breaks parameter passing

examples/platform/silabs/MatterConfig.cpp

+68-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@
4646
#include "wfx_rsi.h"
4747
#endif /* SLI_SI91X_MCU_INTERFACE */
4848

49-
using namespace ::chip;
50-
using namespace ::chip::Inet;
51-
using namespace ::chip::DeviceLayer;
52-
5349
#include <crypto/CHIPCryptoPAL.h>
5450
// If building with the EFR32-provided crypto backend, we can use the
5551
// opaque keystore
@@ -75,6 +71,36 @@ static chip::DeviceLayer::Internal::Efr32PsaOperationalKeystore gOperationalKeys
7571
#include <performance_test_commands.h>
7672
#endif
7773

74+
#include <AppTask.h>
75+
76+
#include <DeviceInfoProviderImpl.h>
77+
#include <app/server/Server.h>
78+
#include <credentials/DeviceAttestationCredsProvider.h>
79+
#include <examples/platform/silabs/SilabsDeviceAttestationCreds.h>
80+
81+
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
82+
83+
#include "FreeRTOSConfig.h"
84+
#include "event_groups.h"
85+
#include "task.h"
86+
87+
/**********************************************************
88+
* Defines
89+
*********************************************************/
90+
91+
#define MAIN_TASK_STACK_SIZE (1024 * 5)
92+
#define MAIN_TASK_PRIORITY (configMAX_PRIORITIES - 1)
93+
94+
using namespace ::chip;
95+
using namespace ::chip::Inet;
96+
using namespace ::chip::DeviceLayer;
97+
using namespace ::chip::Credentials::Silabs;
98+
using namespace chip::DeviceLayer::Silabs;
99+
100+
TaskHandle_t main_Task;
101+
volatile int apperror_cnt;
102+
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
103+
78104
#if CHIP_ENABLE_OPENTHREAD
79105
#include <inet/EndPointStateOpenThread.h>
80106
#include <openthread/cli.h>
@@ -129,6 +155,44 @@ CHIP_ERROR SilabsMatterConfig::InitOpenThread(void)
129155
}
130156
#endif // CHIP_ENABLE_OPENTHREAD
131157

158+
namespace {
159+
void application_start(void * unused)
160+
{
161+
CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME);
162+
if (err != CHIP_NO_ERROR)
163+
appError(err);
164+
165+
gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
166+
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
167+
168+
chip::DeviceLayer::PlatformMgr().LockChipStack();
169+
// Initialize device attestation config
170+
SetDeviceAttestationCredentialsProvider(Credentials::Silabs::GetSilabsDacProvider());
171+
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
172+
173+
SILABS_LOG("Starting App Task");
174+
err = AppTask::GetAppTask().StartAppTask();
175+
if (err != CHIP_NO_ERROR)
176+
appError(err);
177+
178+
vTaskDelete(main_Task);
179+
}
180+
} // namespace
181+
182+
void SilabsMatterConfig::AppInit()
183+
{
184+
GetPlatform().Init();
185+
186+
xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task);
187+
SILABS_LOG("Starting scheduler");
188+
GetPlatform().StartScheduler();
189+
190+
// Should never get here.
191+
chip::Platform::MemoryShutdown();
192+
SILABS_LOG("Start Scheduler Failed");
193+
appError(CHIP_ERROR_INTERNAL);
194+
}
195+
132196
#if SILABS_OTA_ENABLED
133197
void SilabsMatterConfig::InitOTARequestorHandler(System::Layer * systemLayer, void * appState)
134198
{

examples/platform/silabs/MatterConfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class SilabsMatterConfig
2626
{
2727
public:
2828
static CHIP_ERROR InitMatter(const char * appName);
29+
static void AppInit();
2930

3031
private:
3132
static CHIP_ERROR InitOpenThread(void);

examples/platform/silabs/main.cpp

+7-68
Original file line numberDiff line numberDiff line change
@@ -16,77 +16,16 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19-
20-
#include <AppTask.h>
21-
22-
#include "AppConfig.h"
23-
24-
#include <DeviceInfoProviderImpl.h>
19+
#include "sl_component_catalog.h"
20+
#include "sl_system_init.h"
21+
#include "sl_system_kernel.h"
2522
#include <MatterConfig.h>
26-
#include <app/server/Server.h>
27-
#include <credentials/DeviceAttestationCredsProvider.h>
28-
#include <examples/platform/silabs/SilabsDeviceAttestationCreds.h>
29-
30-
#include <platform/silabs/platformAbstraction/SilabsPlatform.h>
31-
32-
#include "FreeRTOS.h"
33-
#include "FreeRTOSConfig.h"
34-
#include "event_groups.h"
35-
#include "task.h"
36-
37-
/**********************************************************
38-
* Defines
39-
*********************************************************/
40-
41-
#define MAIN_TASK_STACK_SIZE (1024 * 5)
42-
#define MAIN_TASK_PRIORITY (configMAX_PRIORITIES - 1)
43-
44-
using namespace ::chip;
45-
using namespace ::chip::DeviceLayer;
46-
using namespace ::chip::Credentials;
47-
using namespace chip::DeviceLayer::Silabs;
48-
49-
TaskHandle_t main_Task;
50-
void application_start(void * unused);
51-
volatile int apperror_cnt;
52-
static chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider;
5323

54-
// ================================================================================
55-
// Main Code
56-
// ================================================================================
5724
int main(void)
5825
{
59-
GetPlatform().Init();
60-
61-
xTaskCreate(application_start, "main_task", MAIN_TASK_STACK_SIZE, NULL, MAIN_TASK_PRIORITY, &main_Task);
62-
63-
SILABS_LOG("Starting scheduler");
64-
GetPlatform().StartScheduler();
65-
66-
// Should never get here.
67-
chip::Platform::MemoryShutdown();
68-
SILABS_LOG("vTaskStartScheduler() failed");
69-
appError(CHIP_ERROR_INTERNAL);
70-
}
71-
72-
void application_start(void * unused)
73-
{
74-
CHIP_ERROR err = SilabsMatterConfig::InitMatter(BLE_DEV_NAME);
75-
if (err != CHIP_NO_ERROR)
76-
appError(err);
77-
78-
gExampleDeviceInfoProvider.SetStorageDelegate(&chip::Server::GetInstance().GetPersistentStorage());
79-
chip::DeviceLayer::SetDeviceInfoProvider(&gExampleDeviceInfoProvider);
80-
81-
chip::DeviceLayer::PlatformMgr().LockChipStack();
82-
// Initialize device attestation config
83-
SetDeviceAttestationCredentialsProvider(Credentials::Silabs::GetSilabsDacProvider());
84-
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
85-
86-
SILABS_LOG("Starting App Task");
87-
err = AppTask::GetAppTask().StartAppTask();
88-
if (err != CHIP_NO_ERROR)
89-
appError(err);
26+
sl_system_init();
9027

91-
vTaskDelete(main_Task);
28+
// Initialize the application. For example, create periodic timer(s) or
29+
// task(s) if the kernel is present.
30+
SilabsMatterConfig::AppInit();
9231
}

examples/tv-casting-app/APIs.md

+17-8
Original file line numberDiff line numberDiff line change
@@ -905,17 +905,26 @@ Once the Casting Client has selected an `Endpoint`, it is ready to
905905
[issue commands](#issuing-commands) to it, [read](#read-operations) current
906906
playback state, and [subscribe](#subscriptions) to playback events.
907907
908-
Refer to the following platform specific files for a list of clusters, command
909-
and attributes supported by the Matter TV Casting library:
908+
On Linux refer to the following platform specific files:
910909
911-
1. Linux:
910+
1. For a list of clusters, commands and attributes supported by the Matter TV
911+
Casting library:
912912
[tv-casting-common/clusters/Clusters.h](tv-casting-common/clusters/Clusters.h)
913+
2. For the IDs and request / response types to use with these APIs:
914+
[/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h](/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h)
913915
914-
Refer to the following platform specific files for the IDs and request /
915-
response types to use with these APIs:
916+
On iOS refer to the following platform specific files:
916917
917-
1. Linux:
918-
[/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h](/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h)
918+
1. For a list of clusters, commands and attributes supported by the Matter TV
919+
Casting library:
920+
[/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCClusterObjects.h)
921+
2. For the IDs and request / response types to use with the commands:
922+
[/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandObjects.h)
923+
and
924+
[/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCCommandPayloads.h)
925+
3. For attribute [read operations](#read-operations) and
926+
[subscriptions](#subscriptions):
927+
[/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h](/darwin/MatterTvCastingBridge/MatterTvCastingBridge/zap-generated/MCAttributeObjects.h)
919928
920929
### Issuing Commands
921930
@@ -998,7 +1007,7 @@ if(launchURLCommand == nil)
9981007
}
9991008
10001009
// create the LaunchURL request
1001-
let request: MCContentLauncherClusterLaunchURLRequest = MCContentLauncherClusterLaunchURLRequest()
1010+
let request: MCContentLauncherClusterLaunchURLParams = MCContentLauncherClusterLaunchURLParams()
10021011
request.contentURL = contentUrl
10031012
request.displayString = displayString
10041013

0 commit comments

Comments
 (0)