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

[Silabs] Adds feature to update network name in LCD status screen for WiFi combinations #34410

Merged
merged 4 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge redundent event handler
rosahay-silabs committed Jul 26, 2024
commit fcd04f82041b121acabdbb2dd191cf1392f874f2
37 changes: 15 additions & 22 deletions examples/platform/silabs/BaseApplication.cpp
Original file line number Diff line number Diff line change
@@ -166,22 +166,6 @@ bool BaseApplication::sIsFactoryResetTriggered = false;
LEDWidget * BaseApplication::sAppActionLed = nullptr;
BaseApplicationDelegate BaseApplication::sAppDelegate = BaseApplicationDelegate();

#ifdef DIC_ENABLE
namespace {
void AppSpecificConnectivityEventCallback(const ChipDeviceEvent * event, intptr_t arg)
{
SILABS_LOG("AppSpecificConnectivityEventCallback: call back for IPV4");
if ((event->Type == DeviceEventType::kInternetConnectivityChange) &&
(event->InternetConnectivityChange.IPv4 == kConnectivity_Established))
{
SILABS_LOG("Got IPv4 Address! Starting DIC module\n");
if (DIC_OK != dic_init(dic::control::subscribeCB))
SILABS_LOG("Failed to initialize DIC module\n");
}
}
} // namespace
#endif // DIC_ENABLE

void BaseApplicationDelegate::OnCommissioningSessionStarted()
{
isComissioningStarted = true;
@@ -203,7 +187,7 @@ void BaseApplicationDelegate::OnCommissioningWindowClosed()
ChipLogError(DeviceLayer, "Failed to enable the TA Deep Sleep");
}
}
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917qq
#endif // CHIP_CONFIG_ENABLE_ICD_SERVER && SLI_SI917
}

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

#ifdef DIC_ENABLE
chip::DeviceLayer::PlatformMgr().AddEventHandler(AppSpecificConnectivityEventCallback, reinterpret_cast<intptr_t>(nullptr));
#endif // DIC_ENABLE

ConfigurationMgr().LogDeviceConfig();

OutputQrCode(true /*refreshLCD at init*/);
@@ -830,10 +810,23 @@ void BaseApplication::DoProvisioningReset()

void BaseApplication::OnPlatformEvent(const ChipDeviceEvent * event, intptr_t)
{
if (event->Type == DeviceEventType::kServiceProvisioningChange)
switch (event->Type)
{
case DeviceEventType::kServiceProvisioningChange:
// Note: This is only called on Attach, we need to add a method to detect Thread Network Detach
BaseApplication::sIsProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned;
break;
case DeviceEventType::kInternetConnectivityChange:
#ifdef DIC_ENABLE
VerifyOrReturn(event->InternetConnectivityChange.IPv4 == kConnectivity_Established);
if (DIC_OK != dic_init(dic::control::subscribeCB))
{
SILABS_LOG("Failed to initialize DIC module\n");
}
#endif // DIC_ENABLE
break;
default:
break;
}
}