Skip to content

Commit

Permalink
* Move Thread FTD role to MTD (#6499)
Browse files Browse the repository at this point in the history
  • Loading branch information
tima-q authored and pull[bot] committed Jul 30, 2021
1 parent e0739ed commit b937820
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/lighting-app/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ qpg6100_executable("lighting_app") {
"${chip_root}/src/setup_payload",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]

cflags = [ "-Wconversion" ]
Expand Down
4 changes: 2 additions & 2 deletions examples/lock-app/qpg6100/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ qpg6100_executable("lock_app") {
"${chip_root}/src/setup_payload",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform",
"${chip_root}/third_party/openthread/platforms:libopenthread-platform-utils",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-ftd",
"${chip_root}/third_party/openthread/repo:libopenthread-cli-mtd",
"${chip_root}/third_party/openthread/repo:libopenthread-mtd",
]

include_dirs = [
Expand Down
4 changes: 4 additions & 0 deletions examples/platform/qpg6100/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ int CHIP_Init(void)
goto exit;
}

#if CHIP_DEVICE_CONFIG_THREAD_FTD
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_Router);
#else
ret = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#endif
if (ret != CHIP_NO_ERROR)
{
ChipLogError(NotSpecified, "ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
7 changes: 7 additions & 0 deletions examples/platform/qpg6100/project_include/CHIPProjectConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,10 @@
* A size, in bytes, of the individual debug event logging buffer.
*/
#define CHIP_DEVICE_CONFIG_EVENT_LOGGING_DEBUG_BUFFER_SIZE (512)

/**
* CHIP_DEVICE_CONFIG_THREAD_FTD
*
* Disable Full Thread Device features
*/
#define CHIP_DEVICE_CONFIG_THREAD_FTD 0
4 changes: 4 additions & 0 deletions examples/platform/qpg6100/project_include/OpenThreadConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@
// Enable use of external heap allocator (calloc/free) for OpenThread.
#define OPENTHREAD_CONFIG_HEAP_EXTERNAL_ENABLE 1

#if CHIP_DEVICE_CONFIG_THREAD_FTD
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 22
#else
#define OPENTHREAD_CONFIG_NUM_MESSAGE_BUFFERS 10
#endif

#define OPENTHREAD_CONFIG_JOINER_ENABLE 1
#define OPENTHREAD_CONFIG_NCP_UART_ENABLE 1
Expand Down
3 changes: 1 addition & 2 deletions src/platform/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
"../include/platform/KeyValueStoreManager.h",
"../include/platform/PersistedStorage.h",
"../include/platform/PlatformManager.h",
"../include/platform/SoftwareUpdateManager.h",
"../include/platform/SoftwareUpdateManagerImpl.h",
"../include/platform/ThreadStackManager.h",
"../include/platform/TimeSyncManager.h",
Expand Down Expand Up @@ -599,7 +598,7 @@ if (chip_device_platform != "none" && chip_device_platform != "external") {
]

if (chip_enable_openthread) {
public_deps += [ "${openthread_root}:libopenthread-ftd" ]
public_deps += [ "${openthread_root}:libopenthread-mtd" ]

public_configs += [ "${chip_root}/third_party/openthread/platforms/qpg6100:openthread_qpg6100_config" ]

Expand Down

0 comments on commit b937820

Please sign in to comment.