Skip to content

Commit

Permalink
[nrfconnect] Remove test mode from examples (#21676)
Browse files Browse the repository at this point in the history
It is a leftover from very early phase of the project when
we had the redezvous bypass mode.

Signed-off-by: Damian Krolik <[email protected]>
  • Loading branch information
Damian-Nordic authored Aug 9, 2022
1 parent 36fb7cd commit a30d766
Show file tree
Hide file tree
Showing 43 changed files with 5 additions and 328 deletions.
1 change: 0 additions & 1 deletion examples/chef/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ target_sources(app PRIVATE
${CHEF}/common/stubs.cpp
${GEN_DIR}/callback-stub.cpp
${GEN_DIR}/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
)

message(STATUS ${CHEF}/devices/${SAMPLE_NAME}.zap)
Expand Down
6 changes: 0 additions & 6 deletions examples/chef/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ CONFIG_PWM=y
# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLight"

Expand Down
1 change: 0 additions & 1 deletion examples/light-switch-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ target_sources(app PRIVATE
${GEN_DIR}/light-switch-app/zap-generated/callback-stub.cpp
${GEN_DIR}/light-switch-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp)


if(CONFIG_CHIP_OTA_REQUESTOR)
Expand Down
5 changes: 0 additions & 5 deletions examples/light-switch-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@ has Thread disabled, and it should be paired with Matter controller and get
configuration from it. Some actions required before establishing full
communication are described below.

The example also comes with a test mode, which allows to start Thread with the
default settings by pressing button manually. However, this mode does not
guarantee that the device will be able to communicate with the Matter controller
and other devices.

The example can be configured to use the secure bootloader and utilize it for
performing over-the-air Device Firmware Upgrade using Bluetooth LE.

Expand Down
1 change: 0 additions & 1 deletion examples/light-switch-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "AppConfig.h"
#include "LEDWidget.h"
#include "LightSwitch.h"
#include "ThreadUtil.h"

#include <DeviceInfoProviderImpl.h>
#include <app/clusters/identify-server/identify-server.h>
Expand Down
3 changes: 1 addition & 2 deletions examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ target_sources(app PRIVATE
${GEN_DIR}/lighting-app/zap-generated/callback-stub.cpp
${GEN_DIR}/lighting-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/PWMDevice.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp)
${NRFCONNECT_COMMON}/util/PWMDevice.cpp)

chip_configure_data_model(app
INCLUDE_SERVER
Expand Down
8 changes: 0 additions & 8 deletions examples/lighting-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,6 @@ Thread disabled, and it should be paired with Matter controller and get
configuration from it. Some actions required before establishing full
communication are described below.

The example also comes with a test mode, which allows to start Thread with the
default settings by pressing button manually. However, this mode does not
guarantee that the device will be able to communicate with the Matter controller
and other devices.

The example can be configured to use the secure bootloader and utilize it for
performing over-the-air Device Firmware Upgrade using Bluetooth LE.

Expand Down Expand Up @@ -241,9 +236,6 @@ effect.
**Button 2** &mdash; Pressing the button once changes the lighting state to the
opposite one.

**Button 3** &mdash; Pressing the button once starts the Thread networking in
the test mode using the default configuration.

**Button 4** &mdash; Pressing the button once starts the NFC tag emulation and
enables Bluetooth LE advertising for the predefined period of time (15 minutes
by default).
Expand Down
25 changes: 0 additions & 25 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "AppEvent.h"
#include "LEDWidget.h"
#include "PWMDevice.h"
#include "ThreadUtil.h"

#include <DeviceInfoProviderImpl.h>
#include <app-common/zap-generated/attribute-id.h>
Expand Down Expand Up @@ -270,14 +269,6 @@ void AppTask::ButtonEventHandler(uint32_t button_state, uint32_t has_changed)
sAppTask.PostEvent(&button_event);
}

if (THREAD_START_BUTTON_MASK & button_state & has_changed)
{
button_event.ButtonEvent.PinNo = THREAD_START_BUTTON;
button_event.ButtonEvent.Action = kButtonPushEvent;
button_event.Handler = StartThreadHandler;
sAppTask.PostEvent(&button_event);
}

