@@ -672,7 +672,11 @@ bool BLEManagerImpl::SendWriteRequest(BLE_CONNECTION_OBJECT conId, const ChipBle
672
672
#endif
673
673
}
674
674
675
- void BLEManagerImpl::NotifyChipConnectionClosed (BLE_CONNECTION_OBJECT conId) {}
675
+ void BLEManagerImpl::NotifyChipConnectionClosed (BLE_CONNECTION_OBJECT conId)
676
+ {
677
+ ChipLogDetail (Ble, " Received notification of closed CHIPoBLE connection (con %u)" , conId);
678
+ CloseConnection (conId);
679
+ }
676
680
677
681
CHIP_ERROR BLEManagerImpl::MapBLEError (int bleErr)
678
682
{
@@ -810,23 +814,21 @@ void BLEManagerImpl::DriveBLEState(void)
810
814
ExitNow ();
811
815
}
812
816
}
813
- // mFlags.Clear(Flags::kAdvertisingRefreshNeeded);
814
817
815
818
// Transition to the not Advertising state...
816
- if (mFlags .Has (Flags::kAdvertising ))
817
- {
818
- mFlags .Clear (Flags::kAdvertising );
819
- mFlags .Set (Flags::kFastAdvertisingEnabled , true );
819
+ mFlags .Clear (Flags::kAdvertising );
820
+ mFlags .Set (Flags::kFastAdvertisingEnabled , true );
820
821
821
- ChipLogProgress (DeviceLayer, " CHIPoBLE advertising stopped" );
822
+ ChipLogProgress (DeviceLayer, " CHIPoBLE advertising stopped" );
822
823
823
- // Post a CHIPoBLEAdvertisingChange(Stopped) event.
824
- {
825
- ChipDeviceEvent advChange;
826
- advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange ;
827
- advChange.CHIPoBLEAdvertisingChange .Result = kActivity_Stopped ;
828
- err = PlatformMgr ().PostEvent (&advChange);
829
- }
824
+ CancelBleAdvTimeoutTimer ();
825
+
826
+ // Post a CHIPoBLEAdvertisingChange(Stopped) event.
827
+ {
828
+ ChipDeviceEvent advChange;
829
+ advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange ;
830
+ advChange.CHIPoBLEAdvertisingChange .Result = kActivity_Stopped ;
831
+ err = PlatformMgr ().PostEvent (&advChange);
830
832
}
831
833
832
834
ExitNow ();
0 commit comments