#define LOG_NDDEBUG 0
#define LOG_TAG "bt_btif"
+#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "btif_debug.h"
#include "btsnoop.h"
#include "btsnoop_mem.h"
+#include "device/include/interop.h"
#include "osi/include/allocation_tracker.h"
#include "osi/include/alarm.h"
#include "osi/include/log.h"
+#include "osi/include/metrics.h"
#include "osi/include/osi.h"
#include "osi/include/wakelock.h"
#include "stack_manager.h"
#include "btif/include/btif_media.h"
/************************************************************************************
-** Constants & Macros
-************************************************************************************/
-
-#define is_profile(profile, str) ((strlen(str) == strlen(profile)) && strncmp((const char *)profile, str, strlen(str)) == 0)
-
-/************************************************************************************
** Static variables
************************************************************************************/
return bt_hal_cbacks != NULL;
}
+static bool is_profile(const char *p1, const char *p2) {
+ assert(p1);
+ assert(p2);
+ return strlen(p1) == strlen(p2) && strncmp(p1, p2, strlen(p2)) == 0;
+}
+
/*****************************************************************************
**
** BLUETOOTH HAL INTERFACE FUNCTIONS
return BT_STATUS_SUCCESS;
}
-static void dump(int fd, UNUSED_ATTR const char **arguments)
+static void dump(int fd, const char **arguments)
{
+ if (arguments != NULL && arguments[0] != NULL) {
+ if (strncmp(arguments[0], "--proto-text", 12) == 0) {
+ btif_update_a2dp_metrics();
+ metrics_print(fd, true);
+ return;
+ }
+ if (strncmp(arguments[0], "--proto-bin", 11) == 0) {
+ btif_update_a2dp_metrics();
+ metrics_write(fd, true);
+ return;
+ }
+ }
btif_debug_conn_dump(fd);
+ btif_debug_bond_event_dump(fd);
btif_debug_a2dp_dump(fd);
+ btif_debug_config_dump(fd);
wakelock_debug_dump(fd);
alarm_debug_dump(fd);
#if defined(BTSNOOP_MEM) && (BTSNOOP_MEM == TRUE)
}
static int config_clear(void) {
- LOG_INFO("%s", __func__);
+ LOG_INFO(LOG_TAG, "%s", __func__);
return btif_config_clear() ? BT_STATUS_SUCCESS : BT_STATUS_FAIL;
}
set_os_callouts,
read_energy_info,
dump,
- config_clear
+ config_clear,
+ interop_database_clear,
+ interop_database_add,
};
const bt_interface_t* bluetooth__get_bluetooth_interface ()