Skip to content

Commit

Permalink
[ota] fix ota init bug (#25996)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankore authored and pull[bot] committed Oct 11, 2023
1 parent 8bf56a0 commit 81023fa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion examples/all-clusters-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
chip::app::DnssdServer::Instance().StartServer();
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Init OTA requestor only when we have gotten IPv6 address
if (OTAInitializer::Instance().CheckInit())
if (!OTAInitializer::Instance().CheckInit())
{
ChipLogProgress(DeviceLayer, "Initializing OTA");
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/light-switch-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
chip::app::DnssdServer::Instance().StartServer();
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Init OTA requestor only when we have gotten IPv6 address
if (OTAInitializer::Instance().CheckInit())
if (!OTAInitializer::Instance().CheckInit())
{
ChipLogProgress(DeviceLayer, "Initializing OTA");
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/lighting-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
chip::app::DnssdServer::Instance().StartServer();
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Init OTA requestor only when we have gotten IPv6 address
if (OTAInitializer::Instance().CheckInit())
if (!OTAInitializer::Instance().CheckInit())
{
ChipLogProgress(DeviceLayer, "Initializing OTA");
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
}
Expand Down
3 changes: 2 additions & 1 deletion examples/ota-requestor-app/ameba/main/DeviceCallbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event
chip::app::DnssdServer::Instance().StartServer();
#if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR
// Init OTA requestor only when we have gotten IPv6 address
if (OTAInitializer::Instance().CheckInit())
if (!OTAInitializer::Instance().CheckInit())
{
ChipLogProgress(DeviceLayer, "Initializing OTA");
chip::DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Seconds32(kInitOTARequestorDelaySec),
InitOTARequestorHandler, nullptr);
}
Expand Down

0 comments on commit 81023fa

Please sign in to comment.