-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mbed] Add pigweed-app example (#10458)
* Add Mbed pigweed-app example * Remove custom echo_service and use the pigweed version Example cleanup * Fix mbed config CMakeLists * Update Mbed logging mbed_app.json cleanup * Changes for Mbed OS update * Improve examples startup logging * Fix MBED_PATH value Changes restyle * Pigweed-app example cleanup * Fix path to pigweed-app executable * Remove copying pigweed-app executable to build artifacts
- Loading branch information
Showing
22 changed files
with
751 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2020 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/pigweed.gni") | ||
import("$dir_pw_build/target_types.gni") | ||
|
||
declare_args() { | ||
chip_build_pw_rpc_echo_proto = false | ||
} | ||
|
||
static_library("pw_rpc") { | ||
output_name = "libPwRpc" | ||
|
||
public_configs = [ "${dir_pigweed}/pw_hdlc:default_config" ] | ||
deps = [ | ||
"$dir_pw_rpc:server", | ||
"${chip_root}/examples/platform/mbed/pw_sys_io:pw_sys_io_mbed", | ||
"${dir_pigweed}/pw_hdlc:pw_rpc", | ||
dir_pw_assert, | ||
dir_pw_hdlc, | ||
dir_pw_log, | ||
] | ||
|
||
if (chip_build_pw_rpc_echo_proto) { | ||
deps += [ "$dir_pw_rpc/nanopb:echo_service" ] | ||
} | ||
|
||
deps += pw_build_LINK_DEPS | ||
|
||
output_dir = "${root_out_dir}/lib" | ||
|
||
complete_static_lib = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright (c) 2021 Project CHIP Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import("//build_overrides/chip.gni") | ||
import("//build_overrides/pigweed.gni") | ||
|
||
pw_log_BACKEND = "$dir_pw_log_basic" | ||
pw_assert_BACKEND = "$dir_pw_assert_log" | ||
pw_sys_io_BACKEND = | ||
"${chip_root}/examples/platform/mbed/pw_sys_io:pw_sys_io_mbed" | ||
pw_rpc_system_server_BACKEND = | ||
"${chip_root}/examples/common/pigweed:system_rpc_server" | ||
|
||
pw_build_LINK_DEPS = [ | ||
"$dir_pw_assert:impl", | ||
"$dir_pw_log:impl", | ||
] | ||
|
||
dir_pw_third_party_nanopb = "${chip_root}/third_party/nanopb/repo" | ||
|
||
chip_enable_pw_rpc = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Project CHIP Authors | ||
* All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "PigweedLoggerMutex.h" | ||
|
||
namespace chip { | ||
namespace rpc { | ||
|
||
PigweedLoggerMutex logger_mutex; | ||
|
||
} // namespace rpc | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* | ||
* Copyright (c) 2021 Project CHIP Authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "PigweedLogger.h" | ||
#include "pigweed/RpcService.h" | ||
#include "rtos/Mutex.h" | ||
|
||
namespace chip { | ||
namespace rpc { | ||
class PigweedLoggerMutex : public chip::rpc::Mutex | ||
{ | ||
|
||
public: | ||
void Lock() override | ||
{ | ||
rtos::Mutex * mutex = PigweedLogger::GetSemaphore(); | ||
if (mutex) | ||
{ | ||
mutex->lock(); | ||
} | ||
} | ||
void Unlock() override | ||
{ | ||
rtos::Mutex * mutex = PigweedLogger::GetSemaphore(); | ||
if (mutex) | ||
{ | ||
mutex->unlock(); | ||
} | ||
} | ||
}; | ||
|
||
extern PigweedLoggerMutex logger_mutex; | ||
|
||
} // namespace rpc | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
config/ | ||
build-*/ |
Oops, something went wrong.