-
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.
[Telink] RPC implementation added (#23740)
Basic RPC functionaliy. Signed-off-by: Maciej Bojczuk <[email protected]> Signed-off-by: Maciej Bojczuk <[email protected]>
- Loading branch information
Showing
18 changed files
with
937 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
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,52 @@ | ||
/* | ||
* | ||
* 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. | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "PigweedLogger.h" | ||
#include "pigweed/RpcService.h" | ||
#include <zephyr/zephyr.h> | ||
|
||
namespace chip { | ||
namespace rpc { | ||
class PigweedLoggerMutex : public ::chip::rpc::Mutex | ||
{ | ||
public: | ||
PigweedLoggerMutex() {} | ||
void Lock() override | ||
{ | ||
k_sem * sem = PigweedLogger::GetSemaphore(); | ||
if (sem) | ||
{ | ||
k_sem_take(sem, K_FOREVER); | ||
} | ||
} | ||
void Unlock() override | ||
{ | ||
k_sem * sem = PigweedLogger::GetSemaphore(); | ||
if (sem) | ||
{ | ||
k_sem_give(sem); | ||
} | ||
} | ||
}; | ||
|
||
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
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,47 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
# This file should be used as a configuration overlay to build Pigweed RPCs to | ||
# lighting-app. | ||
|
||
# Enable Pigweed RPC | ||
CONFIG_CHIP_PW_RPC=y | ||
|
||
# Add support for C++17 to build Pigweed components | ||
CONFIG_STD_CPP14=n | ||
CONFIG_STD_CPP17=y | ||
|
||
# Add support for Zephyr console component to use it for Pigweed console purposes | ||
CONFIG_CONSOLE_SUBSYS=y | ||
CONFIG_CONSOLE_GETCHAR=y | ||
CONFIG_CONSOLE_PUTCHAR_BUFSIZE=256 | ||
|
||
# Disable features which may interfere with Pigweed HDLC transport | ||
CONFIG_SHELL=n | ||
CONFIG_OPENTHREAD_SHELL=n | ||
CONFIG_BOOT_BANNER=n | ||
|
||
# Configure Zephyr logger with defaults backends disabled as the app provides its own, | ||
# based on Pigweed HDLC. | ||
CONFIG_LOG=y | ||
CONFIG_LOG_MODE_MINIMAL=n | ||
CONFIG_LOG_MODE_IMMEDIATE=y | ||
CONFIG_LOG_BACKEND_UART=n | ||
CONFIG_LOG_BACKEND_RTT=n | ||
CONFIG_LOG_OUTPUT=y | ||
|
||
# Increase zephyr tty rx buffer | ||
CONFIG_CONSOLE_GETCHAR_BUFSIZE=128 |
Oops, something went wrong.