Skip to content

Commit

Permalink
Access BleLayer mState through function (project-chip#31660)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhmorris1 committed Feb 14, 2024
1 parent 209c9a5 commit eeaf38b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void Instance::SendNonConcurrentConnectNetworkResponse()
}

#if CONFIG_NETWORK_LAYER_BLE
DeviceLayer::ConnectivityMgr().GetBleLayer()->mState = Ble::BleLayer::kState_Disconnecting;
DeviceLayer::ConnectivityMgr().GetBleLayer()->IndicateBleClosing();
#endif // CONFIG_NETWORK_LAYER_BLE
ChipLogProgress(NetworkProvisioning, "Non-concurrent mode. Send ConnectNetworkResponse(Success)");
Commands::ConnectNetworkResponse::Type response;
Expand Down
5 changes: 5 additions & 0 deletions src/ble/BleLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ CHIP_ERROR BleLayer::Init(BlePlatformDelegate * platformDelegate, BleApplication
return Init(platformDelegate, nullptr, appDelegate, systemLayer);
}

void BleLayer::IndicateBleClosing()
{
mState = kState_Disconnecting;
}

void BleLayer::Shutdown()
{
mState = kState_NotInitialized;
Expand Down
1 change: 1 addition & 0 deletions src/ble/BleLayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ class DLL_EXPORT BleLayer
chip::System::Layer * systemLayer);
CHIP_ERROR Init(BlePlatformDelegate * platformDelegate, BleConnectionDelegate * connDelegate,
BleApplicationDelegate * appDelegate, chip::System::Layer * systemLayer);
void IndicateBleClosing();
void Shutdown();

CHIP_ERROR CancelBleIncompleteConnection();
Expand Down

0 comments on commit eeaf38b

Please sign in to comment.