Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CSA-CP] BaseApplication common LCD Init #356

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

#define APP_TASK_NAME "AQS"

#define BLE_DEV_NAME "SiLabs-Air-Quality-Sensor"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// APP Logo, boolean only. must be 64x64
1 change: 0 additions & 1 deletion examples/air-quality-sensor-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -73,7 +73,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Air-Quality-Sensor");
GetLCD().SetCustomUI(AirQualitySensorUI::DrawUI);
#endif

2 changes: 1 addition & 1 deletion examples/chef/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Chef"

// Time it takes in ms for the simulated actuator to move from one
// state to another.
6 changes: 5 additions & 1 deletion examples/energy-management-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -23,6 +23,10 @@

// ---- EVSE Example App Config ----

#if SL_MATTER_CONFIG_ENABLE_EXAMPLE_EVSE_DEVICE
#define APP_TASK_NAME "EVSE"
#else
#define APP_TASK_NAME "W-Heater"
#endif

#define BLE_DEV_NAME "SiLabs-EVSE"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we standardize this, it could be an idea to move this to a common configuration

#ifndef BLE_DEV_NAME
#error APP_TASK_NAME missing app task name
#define BLE_DEV_NAME "SL-" APP_TASK_NAME
#endif

9 changes: 0 additions & 9 deletions examples/energy-management-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -167,15 +167,6 @@ CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
#if SL_MATTER_CONFIG_ENABLE_EXAMPLE_EVSE_DEVICE
GetLCD().Init((uint8_t *) "energy-management-App (EVSE)");
#elif SL_CONFIG_ENABLE_EXAMPLE_WATER_HEATER_DEVICE
GetLCD().Init((uint8_t *) "energy-management-App (WaterHeater)");
#endif
#endif

ApplicationInit();

#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED
4 changes: 2 additions & 2 deletions examples/light-switch-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Light-Sw"

#define BLE_DEV_NAME "SiLabs-Light-Switch"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
4 changes: 0 additions & 4 deletions examples/light-switch-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -73,10 +73,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(LightSwitchMgr::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Light Switch");
#endif

err = LightSwitchMgr::GetInstance().Init(kLightSwitchEndpoint, kGenericSwitchEndpoint);
if (err != CHIP_NO_ERROR)
{
4 changes: 2 additions & 2 deletions examples/lighting-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Light"

#define BLE_DEV_NAME "SiLabs-Light"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
3 changes: 0 additions & 3 deletions examples/lighting-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -71,9 +71,6 @@ CHIP_ERROR AppTask::AppInit()
char rebootLightOnKey[] = "Reboot->LightOn";
CharSpan rebootLighOnSpan(rebootLightOnKey);
SILABS_TRACE_REGISTER(rebootLighOnSpan);
#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Lighting-App");
#endif

err = LightMgr().Init();
if (err != CHIP_NO_ERROR)
2 changes: 1 addition & 1 deletion examples/lit-icd-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@

#define APP_TASK_NAME "Lit"

#define BLE_DEV_NAME "SiLabs-LIT-ICD"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// APP Logo, boolean only. must be 64x64
#define ON_DEMO_BITMAP \
5 changes: 0 additions & 5 deletions examples/lit-icd-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -72,11 +72,6 @@ CHIP_ERROR AppTask::AppInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "LIT ICD");
#endif

return err;
}

2 changes: 1 addition & 1 deletion examples/lock-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@

#define APP_TASK_NAME "Lock"

#define BLE_DEV_NAME "SiLabs-Door-Lock"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
4 changes: 0 additions & 4 deletions examples/lock-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -122,10 +122,6 @@ CHIP_ERROR AppTask::AppInit()

chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Lock-App", true);
#endif

#if defined(ENABLE_CHIP_SHELL)
err = RegisterLockEvents();
if (err != CHIP_NO_ERROR)
4 changes: 4 additions & 0 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
@@ -326,6 +326,10 @@ CHIP_ERROR BaseApplication::BaseInit()
{
CHIP_ERROR err = CHIP_NO_ERROR;

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) APP_TASK_NAME);
#endif

#ifdef SL_WIFI
/*
* Wait for the WiFi to be initialized
4 changes: 2 additions & 2 deletions examples/pump-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Pump"

#define BLE_DEV_NAME "SiLabs-Pump"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

#define ON_DEMO_BITMAP \
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \
4 changes: 0 additions & 4 deletions examples/pump-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -76,10 +76,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Pump-App");
#endif

err = PumpMgr().Init();
if (err != CHIP_NO_ERROR)
{
2 changes: 1 addition & 1 deletion examples/refrigerator-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@

#define APP_TASK_NAME "Refr"

#define BLE_DEV_NAME "SiLabs-Refrigerator"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
4 changes: 0 additions & 4 deletions examples/refrigerator-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -80,10 +80,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Refrigrator-App");
#endif

err = RefrigeratorMgr().Init();
if (err != CHIP_NO_ERROR)
{
4 changes: 2 additions & 2 deletions examples/smoke-co-alarm-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@

// ---- Smoke CO Alarm Example App Config ----

#define APP_TASK_NAME "Alm"
#define APP_TASK_NAME "Smoke"

#define BLE_DEV_NAME "SiLabs-Alarm"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
4 changes: 0 additions & 4 deletions examples/smoke-co-alarm-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -59,10 +59,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Smoke-CO-Alarm-App");
#endif

err = AlarmMgr().Init();
if (err != CHIP_NO_ERROR)
{
4 changes: 2 additions & 2 deletions examples/thermostat/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@

// ---- Lighting Example App Config ----

#define APP_TASK_NAME "Lit"
#define APP_TASK_NAME "Therm"

#define BLE_DEV_NAME "SiLabs-Thermostat"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

// Time it takes in ms for the simulated actuator to move from one
// state to another.
1 change: 0 additions & 1 deletion examples/thermostat/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ CHIP_ERROR AppTask::AppInit()
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Thermostat-App");
GetLCD().SetCustomUI(ThermostatUI::DrawUI);
#endif

4 changes: 2 additions & 2 deletions examples/window-app/silabs/include/AppConfig.h
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@
#include "silabs_utils.h"

// ---- Window Example App Config ----
#define APP_TASK_NAME "APP"
#define APP_TASK_NAME "Window"
#define APP_EVENT_QUEUE_SIZE 20
#define BLE_DEV_NAME "SiLabs-Window"
#define BLE_DEV_NAME "SL-" APP_TASK_NAME

#define LCD_SIZE 128
#define LCD_MARGIN_SIZE 1
4 changes: 0 additions & 4 deletions examples/window-app/silabs/src/AppTask.cpp
Original file line number Diff line number Diff line change
@@ -50,10 +50,6 @@ CHIP_ERROR AppTask::AppInit()
CHIP_ERROR err = CHIP_NO_ERROR;
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(WindowManager::ButtonEventHandler);

#ifdef DISPLAY_ENABLED
GetLCD().Init((uint8_t *) "Window-App");
#endif

err = WindowManager::sWindow.Init();

if (err != CHIP_NO_ERROR)
Loading