diff options
-rw-r--r-- | audio_a2dp_hw/audio_a2dp_hw.c | 4 | ||||
-rwxr-xr-x[-rw-r--r--] | main/bte_logmsg.c | 80 | ||||
-rw-r--r-- | stack/btu/btu_hcif.c | 2 |
3 files changed, 72 insertions, 14 deletions
diff --git a/audio_a2dp_hw/audio_a2dp_hw.c b/audio_a2dp_hw/audio_a2dp_hw.c index 9f29313..93eaec2 100644 --- a/audio_a2dp_hw/audio_a2dp_hw.c +++ b/audio_a2dp_hw/audio_a2dp_hw.c @@ -942,7 +942,9 @@ static char * adev_get_parameters(const struct audio_hw_device *dev, str_parms_dump(parms); - return NULL; + str_parms_destroy(parms); + + return strdup(""); } static int adev_init_check(const struct audio_hw_device *dev) diff --git a/main/bte_logmsg.c b/main/bte_logmsg.c index f6a08d2..c67dbbd 100644..100755 --- a/main/bte_logmsg.c +++ b/main/bte_logmsg.c @@ -93,14 +93,64 @@ #include <time.h> #if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE)) -#define LOG_TAG "BtLogMsg" +const char * const bt_layer_tags[] = { + "bt-btif", + "bt-usb", + "bt-serial", + "bt-socket", + "bt-rs232", + "bt-lc", + "bt-lm", + "bt-hci", + "bt-l2cap", + "bt-rfcomm", + "bt-sdp", + "bt-tcs", + "bt-obex", + "bt-btm", + "bt-gap", + "bt-dun", + "bt-goep", + "bt-icp", + "bt-hsp2", + "bt-spp", + "bt-ctp", + "bt-bpp", + "bt-hcrp", + "bt-ftp", + "bt-opp", + "bt-btu", + "bt-gki", + "bt-bnep", + "bt-pan", + "bt-hfp", + "bt-hid", + "bt-bip", + "bt-avp", + "bt-a2d", + "bt-sap", + "bt-amp", + "bt-mca", + "bt-att", + "bt-smp", + "bt-nfc", + "bt-nci", + "bt-idep", + "bt-ndep", + "bt-llcp", + "bt-rw", + "bt-ce", + "bt-snep", + "bt-ndef", + "bt-nfa", +}; #ifndef LINUX_NATIVE #include <cutils/log.h> -#define LOGI0(s) __android_log_write(ANDROID_LOG_INFO, NULL, s) -#define LOGD0(s) __android_log_write(ANDROID_LOG_DEBUG, NULL, s) -#define LOGW0(s) __android_log_write(ANDROID_LOG_WARN, NULL, s) -#define LOGE0(s) __android_log_write(ANDROID_LOG_ERROR, NULL, s) +#define LOGI0(t,s) __android_log_write(ANDROID_LOG_INFO, t, s) +#define LOGD0(t,s) __android_log_write(ANDROID_LOG_DEBUG, t, s) +#define LOGW0(t,s) __android_log_write(ANDROID_LOG_WARN, t, s) +#define LOGE0(t,s) __android_log_write(ANDROID_LOG_ERROR, t, s) #else #undef ANDROID_USE_LOGCAT @@ -153,6 +203,9 @@ void LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...) { static char buffer[BTE_LOG_BUF_SIZE]; + int trace_layer = TRACE_GET_LAYER(trace_set_mask); + if (trace_layer >= TRACE_LAYER_MAX_NUM) + trace_layer = 0; va_list ap; #if (BTE_ANDROID_INTERNAL_TIMESTAMP==TRUE) @@ -177,24 +230,24 @@ LogMsg(UINT32 trace_set_mask, const char *fmt_str, ...) switch ( TRACE_GET_TYPE(trace_set_mask) ) { case TRACE_TYPE_ERROR: - LOGE0(buffer); + LOGE0(bt_layer_tags[trace_layer], buffer); break; case TRACE_TYPE_WARNING: - LOGW0(buffer); + LOGW0(bt_layer_tags[trace_layer], buffer); break; case TRACE_TYPE_API: case TRACE_TYPE_EVENT: - LOGI0(buffer); + LOGI0(bt_layer_tags[trace_layer], buffer); break; case TRACE_TYPE_DEBUG: - LOGD0(buffer); + LOGD0(bt_layer_tags[trace_layer], buffer); break; default: - LOGE0(buffer); /* we should never get this */ + LOGE0(bt_layer_tags[trace_layer], buffer); /* we should never get this */ break; } #else - LOGI0(buffer); + LOGI0(bt_layer_tags[trace_layer], buffer); #endif #else write(2, buffer, strlen(buffer)); @@ -212,6 +265,9 @@ ScrLog(UINT32 trace_set_mask, const char *fmt_str, ...) struct timezone tz; struct tm *tm; time_t t; + int trace_layer = TRACE_GET_LAYER(trace_set_mask); + if (trace_layer >= TRACE_LAYER_MAX_NUM) + trace_layer = 0; gettimeofday(&tv, &tz); time(&t); @@ -225,7 +281,7 @@ ScrLog(UINT32 trace_set_mask, const char *fmt_str, ...) va_end(ap); #if (defined(ANDROID_USE_LOGCAT) && (ANDROID_USE_LOGCAT==TRUE)) - LOGI0(buffer); + LOGI0(bt_layer_tags[trace_layer], buffer); #else write(2, buffer, strlen(buffer)); write(2, "\n", 1); diff --git a/stack/btu/btu_hcif.c b/stack/btu/btu_hcif.c index ebacf93..1ee6b94 100644 --- a/stack/btu/btu_hcif.c +++ b/stack/btu/btu_hcif.c @@ -1597,7 +1597,7 @@ void btu_hcif_cmd_timeout (UINT8 controller_id) *******************************************************************************/ static void btu_hcif_hardware_error_evt (UINT8 *p, UINT16 evt_len) { - BT_TRACE_0 (TRACE_LAYER_HCI, TRACE_TYPE_ERROR, "Ctlr H/w error event"); + BT_TRACE_1 (TRACE_LAYER_HCI, TRACE_TYPE_ERROR, "Ctlr H/w error event - code:0x%x", *p); /* If anyone wants device status notifications, give him one. */ btm_report_device_status (BTM_DEV_STATUS_DOWN); |