aboutsummaryrefslogtreecommitdiffstats
path: root/src/direct_bt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-23 08:13:42 +0200
committerSven Gothel <[email protected]>2023-10-23 08:13:42 +0200
commit5363ea9c9c540d3e432a2813f1356b6249e9bf47 (patch)
tree6f5d38b07f4cbb6b33fbda59de58b4d510ac87a3 /src/direct_bt
parent6e1375d553237b7c8ad078e84ffe3625c9570ca4 (diff)
HCIHandler: Reuse opcode from request and use to_string for error messages
Diffstat (limited to 'src/direct_bt')
-rw-r--r--src/direct_bt/HCIHandler.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/direct_bt/HCIHandler.cpp b/src/direct_bt/HCIHandler.cpp
index f5d74be0..21f3c573 100644
--- a/src/direct_bt/HCIHandler.cpp
+++ b/src/direct_bt/HCIHandler.cpp
@@ -1116,8 +1116,8 @@ HCIStatusCode HCIHandler::getLocalVersion(HCILocalVersion &version) noexcept {
HCIStatusCode status;
std::unique_ptr<HCIEvent> ev = processCommandComplete(req0, &ev_lv, &status);
if( nullptr == ev || nullptr == ev_lv || HCIStatusCode::SUCCESS != status ) {
- ERR_PRINT("READ_LOCAL_VERSION: 0x%x (%s) - %s",
- number(status), to_string(status).c_str(), toString().c_str());
+ ERR_PRINT("%s: 0x%x (%s) - %s",
+ to_string(req0.getOpcode()), number(status), to_string(status).c_str(), toString().c_str());
bzero(&version, sizeof(version));
} else {
version.hci_ver = ev_lv->hci_ver;
@@ -1531,7 +1531,7 @@ HCIStatusCode HCIHandler::le_read_phy(const uint16_t conn_handle, const BDAddres
std::unique_ptr<HCIEvent> ev = processCommandComplete(req0, &ev_phy, &status);
if( nullptr == ev || nullptr == ev_phy || HCIStatusCode::SUCCESS != status ) {
- ERR_PRINT("LE_READ_PHY: 0x%x (%s) - %s",
+ ERR_PRINT("%s: 0x%x (%s) - %s", to_string(req0.getOpcode()),
number(status), to_string(status).c_str(), toString().c_str());
} else {
const uint16_t conn_handle_rcvd = jau::le_to_cpu(ev_phy->handle);
@@ -1584,7 +1584,7 @@ HCIStatusCode HCIHandler::le_set_default_phy(const LE_PHYs Tx, const LE_PHYs Rx)
std::unique_ptr<HCIEvent> ev = processCommandComplete(req0, &ev_status, &status);
if( nullptr == ev || nullptr == ev || HCIStatusCode::SUCCESS != status ) {
- ERR_PRINT("LE_SET_PHY: 0x%x (%s) - %s", number(status), to_string(status).c_str(), toString().c_str());
+ ERR_PRINT("%s: 0x%x (%s) - %s", to_string(req0.getOpcode()), number(status), to_string(status).c_str(), toString().c_str());
}
return status;
}
@@ -1627,7 +1627,7 @@ HCIStatusCode HCIHandler::le_set_phy(const uint16_t conn_handle, const BDAddress
std::unique_ptr<HCIEvent> ev = processCommandStatus(req0, &status);
if( nullptr == ev || nullptr == ev || HCIStatusCode::SUCCESS != status ) {
- ERR_PRINT("LE_SET_PHY: 0x%x (%s) - %s", number(status), to_string(status).c_str(), toString().c_str());
+ ERR_PRINT("%s: 0x%x (%s) - %s", to_string(req0.getOpcode()), number(status), to_string(status).c_str(), toString().c_str());
}
return status;
}