if (BLE_ADVERTISEMENT_START_BUTTON_MASK & button_state & has_changed)
{
button_event.ButtonEvent.PinNo = BLE_ADVERTISEMENT_START_BUTTON;
Expand Down Expand Up @@ -399,22 +390,6 @@ void AppTask::FunctionHandler(AppEvent * aEvent)
}
}

void AppTask::StartThreadHandler(AppEvent * aEvent)
{
if (aEvent->ButtonEvent.PinNo != THREAD_START_BUTTON)
return;

if (!chip::DeviceLayer::ConnectivityMgr().IsThreadProvisioned())
{
StartDefaultThreadNetwork();
LOG_INF("Device is not commissioned to a Thread network. Starting with the default configuration.");
}
else
{
LOG_INF("Device is commissioned to a Thread network.");
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/nrfconnect/main/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define LIGHTING_BUTTON_MASK DK_BTN2_MSK
#define FUNCTION_BUTTON DK_BTN1
#define FUNCTION_BUTTON_MASK DK_BTN1_MSK
#define THREAD_START_BUTTON DK_BTN3
#define THREAD_START_BUTTON_MASK DK_BTN3_MSK
#define BLE_ADVERTISEMENT_START_BUTTON DK_BTN4
#define BLE_ADVERTISEMENT_START_BUTTON_MASK DK_BTN4_MSK

Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class AppTask
static void UpdateLedStateEventHandler(AppEvent * aEvent);
static void FunctionTimerEventHandler(AppEvent * aEvent);
static void FunctionHandler(AppEvent * aEvent);
static void StartThreadHandler(AppEvent * aEvent);
static void LightingActionEventHandler(AppEvent * aEvent);
static void StartBLEAdvertisementHandler(AppEvent * aEvent);

Expand Down
6 changes: 0 additions & 6 deletions examples/lighting-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ CONFIG_PWM=y
# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLight"

Expand Down
6 changes: 0 additions & 6 deletions examples/lighting-app/nrfconnect/prj_no_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ CONFIG_PWM=y
# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLight"

Expand Down
6 changes: 0 additions & 6 deletions examples/lighting-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ CONFIG_PWM=y
# OpenThread configs
CONFIG_OPENTHREAD_NORDIC_LIBRARY_FTD=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLight"

Expand Down
3 changes: 1 addition & 2 deletions examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ target_sources(app PRIVATE
main/ZclCallbacks.cpp
${GEN_DIR}/lock-app/zap-generated/callback-stub.cpp
${GEN_DIR}/lock-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp)
${NRFCONNECT_COMMON}/util/LEDWidget.cpp)

chip_configure_data_model(app
INCLUDE_SERVER
Expand Down
8 changes: 0 additions & 8 deletions examples/lock-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ Thread disabled, and it should be paired with Matter controller and get
configuration from it. Some actions required before establishing full
communication are described below.

The example also comes with a test mode, which allows to start Thread with the
default settings by pressing button manually. However, this mode does not
guarantee that the device will be able to communicate with the Matter controller
and other devices.

The example can be configured to use the secure bootloader and utilize it for
performing over-the-air Device Firmware Upgrade using Bluetooth LE.

Expand Down Expand Up @@ -227,9 +222,6 @@ states are possible:
**Button 2** &mdash; Pressing the button once changes the lock state to the
opposite one.

**Button 3** &mdash; Pressing the button once starts the Thread networking in
the test mode using the default configuration.

**Button 4** &mdash; Pressing the button once starts the NFC tag emulation and
enables Bluetooth LE advertising for the predefined period of time (15 minutes
by default).
Expand Down
25 changes: 0 additions & 25 deletions examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "AppConfig.h"
#include "BoltLockManager.h"
#include "LEDWidget.h"
#include "ThreadUtil.h"

#include <DeviceInfoProviderImpl.h>
#include <app-common/zap-generated/attribute-id.h>
Expand Down Expand Up @@ -249,14 +248,6 @@ void AppTask::ButtonEventHandler(uint32_t button_state, uint32_t has_changed)
sAppTask.PostEvent(&button_event);
}

if (THREAD_START_BUTTON_MASK & button_state & has_changed)
{
button_event.ButtonEvent.PinNo = THREAD_START_BUTTON;
button_event.ButtonEvent.Action = BUTTON_PUSH_EVENT;
button_event.Handler = StartThreadHandler;
sAppTask.PostEvent(&button_event);
}

if (BLE_ADVERTISEMENT_START_BUTTON_MASK & button_state & has_changed)
{
button_event.ButtonEvent.PinNo = BLE_ADVERTISEMENT_START_BUTTON;
Expand Down Expand Up @@ -373,22 +364,6 @@ void AppTask::FunctionHandler(AppEvent * aEvent)
}
}

