Skip to content

Commit

Permalink
Remove demo UDP advertisement from Thread samples
Browse files Browse the repository at this point in the history
This pre-SRP advertisement is not based on anything in the
specification. It dates back to 0561e68 ("[nrf5-demo] Add simple
service discovery code for nrf5 example app (project-chip#2211)") to allow discovery
prior to all of the dependencies of SRP being in place and since then
been copied to various other samples.

We have SRP now, time to remove it.
  • Loading branch information
mspang committed Jul 14, 2021
1 parent 0d085d7 commit 6c3f24f
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 351 deletions.
1 change: 0 additions & 1 deletion examples/lighting-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ efr32_executable("lighting_app") {

sources = [
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/Service.cpp",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.c",
"src/AppTask.cpp",
Expand Down
12 changes: 0 additions & 12 deletions examples/lighting-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "AppEvent.h"
#include "ButtonHandler.h"
#include "LEDWidget.h"
#include "Service.h"
#include "lcd.h"
#include "qrcodegen.h"
#include <app/common/gen/attribute-id.h>
Expand Down Expand Up @@ -160,7 +159,6 @@ void AppTask::AppTaskMain(void * pvParameter)
{
int err;
AppEvent event;
uint64_t mLastChangeTimeUS = 0;

err = sAppTask.Init();
if (err != CHIP_NO_ERROR)
Expand All @@ -170,7 +168,6 @@ void AppTask::AppTaskMain(void * pvParameter)
}

EFR32_LOG("App Task started");
SetDeviceName("EFR32LightingDemo._matter._udp.local.");

while (true)
{
Expand Down Expand Up @@ -231,15 +228,6 @@ void AppTask::AppTaskMain(void * pvParameter)

sStatusLED.Animate();
sLightLED.Animate();

uint64_t nowUS = chip::System::Clock::GetMonotonicMicroseconds();
uint64_t nextChangeTimeUS = mLastChangeTimeUS + 5 * 1000 * 1000UL;

if (nowUS > nextChangeTimeUS)
{
PublishService();
mLastChangeTimeUS = nowUS;
}
}
}

Expand Down
13 changes: 0 additions & 13 deletions examples/lighting-app/mbed/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
#define BUTTON_PUSH_EVENT 1
#define BUTTON_RELEASE_EVENT 0

constexpr uint32_t kPublishServicePeriodUs = 5000000;

static LEDWidget sStatusLED(MBED_CONF_APP_SYSTEM_STATE_LED);

static mbed::InterruptIn sLightingButton(LIGHTING_BUTTON);
Expand Down Expand Up @@ -125,7 +123,6 @@ int AppTask::Init()
int AppTask::StartApp()
{
int ret = Init();
uint64_t mLastPublishServiceTimeUS = 0;

if (ret)
{
Expand Down Expand Up @@ -191,16 +188,6 @@ int AppTask::StartApp()
}

sStatusLED.Animate();

uint64_t nowUS = chip::System::Clock::GetMonotonicMicroseconds();
uint64_t nextChangeTimeUS = mLastPublishServiceTimeUS + kPublishServicePeriodUs;

if (nowUS > nextChangeTimeUS)
{
// TODO:
// PublishService();
mLastPublishServiceTimeUS = nowUS;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/lighting-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ target_sources(app PRIVATE
${LIGHTING_COMMON}/gen/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
${NRFCONNECT_COMMON}/app/Service.cpp
${CHIP_ROOT}/src/app/util/DataModelHandler.cpp
${CHIP_ROOT}/src/app/reporting/reporting-default-configuration.cpp
${CHIP_ROOT}/src/app/reporting/reporting.cpp
Expand Down
12 changes: 0 additions & 12 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 "LightingManager.h"
#include "Service.h"
#include "ThreadUtil.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -65,7 +64,6 @@ constexpr int kAppEventQueueSize = 10;
constexpr int kExampleVendorID = 0xabcd;
constexpr uint8_t kButtonPushEvent = 1;
constexpr uint8_t kButtonReleaseEvent = 0;
constexpr uint32_t kPublishServicePeriodUs = 5000000;

K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), kAppEventQueueSize, alignof(AppEvent));
k_timer sFunctionTimer;
Expand Down Expand Up @@ -143,7 +141,6 @@ int AppTask::Init()
int AppTask::StartApp()
{
int ret = Init();
uint64_t mLastPublishServiceTimeUS = 0;

if (ret)
{
Expand Down Expand Up @@ -213,15 +210,6 @@ int AppTask::StartApp()
sStatusLED.Animate();
sUnusedLED.Animate();
sUnusedLED_1.Animate();

uint64_t nowUS = chip::System::Clock::GetMonotonicMicroseconds();
uint64_t nextChangeTimeUS = mLastPublishServiceTimeUS + kPublishServicePeriodUs;

if (nowUS > nextChangeTimeUS)
{
PublishService();
mLastPublishServiceTimeUS = nowUS;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/efr32/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ efr32_executable("lock_app") {

sources = [
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/Service.cpp",
"${examples_plat_dir}/init_efrPlatform.cpp",
"${examples_plat_dir}/uart.c",
"src/AppTask.cpp",
Expand Down
12 changes: 0 additions & 12 deletions examples/lock-app/efr32/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include "AppEvent.h"
#include "ButtonHandler.h"
#include "LEDWidget.h"
#include "Service.h"
#include "lcd.h"
#include "qrcodegen.h"
#include <app/common/gen/attribute-id.h>
Expand Down Expand Up @@ -155,7 +154,6 @@ void AppTask::AppTaskMain(void * pvParameter)
{
int err;
AppEvent event;
uint64_t mLastChangeTimeUS = 0;

err = sAppTask.Init();
if (err != CHIP_NO_ERROR)
Expand All @@ -165,7 +163,6 @@ void AppTask::AppTaskMain(void * pvParameter)
}

EFR32_LOG("App Task started");
SetDeviceName("EFR32LockDemo._matter._udp.local.");

while (true)
{
Expand Down Expand Up @@ -226,15 +223,6 @@ void AppTask::AppTaskMain(void * pvParameter)

sStatusLED.Animate();
sLockLED.Animate();

uint64_t nowUS = chip::System::Clock::GetMonotonicMicroseconds();
uint64_t nextChangeTimeUS = mLastChangeTimeUS + 5 * 1000 * 1000UL;

if (nowUS > nextChangeTimeUS)
{
PublishService();
mLastChangeTimeUS = nowUS;
}
}
}

Expand Down
1 change: 0 additions & 1 deletion examples/lock-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ target_sources(app PRIVATE
${LOCK_COMMON}/gen/IMClusterCommandHandler.cpp
${NRFCONNECT_COMMON}/util/LEDWidget.cpp
${NRFCONNECT_COMMON}/util/ThreadUtil.cpp
${NRFCONNECT_COMMON}/app/Service.cpp
${CHIP_ROOT}/src/app/util/DataModelHandler.cpp
${CHIP_ROOT}/src/app/reporting/reporting-default-configuration.cpp
${CHIP_ROOT}/src/app/reporting/reporting.cpp
Expand Down
13 changes: 0 additions & 13 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 "Service.h"
#include "ThreadUtil.h"
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>
Expand Down Expand Up @@ -59,8 +58,6 @@
LOG_MODULE_DECLARE(app);
K_MSGQ_DEFINE(sAppEventQueue, sizeof(AppEvent), APP_EVENT_QUEUE_SIZE, alignof(AppEvent));

constexpr uint32_t kPublishServicePeriodUs = 5000000;

static LEDWidget sStatusLED;
static LEDWidget sLockLED;
static LEDWidget sUnusedLED;
Expand Down Expand Up @@ -134,7 +131,6 @@ int AppTask::Init()
int AppTask::StartApp()
{
int ret = Init();
uint64_t mLastPublishServiceTimeUS = 0;

if (ret)
{
Expand Down Expand Up @@ -205,15 +201,6 @@ int AppTask::StartApp()
sLockLED.Animate();
sUnusedLED.Animate();
sUnusedLED_1.Animate();

uint64_t nowUS = chip::System::Clock::GetMonotonicMicroseconds();
uint64_t nextChangeTimeUS = mLastPublishServiceTimeUS + kPublishServicePeriodUs;

if (nowUS > nextChangeTimeUS)
{
PublishService();
mLastPublishServiceTimeUS = nowUS;
}
}
}

Expand Down
108 changes: 0 additions & 108 deletions examples/platform/efr32/Service.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions examples/platform/efr32/Service.h

This file was deleted.

Loading

0 comments on commit 6c3f24f

Please sign in to comment.