Skip to content

Commit

Permalink
[nrf fromtree] Remove test mode from examples (project-chip#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
markaj-nordic authored and Damian-Nordic committed Aug 12, 2022
1 parent a585abf commit 238a18d
Show file tree
Hide file tree
Showing 30 changed files with 7 additions and 289 deletions.
16 changes: 0 additions & 16 deletions config/nrfconnect/chip-module/Kconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -222,22 +222,6 @@ config NET_L2_OPENTHREAD

if NET_L2_OPENTHREAD

config OPENTHREAD_PANID
int
default 4660

config OPENTHREAD_CHANNEL
int
default 15

config OPENTHREAD_NETWORK_NAME
string
default "OpenThread"

config OPENTHREAD_XPANID
string
default "11:11:11:11:22:22:22:22"

# Increase the default RX stack size
config IEEE802154_NRF5_RX_STACK_SIZE
int
Expand Down
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
$<$<BOOL:${CONFIG_NET_L2_OPENTHREAD}>:${NRFCONNECT_COMMON}/util/ThreadUtil.cpp>
)

message(STATUS ${CHEF}/devices/${SAMPLE_NAME}.zap)
Expand Down
3 changes: 1 addition & 2 deletions examples/light-switch-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ target_sources(app PRIVATE
main/BindingHandler.cpp
${GEN_DIR}/light-switch-app/zap-generated/callback-stub.cpp
${GEN_DIR}/light-switch-app/zap-generated/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
$<$<BOOL:${CONFIG_NET_L2_OPENTHREAD}>:${NRFCONNECT_COMMON}/util/ThreadUtil.cpp>)
${NRFCONNECT_COMMON}/util/LEDWidget.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
3 changes: 0 additions & 3 deletions examples/light-switch-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#include "AppConfig.h"
#include "LEDWidget.h"
#include "LightSwitch.h"
#ifdef CONFIG_NET_L2_OPENTHREAD
#include "ThreadUtil.h"
#endif

#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
$<$<BOOL:${CONFIG_NET_L2_OPENTHREAD}>:${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
31 changes: 0 additions & 31 deletions examples/lighting-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#include "AppEvent.h"
#include "LEDWidget.h"
#include "PWMDevice.h"
#ifdef CONFIG_NET_L2_OPENTHREAD
#include "ThreadUtil.h"
#endif

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

#ifdef CONFIG_NET_L2_OPENTHREAD
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);
}
#endif

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

#ifdef CONFIG_NET_L2_OPENTHREAD
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.");
}
}
#endif

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
4 changes: 1 addition & 3 deletions examples/lighting-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ class AppTask
static void UpdateLedStateEventHandler(AppEvent * aEvent);
static void FunctionTimerEventHandler(AppEvent * aEvent);
static void FunctionHandler(AppEvent * aEvent);
#ifdef CONFIG_NET_L2_OPENTHREAD
static void StartThreadHandler(AppEvent * aEvent);
#endif

static void LightingActionEventHandler(AppEvent * aEvent);
static void StartBLEAdvertisementHandler(AppEvent * aEvent);

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
$<$<BOOL:${CONFIG_NET_L2_OPENTHREAD}>:${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
31 changes: 0 additions & 31 deletions examples/lock-app/nrfconnect/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
#include "AppConfig.h"
#include "BoltLockManager.h"
#include "LEDWidget.h"
#ifdef CONFIG_NET_L2_OPENTHREAD
#include "ThreadUtil.h"
#endif

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

#ifdef CONFIG_NET_L2_OPENTHREAD
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);
}
#endif

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

#ifdef CONFIG_NET_L2_OPENTHREAD
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.");
}
}
#endif

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
3 changes: 0 additions & 3 deletions examples/lock-app/nrfconnect/main/include/AppTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ class AppTask
static void UpdateLedStateEventHandler(AppEvent * aEvent);
static void FunctionTimerEventHandler(AppEvent * aEvent);
static void FunctionHandler(AppEvent * aEvent);
#ifdef CONFIG_NET_L2_OPENTHREAD
static void StartThreadHandler(AppEvent * aEvent);
#endif
static void LockActionEventHandler(AppEvent * aEvent);
static void StartBLEAdvertisementHandler(AppEvent * aEvent);

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
$<$<BOOL:${CONFIG_NET_L2_OPENTHREAD}>:${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/pump-app/nrfconnect/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,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 @@ -220,9 +215,6 @@ following states are possible:
**Button 2** &mdash; Pressing the button once changes the pump 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
Loading

0 comments on commit 238a18d

Please sign in to comment.