From 66c09fca910e0bb4066fbf6268592f78dfaec3c5 Mon Sep 17 00:00:00 2001 From: Ravi Nagarajan Date: Tue, 28 Aug 2012 03:53:51 -0700 Subject: Log DM events Add strings for DM event Change-Id: I800780c181dd51cbf9bb037690ad167a5f8bf363 --- btif/include/btif_util.h | 1 + btif/src/btif_dm.c | 2 +- btif/src/btif_util.c | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) mode change 100644 => 100755 btif/include/btif_util.h mode change 100644 => 100755 btif/src/btif_util.c (limited to 'btif') diff --git a/btif/include/btif_util.h b/btif/include/btif_util.h old mode 100644 new mode 100755 index 075194d..cfa7945 --- a/btif/include/btif_util.h +++ b/btif/include/btif_util.h @@ -86,6 +86,7 @@ typedef char bdstr_t[18]; const char* dump_bt_status(bt_status_t status); const char* dump_dm_search_event(UINT16 event); +const char* dump_dm_event(UINT16 event); const char* dump_hf_event(UINT16 event); const char* dump_hh_event(UINT16 event); const char* dump_hf_conn_state(UINT16 event); diff --git a/btif/src/btif_dm.c b/btif/src/btif_dm.c index 31b6435..90131aa 100755 --- a/btif/src/btif_dm.c +++ b/btif/src/btif_dm.c @@ -1107,7 +1107,7 @@ static void btif_dm_upstreams_evt(UINT16 event, char* p_param) uint32_t i; bt_bdaddr_t bd_addr; - BTIF_TRACE_EVENT1("btif_dm_upstreams_cback ev: %d", event); + BTIF_TRACE_EVENT1("btif_dm_upstreams_cback ev: %s", dump_dm_event(event)); switch (event) { diff --git a/btif/src/btif_util.c b/btif/src/btif_util.c old mode 100644 new mode 100755 index 07f1896..fb2e792 --- a/btif/src/btif_util.c +++ b/btif/src/btif_util.c @@ -276,6 +276,39 @@ const char* dump_property_type(bt_property_type_t type) } } +const char* dump_dm_event(UINT16 event) +{ + switch(event) + { + CASE_RETURN_STR(BTA_DM_ENABLE_EVT) + CASE_RETURN_STR(BTA_DM_DISABLE_EVT) + CASE_RETURN_STR(BTA_DM_PIN_REQ_EVT) + CASE_RETURN_STR(BTA_DM_AUTH_CMPL_EVT) + CASE_RETURN_STR(BTA_DM_AUTHORIZE_EVT) + CASE_RETURN_STR(BTA_DM_LINK_UP_EVT) + CASE_RETURN_STR(BTA_DM_LINK_DOWN_EVT) + CASE_RETURN_STR(BTA_DM_SIG_STRENGTH_EVT) + CASE_RETURN_STR(BTA_DM_BUSY_LEVEL_EVT) + CASE_RETURN_STR(BTA_DM_BOND_CANCEL_CMPL_EVT) + CASE_RETURN_STR(BTA_DM_SP_CFM_REQ_EVT) + CASE_RETURN_STR(BTA_DM_SP_KEY_NOTIF_EVT) + CASE_RETURN_STR(BTA_DM_SP_RMT_OOB_EVT) + CASE_RETURN_STR(BTA_DM_SP_KEYPRESS_EVT) + CASE_RETURN_STR(BTA_DM_ROLE_CHG_EVT) + CASE_RETURN_STR(BTA_DM_BLE_KEY_EVT) + CASE_RETURN_STR(BTA_DM_BLE_SEC_REQ_EVT) + CASE_RETURN_STR(BTA_DM_BLE_PASSKEY_NOTIF_EVT) + CASE_RETURN_STR(BTA_DM_BLE_PASSKEY_REQ_EVT) + CASE_RETURN_STR(BTA_DM_BLE_OOB_REQ_EVT) + CASE_RETURN_STR(BTA_DM_BLE_LOCAL_IR_EVT) + CASE_RETURN_STR(BTA_DM_BLE_LOCAL_ER_EVT) + CASE_RETURN_STR(BTA_DM_BLE_AUTH_CMPL_EVT) + CASE_RETURN_STR(BTA_DM_DEV_UNPAIRED_EVT) + + default: + return "UNKNOWN DM EVENT"; + } +} const char* dump_hf_event(UINT16 event) { -- cgit v1.1