summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwami Dhyan Anurag <dhyananurag@codeaurora.org>2014-09-03 16:06:45 -0700
committerSwami Dhyan Anurag <dhyananurag@codeaurora.org>2014-09-04 20:42:04 -0700
commit9a4070ce3cbe2df9943fc245bb0409e471479a0e (patch)
treecaede80a00f371e075243bb2e1d3466d4f1da65d
parent4143de2f26d059988405270610c3af55d53600fa (diff)
downloadandroid_hardware_qcom_bt-9a4070ce3cbe2df9943fc245bb0409e471479a0e.tar.gz
android_hardware_qcom_bt-9a4070ce3cbe2df9943fc245bb0409e471479a0e.tar.bz2
android_hardware_qcom_bt-9a4070ce3cbe2df9943fc245bb0409e471479a0e.zip
Bluetooth: BT Host and FW version from a file
Using ADB shell BT Host and FW version can be obtained by reading bt_version.info from /data/misc/bluetooh. Change-Id: I4b2776648b25092b9800ccc06f4c25ea1867fc7e CRs-Fixed: 707991
-rw-r--r--libbt-vendor/src/hw_rome.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/libbt-vendor/src/hw_rome.c b/libbt-vendor/src/hw_rome.c
index 162fa10..1ea6dd1 100644
--- a/libbt-vendor/src/hw_rome.c
+++ b/libbt-vendor/src/hw_rome.c
@@ -53,6 +53,14 @@ extern "C" {
#include "hci_uart.h"
#include "hw_rome.h"
+#define QBT_HOST_VERSION_MAJOR 3
+#define QBT_HOST_VERSION_MINOR 0
+#define QBT_HOST_VERSION_PATCH 0
+#define QBT_HOST_VERSION_BUILD 001
+#define QBT_HOST_VERSIONSTR "3.0.0.001"
+
+#define BT_VERSION_FILEPATH "/data/misc/bluedroid/bt_version.info"
+
#ifdef __cplusplus
}
#endif
@@ -83,9 +91,13 @@ extern uint8_t vnd_local_bd_addr[6];
int get_vs_hci_event(unsigned char *rsp)
{
- int err = 0, i, soc_id =0;
+ int err = 0;
unsigned char paramlen = 0;
unsigned char EMBEDDED_MODE_CHECK = 0x02;
+ FILE *btversionfile = 0;
+ unsigned int soc_id = 0;
+ unsigned int productid = 0;
+ unsigned short patchversion = 0;
if( (rsp[EVENTCODE_OFFSET] == VSEVENT_CODE) || (rsp[EVENTCODE_OFFSET] == EVT_CMD_COMPLETE))
ALOGI("%s: Received HCI-Vendor Specific event", __FUNCTION__);
@@ -109,7 +121,7 @@ int get_vs_hci_event(unsigned char *rsp)
case EDL_PATCH_VER_RES_EVT:
case EDL_APP_VER_RES_EVT:
ALOGI("\t Current Product ID\t\t: 0x%08x",
- (unsigned int)(rsp[PATCH_PROD_ID_OFFSET +3] << 24 |
+ productid = (unsigned int)(rsp[PATCH_PROD_ID_OFFSET +3] << 24 |
rsp[PATCH_PROD_ID_OFFSET+2] << 16 |
rsp[PATCH_PROD_ID_OFFSET+1] << 8 |
rsp[PATCH_PROD_ID_OFFSET] ));
@@ -134,6 +146,17 @@ int get_vs_hci_event(unsigned char *rsp)
rsp[PATCH_SOC_VER_OFFSET] ));
}
+ if (NULL != (btversionfile = fopen(BT_VERSION_FILEPATH, "wb"))) {
+ fprintf(btversionfile, "Bluetooth Controller Product ID : 0x%08x\n", productid);
+ fprintf(btversionfile, "Bluetooth Controller Patch Version : 0x%04x\n", patchversion);
+ fprintf(btversionfile, "Bluetooth Controller Build Version : 0x%04x\n", rome_ver);
+ fprintf(btversionfile, "Bluetooth Controller SOC Version : 0x%08x\n", soc_id);
+ fprintf(btversionfile, "Bluetooth Host Version : %s\n", QBT_HOST_VERSIONSTR);
+ fclose(btversionfile);
+ }else {
+ ALOGI("Failed to dump SOC version info. Errno:%d", errno);
+ }
+
/* Rome Chipset Version can be decided by Patch version and SOC version,
Upper 2 bytes will be used for Patch version and Lower 2 bytes will be
used for SOC as combination for BT host driver */