Skip to content

Commit 031d33e

Browse files
committed
Merge branch 'master' into granbery/atomic_write
2 parents ac3fc9f + d9bcdd3 commit 031d33e

23 files changed

+1018
-647
lines changed

examples/platform/silabs/BaseApplication.cpp

+42-25
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,6 @@ bool BaseApplication::sIsFactoryResetTriggered = false;
166166
LEDWidget * BaseApplication::sAppActionLed = nullptr;
167167
BaseApplicationDelegate BaseApplication::sAppDelegate = BaseApplicationDelegate();
168168

169-
#ifdef DIC_ENABLE
170-
namespace {
171-
void AppSpecificConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg)
172-
{
173-
SILABS_LOG("AppSpecificConnectivityEventCallback: call back for IPV4");
174-
if ((event->Type == DeviceEventType::kInternetConnectivityChange) &&
175-
(event->InternetConnectivityChange.IPv4 == kConnectivity_Established))
176-
{
177-
SILABS_LOG("Got IPv4 Address! Starting DIC module\n");
178-
if (DIC_OK != dic_init(dic::control::subscribeCB))
179-
SILABS_LOG("Failed to initialize DIC module\n");
180-
}
181-
}
182-
} // namespace
183-
#endif // DIC_ENABLE
184-
185169
void BaseApplicationDelegate::OnCommissioningSessionStarted()
186170
{
187171
isComissioningStarted = true;
@@ -203,7 +187,7 @@ void BaseApplicationDelegate::OnCommissioningWindowClosed()
203187
ChipLogError(DeviceLayer, "Failed to enable the TA Deep Sleep");
204188
}
205189
}
206-
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917qq
190+
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917
207191
}
208192

209193
void BaseApplicationDelegate::OnFabricCommitted(const FabricTable & fabricTable, FabricIndex fabricIndex)
@@ -297,10 +281,6 @@ CHIP_ERROR BaseApplication::Init()
297281
SILABS_LOG("Current Software Version String: %s", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION_STRING);
298282
SILABS_LOG("Current Software Version: %d", CHIP_DEVICE_CONFIG_DEVICE_SOFTWARE_VERSION);
299283

300-
#ifdef DIC_ENABLE
301-
chip::DeviceLayer::PlatformMgr().AddEventHandler(AppSpecificConnectivityEventCallback, reinterpret_cast<intptr_t>(nullptr));
302-
#endif // DIC_ENABLE
303-
304284
ConfigurationMgr().LogDeviceConfig();
305285

306286
OutputQrCode(true /*refreshLCD at init*/);
@@ -730,14 +710,25 @@ SilabsLCD & BaseApplication::GetLCD(void)
730710
return slLCD;
731711
}
732712

733-
void BaseApplication::UpdateLCDStatusScreen(void)
713+
void BaseApplication::UpdateLCDStatusScreen(bool withChipStackLock)
734714
{
735715
SilabsLCD::DisplayStatus_t status;
736716
bool enabled, attached;
737-
chip::DeviceLayer::PlatformMgr().LockChipStack();
717+
if (withChipStackLock)
718+
{
719+
chip::DeviceLayer::PlatformMgr().LockChipStack();
720+
}
738721
#ifdef SL_WIFI
739722
enabled = ConnectivityMgr().IsWiFiStationEnabled();
740723
attached = ConnectivityMgr().IsWiFiStationConnected();
724+
chip::DeviceLayer::NetworkCommissioning::Network network;
725+
memset(reinterpret_cast<void *>(&network), 0, sizeof(network));
726+
chip::DeviceLayer::NetworkCommissioning::GetConnectedNetwork(network);
727+
if (network.networkIDLen)
728+
{
729+
chip::Platform::CopyString(status.networkName, sizeof(status.networkName),
730+
reinterpret_cast<const char *>(network.networkID));
731+
}
741732
#endif /* SL_WIFI */
742733
#if CHIP_ENABLE_OPENTHREAD
743734
enabled = ConnectivityMgr().IsThreadEnabled();
@@ -751,7 +742,10 @@ void BaseApplication::UpdateLCDStatusScreen(void)
751742
? SilabsLCD::ICDMode_e::SIT
752743
: SilabsLCD::ICDMode_e::LIT;
753744
#endif
754-
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
745+
if (withChipStackLock)
746+
{
747+
chip::DeviceLayer::PlatformMgr().UnlockChipStack();
748+
}
755749
slLCD.SetStatus(status);
756750
}
757751
#endif
@@ -822,10 +816,33 @@ void BaseApplication::DoProvisioningReset()
822816

