From 6e1375d553237b7c8ad078e84ffe3625c9570ca4 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 23 Oct 2023 08:12:39 +0200 Subject: HCIHandler::receiveCommandComplete(..): Preserve returned CMD_STATUS error status --- src/direct_bt/HCIHandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/direct_bt') diff --git a/src/direct_bt/HCIHandler.cpp b/src/direct_bt/HCIHandler.cpp index f79e86d9..f5d74be0 100644 --- a/src/direct_bt/HCIHandler.cpp +++ b/src/direct_bt/HCIHandler.cpp @@ -1994,6 +1994,10 @@ std::unique_ptr HCIHandler::receiveCommandComplete(HCICommand &req, } return nullptr; // timeout } else if( nullptr == ev_cc ) { + if( ev->isEvent(HCIEventType::CMD_STATUS) ) { + HCICommandStatusEvent * ev_cs = static_cast(ev.get()); + *status = ev_cs->getStatus(); + } if( !quiet || jau::environment::get().verbose ) { WARN_PRINT("%s -> %s: Status 0x%2.2X (%s), errno %d %s: res %s, req %s - %s", to_string(req.getOpcode()).c_str(), to_string(evc).c_str(), -- cgit v1.2.3