Skip to content

Commit

Permalink
[nrfconnect] Enable using Nordic OpenThread libraries configs (#15855)
Browse files Browse the repository at this point in the history
Nrfconnect platform uses custom OpenThread settings that are
different from the Thread certified libraries.

* Removed custom OpenThread configuration from examples
and enabled OpenThread Nordic library MTD/FTD configs
* Changed lighting default config from MTD to FTD
  • Loading branch information
kkasperczyk-no authored Mar 4, 2022
1 parent 9dcdf37 commit 08ca987
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 11 deletions.
10 changes: 0 additions & 10 deletions config/nrfconnect/app/sample-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,8 @@ CONFIG_CHIP_NFC_COMMISSIONING=y
# L2 OpenThread enabling
CONFIG_NET_L2_OPENTHREAD=y

# OpenThread configs
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_OPENTHREAD_SLAAC=y
CONFIG_OPENTHREAD_MTD_NETDIAG=y
CONFIG_OPENTHREAD_MANUAL_START=y
CONFIG_OPENTHREAD_NUM_MESSAGE_BUFFERS=64

# Enable Thread 1.2 features
CONFIG_OPENTHREAD_THREAD_VERSION_1_2=y
CONFIG_OPENTHREAD_DUA=y
CONFIG_OPENTHREAD_MLR=y

# Use mbedTLS from nrf_security library
CONFIG_OPENTHREAD_NRF_SECURITY_CHOICE=y
Expand Down
4 changes: 4 additions & 0 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ CHIP_ERROR AppTask::Init()
return err;
}

#ifdef CONFIG_OPENTHREAD_MTD
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_FullEndDevice);
#endif
if (err != CHIP_NO_ERROR)
{
LOG_ERR("ConnectivityMgr().SetThreadDeviceType() failed");
Expand Down
3 changes: 3 additions & 0 deletions examples/lighting-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
CONFIG_DK_LIBRARY=y
CONFIG_PWM=y

# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
Expand Down
4 changes: 3 additions & 1 deletion examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ CHIP_ERROR AppTask::Init()

#ifdef CONFIG_OPENTHREAD_MTD_SED
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_SleepyEndDevice);
#else
#elif CONFIG_OPENTHREAD_MTD
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_MinimalEndDevice);
#else
err = ConnectivityMgr().SetThreadDeviceType(ConnectivityManager::kThreadDeviceType_FullEndDevice);
#endif
if (err != CHIP_NO_ERROR)
{
Expand Down
5 changes: 5 additions & 0 deletions examples/lock-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y

# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y

# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
Expand Down
5 changes: 5 additions & 0 deletions examples/pump-controller-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
# Add support for LEDs and buttons on Nordic development kits
CONFIG_DK_LIBRARY=y

# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_MTD=y
CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
Expand Down

0 comments on commit 08ca987

Please sign in to comment.