@@ -674,7 +674,11 @@ bool BLEManagerImpl::SendReadResponse(BLE_CONNECTION_OBJECT conId, BLE_READ_REQU
674
674
return false ;
675
675
}
676
676
677
- void BLEManagerImpl::NotifyChipConnectionClosed (BLE_CONNECTION_OBJECT conId) {}
677
+ void BLEManagerImpl::NotifyChipConnectionClosed (BLE_CONNECTION_OBJECT conId)
678
+ {
679
+ ChipLogDetail (Ble, " Received notification of closed CHIPoBLE connection (con %u)" , conId);
680
+ CloseConnection (conId);
681
+ }
678
682
679
683
CHIP_ERROR BLEManagerImpl::MapBLEError (int bleErr)
680
684
{
@@ -795,23 +799,19 @@ void BLEManagerImpl::DriveBLEState(void)
795
799
ExitNow ();
796
800
}
797
801
}
798
- // mFlags.Clear(Flags::kAdvertisingRefreshNeeded);
799
802
800
803
// Transition to the not Advertising state...
801
- if (mFlags .Has (Flags::kAdvertising ))
802
- {
803
- mFlags .Clear (Flags::kAdvertising );
804
- mFlags .Set (Flags::kFastAdvertisingEnabled , true );
804
+ mFlags .Clear (Flags::kAdvertising );
805
+ mFlags .Set (Flags::kFastAdvertisingEnabled , true );
805
806
806
- ChipLogProgress (DeviceLayer, " CHIPoBLE advertising stopped" );
807
+ ChipLogProgress (DeviceLayer, " CHIPoBLE advertising stopped" );
807
808
808
- // Post a CHIPoBLEAdvertisingChange(Stopped) event.
809
- {
810
- ChipDeviceEvent advChange;
811
- advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange ;
812
- advChange.CHIPoBLEAdvertisingChange .Result = kActivity_Stopped ;
813
- err = PlatformMgr ().PostEvent (&advChange);
814
- }
809
+ // Post a CHIPoBLEAdvertisingChange(Stopped) event.
810
+ {
811
+ ChipDeviceEvent advChange;
812
+ advChange.Type = DeviceEventType::kCHIPoBLEAdvertisingChange ;
813
+ advChange.CHIPoBLEAdvertisingChange .Result = kActivity_Stopped ;
814
+ err = PlatformMgr ().PostEvent (&advChange);
815
815
}
816
816
817
817
ExitNow ();
0 commit comments