Skip to content

Commit

Permalink
Don't fallthrough on ScanMaxTimeSeconds or ConnectMaxTimeSeconds read…
Browse files Browse the repository at this point in the history
…s. a WirelessDriver is needed
  • Loading branch information
jmartinez-silabs committed Jan 6, 2025
1 parent 9c5b8e8 commit 7cedc68
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/app/clusters/network-commissioning/network-commissioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,18 +540,14 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu
});

case Attributes::ScanMaxTimeSeconds::Id:
if (mpWirelessDriver != nullptr)
{
return aEncoder.Encode(mpWirelessDriver->GetScanNetworkTimeoutSeconds());
}
return CHIP_NO_ERROR;
// We must have a WirelessDriver. If we don't something is misconfigured on the device
VerifyOrDie(mpWirelessDriver != nullptr);
return aEncoder.Encode(mpWirelessDriver->GetScanNetworkTimeoutSeconds());

case Attributes::ConnectMaxTimeSeconds::Id:
if (mpWirelessDriver != nullptr)
{
return aEncoder.Encode(mpWirelessDriver->GetConnectNetworkTimeoutSeconds());
}
return CHIP_NO_ERROR;
// We must have a WirelessDriver. If we don't something is misconfigured on the device
VerifyOrDie(mpWirelessDriver != nullptr);
return aEncoder.Encode(mpWirelessDriver->GetConnectNetworkTimeoutSeconds());

case Attributes::InterfaceEnabled::Id:
return aEncoder.Encode(mpBaseDriver->GetEnabled());
Expand Down Expand Up @@ -631,7 +627,7 @@ CHIP_ERROR Instance::Read(const ConcreteReadAttributePath & aPath, AttributeValu
}
break;
case Attributes::ThreadVersion::Id: {
// TODO https://github.com/project-chip/connectedhomeip/issues/31431ß
// TODO https://github.com/project-chip/connectedhomeip/issues/31431
uint16_t threadVersion = 0;
#if (CHIP_DEVICE_CONFIG_ENABLE_THREAD)
// This is a case of shared zap config where mandatory thread attributes are enabled for a wifi platform (e.g
Expand Down

0 comments on commit 7cedc68

Please sign in to comment.