3 * Copyright (c) 2021 Project CHIP Authors
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 #include "AppConfig.h"
19 #include "LEDWidget.h"
20 #include "init_efrPlatform.h"
22 #include "pw_rpc/echo_service_nanopb.h"
23 #include "pw_sys_io/sys_io.h"
24 #include "pw_sys_io_efr32/init.h"
27 #include "PigweedLoggerMutex.h"
28 #include "pigweed/RpcService.h"
32 static LEDWidget sStatusLED;
37 #define RPC_TASK_STACK_SIZE 4096
38 #define RPC_TASK_PRIORITY 2
39 static TaskHandle_t sRpcTaskHandle;
41 pw::rpc::EchoService echo_service;
43 void RegisterServices(pw::rpc::Server & server)
45 server.RegisterService(echo_service);
48 void RunRpcService(void *)
50 Start(RegisterServices, &::chip::rpc::logger_mutex);
58 EFR32_LOG("***** CHIP EFR32 pigweed example *****\r\n");
62 LEDWidget::InitGpio();
63 sStatusLED.Init(SYSTEM_STATE_LED);
66 xTaskCreate(RunRpcService, "RPC_Task", RPC_TASK_STACK_SIZE / sizeof(StackType_t), nullptr, RPC_TASK_PRIORITY, &sRpcTaskHandle);
68 vTaskStartScheduler();