diff options
author | Sven Gothel <[email protected]> | 2020-09-23 02:33:52 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-09-23 02:33:52 +0200 |
commit | fa1979e542f1de575769d8faa19d702e81ff1b5b (patch) | |
tree | e1d8cce6924ea9ab14b95457f6a2db15987433bd | |
parent | dc8d8cfa902c0629752d0a34e051dd03cecb523a (diff) |
DBTDevice::disconnect: Send MgmtEvtDeviceDisconnected to adapter if HCI is already dead (powered-off)
-rw-r--r-- | src/direct_bt/DBTDevice.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/direct_bt/DBTDevice.cpp b/src/direct_bt/DBTDevice.cpp index 8ce50ed7..596908c8 100644 --- a/src/direct_bt/DBTDevice.cpp +++ b/src/direct_bt/DBTDevice.cpp @@ -459,6 +459,12 @@ HCIStatusCode DBTDevice::disconnect(const bool fromDisconnectCB, const bool ioEr if( nullptr == hci ) { DBG_PRINT("DBTDevice::disconnect: Skip disconnect: HCI not available: %s", toString().c_str()); res = HCIStatusCode::INTERNAL_FAILURE; + + adapter.mgmtEvDeviceDisconnectedHCI( + std::shared_ptr<MgmtEvent>( + new MgmtEvtDeviceDisconnected(adapter.dev_id, address, addressType, reason, hciConnHandle.load()) + ) ); + goto exit; } |