static const char BTIF_CONFIG_MODULE[] = "btif_config_module";
+static const std::string BT_CONFIG_KEY_SDP_DI_MANUFACTURER =
+ "SdpDiManufacturer";
+static const std::string BT_CONFIG_KEY_SDP_DI_MODEL = "SdpDiModel";
+static const std::string BT_CONFIG_KEY_SDP_DI_HW_VERSION =
+ "SdpDiHardwareVersion";
+static const std::string BT_CONFIG_KEY_SDP_DI_VENDOR_ID_SRC =
+ "SdpDiVendorIdSource";
+
+static const std::string BT_CONFIG_KEY_REMOTE_VER_MFCT = "Manufacturer";
+static const std::string BT_CONFIG_KEY_REMOTE_VER_VER = "LmpVer";
+static const std::string BT_CONFIG_KEY_REMOTE_VER_SUBVER = "LmpSubVer";
+
bool btif_config_has_section(const char* section);
bool btif_config_exist(const std::string& section, const std::string& key);
bool btif_config_get_int(const std::string& section, const std::string& key,
#define BTIF_STORAGE_PATH_REMOTE_DEVCLASS "DevClass"
#define BTIF_STORAGE_PATH_REMOTE_DEVTYPE "DevType"
#define BTIF_STORAGE_PATH_REMOTE_NAME "Name"
-#define BTIF_STORAGE_PATH_REMOTE_VER_MFCT "Manufacturer"
-#define BTIF_STORAGE_PATH_REMOTE_VER_VER "LmpVer"
-#define BTIF_STORAGE_PATH_REMOTE_VER_SUBVER "LmpSubVer"
//#define BTIF_STORAGE_PATH_REMOTE_LINKKEYS "remote_linkkeys"
#define BTIF_STORAGE_PATH_REMOTE_ALIASE "Aliase"
if (!info) return false;
- btif_config_set_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_MFCT,
+ btif_config_set_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_MFCT,
info->manufacturer);
- btif_config_set_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_VER,
- info->version);
- btif_config_set_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_SUBVER,
+ btif_config_set_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_VER, info->version);
+ btif_config_set_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_SUBVER,
info->sub_ver);
} break;
bt_remote_version_t* info = (bt_remote_version_t*)prop->val;
if (prop->len >= (int)sizeof(bt_remote_version_t)) {
- ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_MFCT,
+ ret = btif_config_get_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_MFCT,
&info->manufacturer);
if (ret)
- ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_VER,
+ ret = btif_config_get_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_VER,
&info->version);
if (ret)
- ret = btif_config_get_int(bdstr, BTIF_STORAGE_PATH_REMOTE_VER_SUBVER,
+ ret = btif_config_get_int(bdstr, BT_CONFIG_KEY_REMOTE_VER_SUBVER,
&info->sub_ver);
}
} break;
#include "bt_common.h"
#include "bt_types.h"
#include "bt_utils.h"
+#include "btif_config.h"
#include "btm_api.h"
#include "btm_int.h"
#include "btu.h"
bluetooth::common::LogLinkLayerConnectionEvent(
&bda, handle, android::bluetooth::DIRECTION_UNKNOWN, link_type, cmd,
evt_code, android::bluetooth::hci::BLE_EVT_UNKNOWN, status, reason);
+
+ // Read SDP_DI manufacturer, model, HW version from config,
+ // and log them
+ int sdp_di_manufacturer_id = 0;
+ int sdp_di_model_id = 0;
+ int sdp_di_hw_version = 0;
+ int sdp_di_vendor_id_source = 0;
+ std::string bda_string = bda.ToString();
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_SDP_DI_MANUFACTURER,
+ &sdp_di_manufacturer_id);
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_SDP_DI_MODEL,
+ &sdp_di_model_id);
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_SDP_DI_HW_VERSION,
+ &sdp_di_hw_version);
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_SDP_DI_VENDOR_ID_SRC,
+ &sdp_di_vendor_id_source);
+
+ std::stringstream ss;
+ // [N - native]::SDP::[DIP - Device ID Profile]
+ ss << "N:SDP::DIP::" << loghex(sdp_di_vendor_id_source);
+ bluetooth::common::LogManufacturerInfo(
+ bda, android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL,
+ ss.str(), loghex(sdp_di_manufacturer_id), loghex(sdp_di_model_id),
+ loghex(sdp_di_hw_version), "");
+
+ // Read LMP version, subversion and manufacturer from config,
+ // and log them
+ int lmp_version = -1;
+ int lmp_subversion = -1;
+ int lmp_manufacturer_id = -1;
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_REMOTE_VER_VER,
+ &lmp_version);
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_REMOTE_VER_SUBVER,
+ &lmp_subversion);
+ btif_config_get_int(bda_string, BT_CONFIG_KEY_REMOTE_VER_MFCT,
+ &lmp_manufacturer_id);
+ bluetooth::common::LogRemoteVersionInfo(
+ handle, status, lmp_version, lmp_manufacturer_id, lmp_subversion);
break;
}
case HCI_CONNECTION_REQUEST_EVT: {
#include "bt_common.h"
#include "bt_types.h"
+#include "btif_config.h"
#include "sdp_api.h"
#include "sdpint.h"
bda, android::bluetooth::DeviceInfoSrcEnum::DEVICE_INFO_INTERNAL,
ss.str(), loghex(di_record.rec.vendor), loghex(di_record.rec.product),
loghex(di_record.rec.version), "");
+
+ std::string bda_string = bda.ToString();
+ // write manufacturer, model, HW version to config
+ btif_config_set_int(bda_string, BT_CONFIG_KEY_SDP_DI_MANUFACTURER,
+ di_record.rec.vendor);
+ btif_config_set_int(bda_string, BT_CONFIG_KEY_SDP_DI_MODEL,
+ di_record.rec.product);
+ btif_config_set_int(bda_string, BT_CONFIG_KEY_SDP_DI_HW_VERSION,
+ di_record.rec.version);
+ btif_config_set_int(bda_string, BT_CONFIG_KEY_SDP_DI_VENDOR_ID_SRC,
+ di_record.rec.vendor_id_source);
}
}
}