823817
void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t)
824818
{
825-
if (event->Type == DeviceEventType::kServiceProvisioningChange)
819+
switch (event->Type)
826820
{
821+
case DeviceEventType::kServiceProvisioningChange:
827822
// Note: This is only called on Attach, we need to add a method to detect Thread Network Detach
828823
BaseApplication::sIsProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned;
824+
break;
825+
case DeviceEventType::kInternetConnectivityChange:
826+
#ifdef DIC_ENABLE
827+
VerifyOrReturn(event->InternetConnectivityChange.IPv4 == kConnectivity_Established);
828+
if (DIC_OK != dic_init(dic::control::subscribeCB))
829+
{
830+
SILABS_LOG("Failed to initialize DIC module\n");
831+
}
832+
#endif // DIC_ENABLE
833+
break;
834+
case DeviceEventType::kWiFiConnectivityChange:
835+
#ifdef DISPLAY_ENABLED
836+
SilabsLCD::Screen_e screen;
837+
AppTask::GetLCD().GetScreen(screen);
838+
// Update the LCD screen with SSID and connected state
839+
VerifyOrReturn(screen == SilabsLCD::Screen_e::StatusScreen);
840+
BaseApplication::UpdateLCDStatusScreen(false);
841+
AppTask::GetLCD().SetScreen(screen);
842+
#endif // DISPLAY_ENABLED
843+
break;
844+
default:
845+
break;
829846
}
830847
}
831848

examples/platform/silabs/BaseApplication.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class BaseApplication
132132
*/
133133
static SilabsLCD & GetLCD(void);
134134

135-
static void UpdateLCDStatusScreen(void);
135+
static void UpdateLCDStatusScreen(bool withChipStackLock = true);
136136
#endif
137137

138138
/**

examples/platform/silabs/display/lcd.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ void SilabsLCD::SetCustomUI(customUICB cb)
203203
customUI = cb;
204204
}
205205

206+
void SilabsLCD::GetScreen(Screen_e & screen)
207+
{
208+
screen = static_cast<Screen_e>(mCurrentScreen);
209+
}
210+
206211
void SilabsLCD::SetScreen(Screen_e screen)
207212
{
208213
if (screen >= InvalidScreen)
@@ -226,6 +231,7 @@ void SilabsLCD::SetScreen(Screen_e screen)
226231
default:
227232
break;
228233
}
234+
mCurrentScreen = screen;
229235
}
230236

231237
void SilabsLCD::CycleScreens(void)

examples/platform/silabs/display/lcd.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
#endif // QR_CODE_ENABLED
2727

2828
#include "demo-ui.h"
29-
30-
#define MAX_STR_LEN 48
29+
#include <platform/internal/DeviceNetworkInfo.h>
3130

3231
class SilabsLCD
3332
{
@@ -52,11 +51,11 @@ class SilabsLCD
5251

5352
typedef struct dStatus
5453
{
55-
uint8_t nbFabric = 0;
56-
bool connected = false;
57-
char networkName[50] = { "TODO" };
58-
bool advertising = false;
59-
ICDMode_e icdMode = NotICD;
54+
uint8_t nbFabric = 0;
55+
bool connected = false;
56+
char networkName[chip::DeviceLayer::Internal::kMaxWiFiSSIDLength] = { 0 };
57+
bool advertising = false;
58+
ICDMode_e icdMode = NotICD;
6059
} DisplayStatus_t;
6160

6261
typedef void (*customUICB)(GLIB_Context_t * context);
@@ -68,6 +67,7 @@ class SilabsLCD
6867
void WriteDemoUI(bool state);
6968
void SetCustomUI(customUICB cb);
7069

70+
void GetScreen(Screen_e & screen);
7171
void SetScreen(Screen_e screen);
7272
void CycleScreens(void);
7373
void SetStatus(DisplayStatus_t & status);

scripts/py_matter_idl/matter_idl/backwards_compatibility.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def attribute_name(attribute: Attribute) -> str:
5454

5555
def not_stable(maturity: ApiMaturity):
5656
"""Determine if the given api maturity allows binary/api changes or not."""
57-
# TODO: internal and deprecated not currently widely used,
58-
# so we enforce stability on them for now.
59-
return maturity == ApiMaturity.PROVISIONAL
57+
# NOTE: deprecated are not to be used, so we expect no changes. They were
58+
# probably "stable" at some point
59+
return (maturity == ApiMaturity.PROVISIONAL) or (maturity == ApiMaturity.INTERNAL)
6060

6161

6262
class CompatibilityChecker:

scripts/py_matter_idl/matter_idl/test_backwards_compatibility.py

+7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ def test_provisional_cluster(self):
188188
"provisional server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
189189
Compatibility.ALL_OK)
190190

191+
def test_internal_cluster(self):
192+
self.ValidateUpdate(
193+
"Internal cluster changes are ok.",
194+
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 2; } info event A = 1 { int8u x = 1;} }",
195+
"internal server cluster A = 16 { enum X : ENUM8 { A = 1; B = 3; } info event A = 2 { int16u x = 1;} }",
196+
Compatibility.ALL_OK)
197+
191198
def test_clusters_enum_code(self):
192199
self.ValidateUpdate(
193200
"Adding an enum is ok. Also validates code formatting",

src/app/cluster-building-blocks/QuieterReporting.h

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ class QuieterReportingAttribute
112112
{
113113
public:
114114
explicit QuieterReportingAttribute(const Nullable<T> & initialValue) : mValue(initialValue), mLastDirtyValue(initialValue) {}
115+
// constructor that works with arrays of QuieterReportingAttribute
116+
explicit QuieterReportingAttribute() : mValue(DataModel::NullNullable), mLastDirtyValue(DataModel::NullNullable) {}
115117

116118
struct SufficientChangePredicateCandidate
117119
{

0 commit comments

Comments
 (0)