Skip to content

Commit

Permalink
Add OpenThread UDP endpoints (#15137)
Browse files Browse the repository at this point in the history
* Support OpenThread UDP endpoints on the qpg platforms
* clean-up of some `*.gn` and `*.gni` files
  • Loading branch information
thcu-gp authored and pull[bot] committed Sep 15, 2023
1 parent c0c6e93 commit 1986464
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 7 deletions.
1 change: 0 additions & 1 deletion examples/lighting-app/qpg/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import("//build_overrides/chip.gni")
import("${chip_root}/config/qpg/lib/pw_rpc/pw_rpc.gni")
import("${chip_root}/examples/platform/qpg/args.gni")

qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")

Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/qpg/with_pw_rpc.gni
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ import("${chip_root}/examples/platform/qpg/args.gni")
qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")

chip_enable_pw_rpc = true
chip_enable_openthread = true

cpp_standard = "gnu++17"
1 change: 0 additions & 1 deletion examples/persistent-storage/qpg/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ qpg_executable("persistent_storage") {
include_dirs += [
"${qpg_project_dir}/include",
"${examples_plat_dir}",
"${examples_plat_dir}/app/include",
]

sources = [
Expand Down
2 changes: 2 additions & 0 deletions examples/platform/qpg/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import("//build_overrides/chip.gni")

import("${chip_root}/src/platform/qpg/args.gni")

chip_enable_openthread = true
chip_openthread_ftd = false
chip_system_config_use_open_thread_udp = true
openthread_project_core_config_file = "OpenThreadConfig.h"
openthread_core_config_deps = []
openthread_core_config_deps = [
Expand Down
3 changes: 3 additions & 0 deletions examples/platform/qpg/shell_common/shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ int ShellTask::Init(void)
cmd_otcli_init();
cmd_ping_init();
cmd_send_init();
#if CHIP_SHELL_ENABLE_CMD_SERVER
cmd_app_server_init();
#endif // CHIP_SHELL_ENABLE_CMD_SERVER

return err;
}
Expand Down
1 change: 0 additions & 1 deletion examples/shell/qpg/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ qpg_sdk_target = get_label_info(":sdk", "label_no_toolchain")

pw_log_BACKEND = "${chip_root}/src/lib/support/pw_log_chip"
pw_assert_BACKEND = "$dir_pw_assert_log"
chip_enable_openthread = true
chip_build_libshell = true
2 changes: 1 addition & 1 deletion src/inet/UDPEndPointImpl_OpenThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void UDPEndPointImplOT::handleUdpReceive(void * aContext, otMessage * aMessage,
ChipLogError(Inet, "Failed to copy OpenThread buffer into System Packet buffer");
return;
}
payload->SetDataLength(msgLen + sizeof(IPPacketInfo));
payload->SetDataLength(static_cast<uint16_t>(msgLen + sizeof(IPPacketInfo)));

ep->Retain();
CHIP_ERROR err = ep->GetSystemLayer().ScheduleLambda([ep, p = System::LwIPPacketBufferView::UnsafeGetLwIPpbuf(payload)] {
Expand Down
6 changes: 4 additions & 2 deletions src/platform/qpg/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import("//build_overrides/chip.gni")
import("//build_overrides/qpg_sdk.gni")
import("${qpg_sdk_build_root}/qpg_sdk.gni")

# ARM architecture flags will be set for QPG family.
arm_platform_config = "${qpg_sdk_build_root}/qpg_arm.gni"
Expand Down Expand Up @@ -44,9 +45,10 @@ chip_build_tests = false
chip_enable_rotating_device_id = false

openthread_external_mbedtls = mbedtls_target
openthread_project_core_config_file = "openthread-core-qpg6105-config.h"
openthread_project_core_config_file =
"openthread-core-${qpg_target_ic}-config.h"
openthread_core_config_platform_check_file =
"openthread-core-qpg6105-config-check.h"
"openthread-core-${qpg_target_ic}-config-check.h"
openthread_core_config_deps = [
"${chip_root}/third_party/openthread/platforms/qpg:libopenthread-qpg-config",
]
Expand Down

0 comments on commit 1986464

Please sign in to comment.