mirror of
https://github.com/espressif/esp-matter.git
synced 2026-04-27 19:13:13 +00:00
Merge branch 'example/light_wifi_prov_ble_refresh' into 'main'
example: Fix ble advertisement refresh after ble disconnection for light_wifi_prov example See merge request app-frameworks/esp-matter!926
This commit is contained in:
@@ -186,6 +186,8 @@ public:
|
||||
mSecondaryBleSmSc = bleSmSc;
|
||||
}
|
||||
|
||||
void RefreshAdv(void);
|
||||
|
||||
private:
|
||||
chip::Optional<chip::ByteSpan> mScanResponse;
|
||||
|
||||
|
||||
@@ -1365,6 +1365,14 @@ CHIP_ERROR BLEManagerImpl::HandleGAPConnect(struct ble_gap_event * gapEvent)
|
||||
#endif
|
||||
}
|
||||
|
||||
void BLEManagerImpl::RefreshAdv(void)
|
||||
{
|
||||
mFlags.Set(Flags::kAdvertisingRefreshNeeded);
|
||||
mFlags.Clear(Flags::kAdvertisingConfigured);
|
||||
|
||||
PlatformMgr().ScheduleWork(DriveBLEState, 0);
|
||||
}
|
||||
|
||||
CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(struct ble_gap_event * gapEvent)
|
||||
{
|
||||
ChipLogProgress(DeviceLayer, "BLE GAP connection terminated (con %u reason 0x%02x)", gapEvent->disconnect.conn.conn_handle,
|
||||
|
||||
@@ -402,6 +402,7 @@ static int protocomm_matter_ble_gap_event(struct ble_gap_event *event, void *arg
|
||||
break;
|
||||
case BLE_GAP_EVENT_DISCONNECT:
|
||||
transport_matter_ble_disconnect(event, arg);
|
||||
chip::DeviceLayer::Internal::BLEMgrImpl().RefreshAdv();
|
||||
break;
|
||||
case BLE_GAP_EVENT_MTU:
|
||||
transport_matter_ble_set_mtu(event, arg);
|
||||
|
||||
Reference in New Issue
Block a user