void AppTask::StartThreadHandler(AppEvent * aEvent)
{
if (aEvent->ButtonEvent.PinNo != THREAD_START_BUTTON)
return;

if (!ConnectivityMgr().IsThreadProvisioned())
{
StartDefaultThreadNetwork();
LOG_INF("Device is not commissioned to a Thread network. Starting with the default configuration.");
}
else
{
LOG_INF("Device is commissioned to a Thread network.");
}
}

void AppTask::StartBLEAdvertisementHandler(AppEvent *)
{
if (Server::GetInstance().GetFabricTable().FabricCount() != 0)
Expand Down
2 changes: 0 additions & 2 deletions examples/lock-app/nrfconnect/main/include/AppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#define LOCK_BUTTON_MASK DK_BTN2_MSK
#define FUNCTION_BUTTON DK_BTN1
#define FUNCTION_BUTTON_MASK DK_BTN1_MSK
#define THREAD_START_BUTTON DK_BTN3
#define THREAD_START_BUTTON_MASK DK_BTN3_MSK
#define BLE_ADVERTISEMENT_START_BUTTON DK_BTN4
#define BLE_ADVERTISEMENT_START_BUTTON_MASK DK_BTN4_MSK

Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class AppTask
static void UpdateLedStateEventHandler(AppEvent * aEvent);
static void FunctionTimerEventHandler(AppEvent * aEvent);
static void FunctionHandler(AppEvent * aEvent);
static void StartThreadHandler(AppEvent * aEvent);
static void LockActionEventHandler(AppEvent * aEvent);
static void StartBLEAdvertisementHandler(AppEvent * aEvent);

Expand Down
6 changes: 0 additions & 6 deletions examples/lock-app/nrfconnect/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLock"

Expand Down
6 changes: 0 additions & 6 deletions examples/lock-app/nrfconnect/prj_no_dfu.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLock"

Expand Down
6 changes: 0 additions & 6 deletions examples/lock-app/nrfconnect/prj_release.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ CONFIG_OPENTHREAD_MTD=y
CONFIG_OPENTHREAD_FTD=n
CONFIG_CHIP_ENABLE_SLEEPY_END_DEVICE_SUPPORT=y

# Default OpenThread network settings
CONFIG_OPENTHREAD_PANID=4660
CONFIG_OPENTHREAD_CHANNEL=15
CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread"
CONFIG_OPENTHREAD_XPANID="11:11:11:11:22:22:22:22"

# Bluetooth overrides
CONFIG_BT_DEVICE_NAME="MatterLock"

Expand Down
50 changes: 0 additions & 50 deletions examples/platform/nrfconnect/util/ThreadUtil.cpp

This file was deleted.

20 changes: 0 additions & 20 deletions examples/platform/nrfconnect/util/include/ThreadUtil.h

This file was deleted.

3 changes: 1 addition & 2 deletions examples/pump-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ target_sources(app PRIVATE
main/ZclCallbacks.cpp
${GEN_DIR}/pump-app/zap-generated/callback-stub.cpp
${GEN_DIR}/pump-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp)
${NRFCONNECT_COMMON}/util/LEDWidget.cpp)

chip_configure_data_model(app
INCLUDE_SERVER
Expand Down
Loading

0 comments on commit a30d766

Please sign in to comment.