Skip to content

Commit

Permalink
Updating LEDs only on connectivity change
Browse files Browse the repository at this point in the history
  • Loading branch information
adamb-q authored and tima-q committed Nov 8, 2022
1 parent a8d249a commit 23cedb3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/lighting-app/qpg/src/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -615,27 +615,29 @@ void AppTask::MatterEventHandler(const ChipDeviceEvent * event, intptr_t)
{
case DeviceEventType::kServiceProvisioningChange: {
sIsThreadProvisioned = event->ServiceProvisioningChange.IsServiceProvisioned;
UpdateLEDs();
break;
}

case DeviceEventType::kThreadConnectivityChange: {
sIsThreadEnabled = (event->ThreadConnectivityChange.Result == kConnectivity_Established);
UpdateLEDs();
break;
}

case DeviceEventType::kCHIPoBLEConnectionEstablished: {
sHaveBLEConnections = true;
UpdateLEDs();
break;
}

case DeviceEventType::kCHIPoBLEConnectionClosed: {
sHaveBLEConnections = false;
UpdateLEDs();
break;
}

default:
break;
}

UpdateLEDs();
}

0 comments on commit 23cedb3

Please sign in to comment.