From ed9b10a6c3eee4fe4a8345d08c9cae744b0ea668 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Mon, 3 May 2021 16:39:12 -0700 Subject: [PATCH] log: Polish security record logging structures Bug: 183374320 Test: gd/cert/run Tag: #refactor Change-Id: If22f738ca7aae645007b72512b25d8ad11a45620 --- stack/btm/security_device_record.h | 8 ++++---- stack/include/bt_types.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/stack/btm/security_device_record.h b/stack/btm/security_device_record.h index 78afc604d..a2c5944b8 100644 --- a/stack/btm/security_device_record.h +++ b/stack/btm/security_device_record.h @@ -189,7 +189,7 @@ typedef enum : uint8_t { } tBTM_SM4_BIT; inline std::string class_of_device_text(const DEV_CLASS& cod) { - return base::StringPrintf("0x%01x%01x%01x", cod[2], cod[1], cod[0]); + return base::StringPrintf("0x%02x%02x%02x", cod[2], cod[1], cod[0]); } /* @@ -424,10 +424,10 @@ struct tBTM_SEC_DEV_REC { std::string ToString() const { return base::StringPrintf( - "%s %6s SecureConn:%s cod:%s remote_info:%s sm4:0x%02x name:\"%s\"", + "%s %6s cod:%s remote_info:%-14s sm4:0x%02x SecureConn:%c name:\"%s\"", PRIVATE_ADDRESS(bd_addr), DeviceTypeText(device_type).c_str(), - logbool(remote_supports_secure_connections).c_str(), class_of_device_text(dev_class).c_str(), - remote_version_info.ToString().c_str(), sm4, sec_bd_name); + remote_version_info.ToString().c_str(), sm4, + (remote_supports_secure_connections) ? 'T' : 'F', sec_bd_name); } }; diff --git a/stack/include/bt_types.h b/stack/include/bt_types.h index 6d673e2c6..609181177 100644 --- a/stack/include/bt_types.h +++ b/stack/include/bt_types.h @@ -548,7 +548,7 @@ inline std::string DeviceTypeText(tBT_DEVICE_TYPE type) { case BT_DEVICE_TYPE_BLE: return std::string("BLE"); case BT_DEVICE_TYPE_DUMO: - return std::string("BR_EDR and BLE"); + return std::string("DUAL"); default: return std::string("Unknown"); } -- 2.11.0