Skip to content

Commit 3bfa214

Browse files
committedFeb 27, 2025
enabling lcd and qrcode generation in lcd
1 parent 3cea44b commit 3bfa214

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
 

‎examples/closure-app/silabs/build_for_wifi_args.gni

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ import("${chip_root}/src/platform/silabs/wifi/args.gni")
1919

2020
sl_enable_test_event_trigger = false
2121
chip_enable_ota_requestor = false
22-
disable_lcd = true
22+
disable_lcd = false
2323
app_data_model = "${chip_root}/examples/closure-app/closure-common"

‎examples/closure-app/silabs/src/AppTask.cpp

+27
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@
2121
#include "AppConfig.h"
2222
#include "AppEvent.h"
2323
#include "LEDWidget.h"
24+
25+
#ifdef DISPLAY_ENABLED
26+
#include "lcd.h"
27+
#ifdef QR_CODE_ENABLED
28+
#include "qrcodegen.h"
29+
#endif // QR_CODE_ENABLED
30+
#endif // DISPLAY_ENABLED
31+
2432
#include <ClosureAppCommonMain.h>
2533
#include <app-common/zap-generated/cluster-enums.h>
2634
#include <app-common/zap-generated/cluster-objects.h>
@@ -100,6 +108,10 @@ CHIP_ERROR AppTask::Init()
100108
CHIP_ERROR err = CHIP_NO_ERROR;
101109
chip::DeviceLayer::Silabs::GetPlatform().SetButtonsCb(AppTask::ButtonEventHandler);
102110

111+
#ifdef DISPLAY_ENABLED
112+
GetLCD().Init((uint8_t *) "Closure-App");
113+
#endif
114+
103115
err = BaseApplication::Init();
104116
if (err != CHIP_NO_ERROR)
105117
{
@@ -109,6 +121,21 @@ CHIP_ERROR AppTask::Init()
109121

110122
ApplicationInit();
111123

124+
// Update the LCD with the Stored value. Show QR Code if not provisioned
125+
#ifdef DISPLAY_ENABLED
126+
GetLCD().WriteDemoUI(false);
127+
#ifdef QR_CODE_ENABLED
128+
#ifdef SL_WIFI
129+
if (!ConnectivityMgr().IsWiFiStationProvisioned())
130+
#else
131+
if (!ConnectivityMgr().IsThreadProvisioned())
132+
#endif /* !SL_WIFI */
133+
{
134+
GetLCD().ShowQRCode(true);
135+
}
136+
#endif // QR_CODE_ENABLED
137+
#endif
138+
112139
return err;
113140
}
114141

0 commit comments

Comments
 (0)