LOCAL_C_INCLUDES += \
. \
+ $(LOCAL_PATH)/../ \
$(LOCAL_PATH)/../utils/include
LOCAL_CFLAGS += -std=c99 $(bdroid_CFLAGS)
#include "bt_utils.h"
#define LOG_TAG "audio_a2dp_hw"
-/* #define LOG_NDEBUG 0 */
-#include <log/log.h>
+#include "osi/include/log.h"
/*****************************************************************************
** Constants & Macros
#define CASE_RETURN_STR(const) case const: return #const;
-#define FNLOG() ALOGV("%s", __FUNCTION__);
-#define DEBUG(fmt, ...) ALOGV("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define INFO(fmt, ...) ALOGI("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define ERROR(fmt, ...) ALOGE("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
+#define FNLOG() LOG_VERBOSE("%s", __FUNCTION__);
+#define DEBUG(fmt, ...) LOG_VERBOSE("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
+#define INFO(fmt, ...) LOG_INFO("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
+#define ERROR(fmt, ...) LOG_ERROR("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
#define ASSERTC(cond, msg, val) if (!(cond)) {ERROR("### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
$(LOCAL_PATH)/sys \
$(LOCAL_PATH)/dm \
$(LOCAL_PATH)/hh \
+ $(LOCAL_PATH)/../ \
$(LOCAL_PATH)/../btcore/include \
$(LOCAL_PATH)/../gki/common \
$(LOCAL_PATH)/../gki/ulinux \
* machine.
*
******************************************************************************/
+#define LOG_TAG "bta_gattc_act"
#include "bt_target.h"
#include <string.h>
+#include "osi/include/log.h"
+
#if BTA_GATT_INCLUDED && BLE_INCLUDED == TRUE
/*****************************************************************************
/* if listen to all */
else
{
- APPL_TRACE_ERROR("Listen For All now");
+ LOG_DEBUG("Listen For All now");
/* go through all connected device and send
callback for all connected slave connection */
bta_gattc_process_listen_all(p_msg->api_listen.client_if);
* This is the main implementation file for the BTA system manager.
*
******************************************************************************/
-#include <assert.h>
#define LOG_TAG "bta_sys_main"
-#include <cutils/log.h>
+
+#include <assert.h>
#include <string.h>
#include "alarm.h"
#include "hash_functions.h"
#include "hash_map.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "thread.h"
#if( defined BTA_AR_INCLUDED ) && (BTA_AR_INCLUDED == TRUE)
#include "bta_ar_api.h"
alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGE("%s unable to create alarm.", __func__);
+ LOG_ERROR("%s unable to create alarm.", __func__);
return;
}
alarm_t *alarm = hash_map_get(bta_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGE("%s expected alarm was not in bta alarm hash map.", __func__);
+ LOG_ERROR("%s expected alarm was not in bta alarm hash map.", __func__);
return;
}
alarm_cancel(alarm);
#define LOG_TAG "bt_counter"
#include <assert.h>
-#include <cutils/log.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include "list.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "socket.h"
#include "thread.h"
hash_map_counter_ = hash_map_new(COUNTER_NUM_BUCKETS, hash_function_string,
NULL, hash_element_free_);
if (hash_map_counter_ == NULL) {
- ALOGE("%s unable to allocate resources", __func__);
+ LOG_ERROR("%s unable to allocate resources", __func__);
return future_new_immediate(FUTURE_FAIL);
}
if (!counter_socket_open()) {
- ALOGE("%s unable to open counter port", __func__);
+ LOG_ERROR("%s unable to open counter port", __func__);
return future_new_immediate(FUTURE_FAIL);
}
return future_new_immediate(FUTURE_SUCCESS);
counter = counter_new_(0);
if (!counter) {
- ALOGE("%s unable to create new counter name:%s", __func__, name);
+ LOG_ERROR("%s unable to create new counter name:%s", __func__, name);
goto exit;
}
hash_element_t *element = hash_element_new_();
if (!element) {
- ALOGE("%s unable to create counter element name:%s", __func__, name);
+ LOG_ERROR("%s unable to create counter element name:%s", __func__, name);
counter_free_(counter);
counter = NULL;
goto exit;
element->key = name;
element->val = counter;
if (!hash_map_set(hash_map_counter_, name, counter)) {
- ALOGE("%s unable to set new counter into hash map name:%s", __func__, name);
+ LOG_ERROR("%s unable to set new counter into hash map name:%s", __func__, name);
hash_element_free_(element);
counter_free_(counter);
counter = NULL;
clients_ = list_new(client_free);
if (!clients_) {
- ALOGE("%s unable to create counter clients list", __func__);
+ LOG_ERROR("%s unable to create counter clients list", __func__);
goto error;
}
thread_ = thread_new("counter_socket");
if (!thread_) {
- ALOGE("%s unable to create counter thread", __func__);
+ LOG_ERROR("%s unable to create counter thread", __func__);
goto error;
}
listen_socket_ = socket_new();
if (!listen_socket_) {
- ALOGE("%s unable to create listen socket", __func__);
+ LOG_ERROR("%s unable to create listen socket", __func__);
goto error;
}
if (!socket_listen(listen_socket_, LISTEN_PORT)) {
- ALOGE("%s unable to setup listen socket", __func__);
+ LOG_ERROR("%s unable to setup listen socket", __func__);
goto error;
}
- ALOGI("%s opened counter server socket", __func__);
+ LOG_INFO("%s opened counter server socket", __func__);
socket_register(listen_socket_, thread_get_reactor(thread_), NULL, accept_ready, NULL);
return true;
thread_ = NULL;
clients_ = NULL;
- ALOGI("%s closed counter server socket", __func__);
+ LOG_INFO("%s closed counter server socket", __func__);
}
static bool monitor_counter_iter_cb(const char *name, counter_data_t val, void *context) {
assert(socket != NULL);
assert(socket == listen_socket_);
- ALOGI("%s accepted OSI monitor socket", __func__);
+ LOG_INFO("%s accepted OSI monitor socket", __func__);
socket = socket_accept(socket);
if (!socket)
return;
client_t *client = (client_t *)osi_calloc(sizeof(client_t));
if (!client) {
- ALOGE("%s unable to allocate memory for client", __func__);
+ LOG_ERROR("%s unable to allocate memory for client", __func__);
socket_free(socket);
return;
}
client->socket = socket;
if (!list_append(clients_, client)) {
- ALOGE("%s unable to add client to list", __func__);
+ LOG_ERROR("%s unable to add client to list", __func__);
client_free(client);
return;
}
#include <assert.h>
#include <dlfcn.h>
#include <pthread.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "hash_functions.h"
#include "hash_map.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
typedef enum {
MODULE_STATE_NONE = 0,
assert(get_module_state(module) == MODULE_STATE_NONE);
if (!call_lifecycle_function(module->init)) {
- ALOGE("%s failed to initialize \"%s\"", __func__, module->name);
+ LOG_ERROR("%s failed to initialize \"%s\"", __func__, module->name);
return false;
}
assert(get_module_state(module) == MODULE_STATE_INITIALIZED || module->init == NULL);
if (!call_lifecycle_function(module->start_up)) {
- ALOGE("%s failed to start up \"%s\"", __func__, module->name);
+ LOG_ERROR("%s failed to start up \"%s\"", __func__, module->name);
return false;
}
return;
if (!call_lifecycle_function(module->shut_down))
- ALOGE("%s found \"%s\" reported failure during shutdown. Continuing anyway.", __func__, module->name);
+ LOG_ERROR("%s found \"%s\" reported failure during shutdown. Continuing anyway.", __func__, module->name);
set_module_state(module, MODULE_STATE_INITIALIZED);
}
return;
if (!call_lifecycle_function(module->clean_up))
- ALOGE("%s found \"%s\" reported failure during cleanup. Continuing anyway.", __func__, module->name);
+ LOG_ERROR("%s found \"%s\" reported failure during cleanup. Continuing anyway.", __func__, module->name);
set_module_state(module, MODULE_STATE_NONE);
}
* limitations under the License.
*
******************************************************************************/
+
+#define LOG_TAG "BTA_AG_CO"
+
#include "gki.h"
#include "bta_api.h"
#include "bta_sys.h"
#include "bte_appl.h"
#include "bt_utils.h"
-#define LOG_TAG "BTA_AG_CO: "
-
#ifndef LINUX_NATIVE
#include <cutils/properties.h>
-#include <cutils/log.h>
#else
#include <stdio.h>
#define LOGI(format, ...) fprintf (stdout, LOG_TAG format"\n", ## __VA_ARGS__)
*
******************************************************************************/
+#include <stdio.h>
+#include <unistd.h>
#include "gki.h"
#include "bta_gattc_co.h"
#include <fcntl.h>
#include <ctype.h>
#include <cutils/sockets.h>
-#include <cutils/log.h>
#include "bta_api.h"
#include "btm_api.h"
#include "bta_sys.h"
#error "LOG_TAG not defined, please add in .c file prior to including bt_common.h"
#endif
-#include <utils/Log.h>
+#include "osi/include/log.h"
/*******************************************************************************
** Constants & Macros
********************************************************************************/
-#define ASSERTC(cond, msg, val) if (!(cond)) { ALOGE( \
+#define ASSERTC(cond, msg, val) if (!(cond)) { LOG_ERROR( \
"### ASSERT : %s line %d %s (%d) ###", __FILE__, __LINE__, msg, val);}
/* Calculate start of event enumeration; id is top 8 bits of event */
#define BTIF_SOCK_UTIL_H
#include <pthread.h>
-#include <cutils/log.h>
+
+#include "osi/include/log.h"
/*******************************************************************************
** Functions
{
if(mutex->value)
pthread_mutex_lock(mutex);
- else ALOGE("mutex: %p is not initialized", mutex);
+ else LOG_ERROR("mutex: %p is not initialized", mutex);
}
static inline void unlock_slot(pthread_mutex_t* mutex)
{
if(mutex->value)
pthread_mutex_unlock(mutex);
- else ALOGE("mutex: %p is not initialized", mutex);
+ else LOG_ERROR("mutex: %p is not initialized", mutex);
}
void dump_bin(const char* title, const char* data, int size);
#include "bt_types.h"
-#include <utils/Log.h>
-
/*******************************************************************************
** Constants & Macros
********************************************************************************/
#include <hardware/bluetooth.h>
#include <hardware/bt_hf.h>
-#include <utils/Log.h>
#include <stdbool.h>
#include <sys/time.h>
#include "bt_utils.h"
#include "osi.h"
#include "osi/include/allocation_tracker.h"
+#include "osi/include/log.h"
#include "stack_manager.h"
/************************************************************************************
*****************************************************************************/
static int init(bt_callbacks_t *callbacks) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
if (interface_ready())
return BT_STATUS_DONE;
}
static int enable(void) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
if (!interface_ready())
return BT_STATUS_NOT_READY;
static const void* get_profile_interface (const char *profile_id)
{
- ALOGI("get_profile_interface %s", profile_id);
+ LOG_INFO("get_profile_interface %s", profile_id);
/* sanity check */
if (interface_ready() == FALSE)
int dut_mode_configure(uint8_t enable)
{
- ALOGI("dut_mode_configure");
+ LOG_INFO("dut_mode_configure");
/* sanity check */
if (interface_ready() == FALSE)
int dut_mode_send(uint16_t opcode, uint8_t* buf, uint8_t len)
{
- ALOGI("dut_mode_send");
+ LOG_INFO("dut_mode_send");
/* sanity check */
if (interface_ready() == FALSE)
#if BLE_INCLUDED == TRUE
int le_test_mode(uint16_t opcode, uint8_t* buf, uint8_t len)
{
- ALOGI("le_test_mode");
+ LOG_INFO("le_test_mode");
/* sanity check */
if (interface_ready() == FALSE)
int config_hci_snoop_log(uint8_t enable)
{
- ALOGI("config_hci_snoop_log");
+ LOG_INFO("config_hci_snoop_log");
if (!interface_ready())
return BT_STATUS_NOT_READY;
#include <pthread.h>
#include <stdio.h>
#include <string.h>
-#include <utils/Log.h>
#include "alarm.h"
#include "bdaddr.h"
#include "config.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "bt_types.h"
if (!btif_config_get_int(bd_addr_str, "DevType", p_device_type))
return FALSE;
- ALOGD("%s: Device [%s] type %d", __FUNCTION__, bd_addr_str, *p_device_type);
+ LOG_DEBUG("%s: Device [%s] type %d", __FUNCTION__, bd_addr_str, *p_device_type);
return TRUE;
}
if (!btif_config_get_int(bd_addr_str, "AddrType", p_addr_type))
return FALSE;
- ALOGD("%s: Device [%s] address type %d", __FUNCTION__, bd_addr_str, *p_addr_type);
+ LOG_DEBUG("%s: Device [%s] address type %d", __FUNCTION__, bd_addr_str, *p_addr_type);
return TRUE;
}
pthread_mutex_init(&lock, NULL);
config = config_new(CONFIG_FILE_PATH);
if (!config) {
- ALOGW("%s unable to load config file; attempting to transcode legacy file.", __func__);
+ LOG_WARN("%s unable to load config file; attempting to transcode legacy file.", __func__);
config = btif_config_transcode(LEGACY_CONFIG_FILE_PATH);
if (!config) {
- ALOGW("%s unable to transcode legacy file, starting unconfigured.", __func__);
+ LOG_WARN("%s unable to transcode legacy file, starting unconfigured.", __func__);
config = config_new_empty();
if (!config) {
- ALOGE("%s unable to allocate a config object.", __func__);
+ LOG_ERROR("%s unable to allocate a config object.", __func__);
goto error;
}
}
// write back to disk.
alarm_timer = alarm_new();
if (!alarm_timer) {
- ALOGE("%s unable to create alarm.", __func__);
+ LOG_ERROR("%s unable to create alarm.", __func__);
goto error;
}
#define LOG_TAG "bt_btif_config_transcode"
#include <tinyxml2.h>
-#include <utils/Log.h>
extern "C" {
-#include "config.h"
+#include "osi/include/config.h"
+#include "osi/include/log.h"
}
using namespace tinyxml2;
XMLDocument document;
int error = document.LoadFile(xml_filename);
if (error != XML_SUCCESS) {
- ALOGE("%s unable to load XML file '%s': %d", __func__, xml_filename, error);
+ LOG_ERROR("%s unable to load XML file '%s': %d", __func__, xml_filename, error);
return NULL;
}
XMLElement *rootElement = document.RootElement();
if (!rootElement) {
- ALOGE("%s unable to find root element; assuming corrupted config file.", __func__);
+ LOG_ERROR("%s unable to find root element; assuming corrupted config file.", __func__);
return NULL;
}
config_t *config = config_new_empty();
if (!config) {
- ALOGE("%s unable to allocate config object.", __func__);
+ LOG_ERROR("%s unable to allocate config object.", __func__);
return NULL;
}
#include "fixed_queue.h"
#include "future.h"
#include "gki.h"
+#include "osi.h"
+#include "osi/include/log.h"
#include "stack_manager.h"
#include "thread.h"
-#include "osi.h"
/************************************************************************************
** Constants & Macros
bt_jni_workqueue_thread = thread_new(BT_JNI_WORKQUEUE_NAME);
if (bt_jni_workqueue_thread == NULL) {
- ALOGE("%s Unable to create thread %s\n", __func__, BT_JNI_WORKQUEUE_NAME);
+ LOG_ERROR("%s Unable to create thread %s\n", __func__, BT_JNI_WORKQUEUE_NAME);
goto error_exit;
}
*
*
***********************************************************************************/
+
+#define LOG_TAG "btif_dm"
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <hardware/bluetooth.h>
-#include <utils/Log.h>
#include <cutils/properties.h>
#include "gki.h"
#include "btu.h"
#include "btif_config.h"
#include "bta_gatt_api.h"
+#include "include/stack_config.h"
+#include "osi/include/log.h"
/******************************************************************************
** Device specific workarounds
btm_status = BTM_ReadRemoteVersion(*(BD_ADDR*)p_bd, &lmp_ver,
&mfct_set, &lmp_subver);
- ALOGD("remote version info [%s]: %x, %x, %x", bdaddr_to_string(p_bd, bdstr, sizeof(bdstr)),
+ LOG_DEBUG("remote version info [%s]: %x, %x, %x", bdaddr_to_string(p_bd, bdstr, sizeof(bdstr)),
lmp_ver, mfct_set, lmp_subver);
if (btm_status == BTM_SUCCESS)
cod = devclass2uint(p_ssp_cfm_req->dev_class);
if ( cod == 0) {
- ALOGD("cod is 0, set as unclassified");
+ LOG_DEBUG("cod is 0, set as unclassified");
cod = COD_UNCLASSIFIED;
}
cod = devclass2uint(p_ssp_key_notif->dev_class);
if ( cod == 0) {
- ALOGD("cod is 0, set as unclassified");
+ LOG_DEBUG("cod is 0, set as unclassified");
cod = COD_UNCLASSIFIED;
}
if (check_sdp_bl(&bd_addr) && check_cod_hid(&bd_addr, COD_HID_MAJOR))
{
- ALOGW("%s:skip SDP",
- __FUNCTION__);
+ LOG_WARN("%s:skip SDP", __FUNCTION__);
skip_sdp = TRUE;
}
if(!pairing_cb.is_local_initiated && skip_sdp)
{
bond_state_changed(status, &bd_addr, state);
- ALOGW("%s: Incoming HID Connection",__FUNCTION__);
+ LOG_WARN("%s: Incoming HID Connection",__FUNCTION__);
bt_property_t prop;
bt_bdaddr_t bd_addr;
bt_uuid_t uuid;
cod = devclass2uint (p_search_data->inq_res.dev_class);
if ( cod == 0) {
- ALOGD("cod is 0, set as unclassified");
+ LOG_DEBUG("cod is 0, set as unclassified");
cod = COD_UNCLASSIFIED;
}
#include "btif_dm.h"
#include "btif_storage.h"
+#include "osi/include/log.h"
#include "vendor_api.h"
/*******************************************************************************
#define CHECK_BTGATT_INIT() if (bt_gatt_callbacks == NULL)\
{\
- BTIF_TRACE_WARNING("%s: BTGATT not initialized", __FUNCTION__);\
+ LOG_WARN("%s: BTGATT not initialized", __FUNCTION__);\
return BT_STATUS_NOT_READY;\
} else {\
- BTIF_TRACE_DEBUG("%s", __FUNCTION__);\
+ LOG_DEBUG("%s", __FUNCTION__);\
}
#define BLE_RESOLVE_ADDR_MSB 0x40 /* bit7, bit6 is 01 to be resolvable random */
memcpy(p_dev_cb->remote_dev[i].bd_addr.address, p_bda, BD_ADDR_LEN);
p_dev_cb->addr_type = addr_type;
p_dev_cb->remote_dev[i].in_use = TRUE;
- BTIF_TRACE_DEBUG("%s device added idx=%d", __FUNCTION__, i );
+ LOG_DEBUG("%s device added idx=%d", __FUNCTION__, i );
break;
}
}
memcpy(p_dev_cb->remote_dev[i].bd_addr.address, p_bda, BD_ADDR_LEN);
p_dev_cb->addr_type = addr_type;
p_dev_cb->remote_dev[i].in_use = TRUE;
- BTIF_TRACE_DEBUG("%s device overwrite idx=%d", __FUNCTION__, i );
+ LOG_DEBUG("%s device overwrite idx=%d", __FUNCTION__, i );
p_dev_cb->next_storage_idx++;
if (p_dev_cb->next_storage_idx >= BTIF_GATT_MAX_OBSERVED_DEV)
p_dev_cb->next_storage_idx = 0;
memcpy(bdname.name, p_eir_remote_name, remote_name_len);
bdname.name[remote_name_len]='\0';
- BTIF_TRACE_DEBUG("%s BLE device name=%s len=%d dev_type=%d", __FUNCTION__, bdname.name,
+ LOG_DEBUG("%s BLE device name=%s len=%d dev_type=%d", __FUNCTION__, bdname.name,
remote_name_len, p_btif_cb->device_type );
btif_dm_update_ble_remote_properties( p_btif_cb->bd_addr.address, bdname.name,
p_btif_cb->device_type);
static void btif_gattc_upstreams_evt(uint16_t event, char* p_param)
{
- BTIF_TRACE_EVENT("%s: Event %d", __FUNCTION__, event);
+ LOG_DEBUG("%s: Event %d", __FUNCTION__, event);
tBTA_GATTC *p_data = (tBTA_GATTC*) p_param;
switch (event)
}
case BTA_GATTC_ACL_EVT:
- BTIF_TRACE_EVENT("BTA_GATTC_ACL_EVT: status = %d", p_data->status);
+ LOG_DEBUG("BTA_GATTC_ACL_EVT: status = %d", p_data->status);
/* Ignore for now */
break;
}
default:
- BTIF_TRACE_ERROR("%s: Unhandled event (%d)!", __FUNCTION__, event);
+ LOG_ERROR("%s: Unhandled event (%d)!", __FUNCTION__, event);
break;
}
btif_gattc_cb_t* p_cb = (btif_gattc_cb_t*) p_param;
if (!p_cb) return;
- BTIF_TRACE_EVENT("%s: Event %d", __FUNCTION__, event);
+ LOG_DEBUG("%s: Event %d", __FUNCTION__, event);
switch (event)
{
}
default:
- BTIF_TRACE_ERROR("%s: Unknown filter type (%d)!", __FUNCTION__, p_cb->action);
+ LOG_ERROR("%s: Unknown filter type (%d)!", __FUNCTION__, p_cb->action);
break;
}
break;
}
default:
- BTIF_TRACE_ERROR("%s: Unknown event (%d)!", __FUNCTION__, event);
+ LOG_ERROR("%s: Unknown event (%d)!", __FUNCTION__, event);
break;
}
}
#include "btif_gatt.h"
#include "btif_gatt_util.h"
+#include "osi/include/log.h"
/************************************************************************************
** Constants & Macros
#define CHECK_BTGATT_INIT() if (bt_gatt_callbacks == NULL)\
{\
- ALOGW("%s: BTGATT not initialized", __FUNCTION__);\
+ LOG_WARN("%s: BTGATT not initialized", __FUNCTION__);\
return BT_STATUS_NOT_READY;\
} else {\
- ALOGD("%s", __FUNCTION__);\
+ LOG_DEBUG("%s", __FUNCTION__);\
}
static void btapp_gatts_handle_cback(uint16_t event, char* p_param)
{
- ALOGD("%s: Event %d", __FUNCTION__, event);
+ LOG_DEBUG("%s: Event %d", __FUNCTION__, event);
tBTA_GATTS *p_data = (tBTA_GATTS*)p_param;
switch (event)
case BTA_GATTS_OPEN_EVT:
case BTA_GATTS_CANCEL_OPEN_EVT:
case BTA_GATTS_CLOSE_EVT:
- ALOGD("%s: Empty event (%d)!", __FUNCTION__, event);
+ LOG_DEBUG("%s: Empty event (%d)!", __FUNCTION__, event);
break;
default:
- ALOGE("%s: Unhandled event (%d)!", __FUNCTION__, event);
+ LOG_ERROR("%s: Unhandled event (%d)!", __FUNCTION__, event);
break;
}
btif_gatts_cb_t* p_cb = (btif_gatts_cb_t*)p_param;
if (!p_cb) return;
- ALOGD("%s: Event %d", __FUNCTION__, event);
+ LOG_DEBUG("%s: Event %d", __FUNCTION__, event);
switch (event)
{
}
default:
- ALOGE("%s: Unknown event (%d)!", __FUNCTION__, event);
+ LOG_ERROR("%s: Unknown event (%d)!", __FUNCTION__, event);
break;
}
}
#include "btif_dm.h"
#include "gatt_api.h"
+#include "osi/include/log.h"
/*******************************************************************************
* Typedefs & Macros
UNUSED(reason);
UNUSED (transport);
- ALOGD("%s: conn_id=%d, connected=%d", __FUNCTION__, conn_id, connected);
+ LOG_DEBUG("%s: conn_id=%d, connected=%d", __FUNCTION__, conn_id, connected);
test_cb.conn_id = connected ? conn_id : 0;
}
static void btif_test_command_complete_cback(UINT16 conn_id, tGATTC_OPTYPE op,
tGATT_STATUS status, tGATT_CL_COMPLETE *p_data)
{
- ALOGD ("%s: op_code=0x%02x, conn_id=0x%x. status=0x%x",
+ LOG_DEBUG ("%s: op_code=0x%02x, conn_id=0x%x. status=0x%x",
__FUNCTION__, op, conn_id, status);
switch (op)
break;
default:
- ALOGD ("%s: Unknown op_code (0x%02x)", __FUNCTION__, op);
+ LOG_DEBUG ("%s: Unknown op_code (0x%02x)", __FUNCTION__, op);
break;
}
}
char str_buf[50];
UNUSED(conn_id);
- ALOGD("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
- ALOGD(" Attribute handle: 0x%04x (%d)", p_data->handle, p_data->handle);
+ LOG_DEBUG("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
+ LOG_DEBUG(" Attribute handle: 0x%04x (%d)", p_data->handle, p_data->handle);
if (disc_type != GATT_DISC_CHAR_DSCPT) {
- ALOGD(" Attribute type: %s", format_uuid(p_data->type, str_buf));
+ LOG_DEBUG(" Attribute type: %s", format_uuid(p_data->type, str_buf));
}
switch (disc_type)
{
case GATT_DISC_SRVC_ALL:
- ALOGD(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
+ LOG_DEBUG(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
p_data->handle, p_data->value.group_value.e_handle,
p_data->handle, p_data->value.group_value.e_handle);
- ALOGD(" Service UUID: %s",
+ LOG_DEBUG(" Service UUID: %s",
format_uuid(p_data->value.group_value.service_type, str_buf));
break;
case GATT_DISC_SRVC_BY_UUID:
- ALOGD(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
+ LOG_DEBUG(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
p_data->handle, p_data->value.handle,
p_data->handle, p_data->value.handle);
break;
case GATT_DISC_INC_SRVC:
- ALOGD(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
+ LOG_DEBUG(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
p_data->value.incl_service.s_handle, p_data->value.incl_service.e_handle,
p_data->value.incl_service.s_handle, p_data->value.incl_service.e_handle);
- ALOGD(" Service UUID: %s",
+ LOG_DEBUG(" Service UUID: %s",
format_uuid(p_data->value.incl_service.service_type, str_buf));
break;
case GATT_DISC_CHAR:
- ALOGD(" Properties: 0x%02x",
+ LOG_DEBUG(" Properties: 0x%02x",
p_data->value.dclr_value.char_prop);
- ALOGD(" Characteristic UUID: %s",
+ LOG_DEBUG(" Characteristic UUID: %s",
format_uuid(p_data->value.dclr_value.char_uuid, str_buf));
break;
case GATT_DISC_CHAR_DSCPT:
- ALOGD(" Descriptor UUID: %s", format_uuid(p_data->type, str_buf));
+ LOG_DEBUG(" Descriptor UUID: %s", format_uuid(p_data->type, str_buf));
break;
}
- ALOGD("-----------------------------------------------------------");
+ LOG_DEBUG("-----------------------------------------------------------");
}
static void btif_test_discovery_complete_cback(UINT16 conn_id,
{
UNUSED(conn_id);
UNUSED(disc_type);
- ALOGD("%s: status=%d", __FUNCTION__, status);
+ LOG_DEBUG("%s: status=%d", __FUNCTION__, status);
}
static tGATT_CBACK btif_test_callbacks =
switch(command) {
case 0x01: /* Enable */
{
- ALOGD("%s: ENABLE - enable=%d", __FUNCTION__, params->u1);
+ LOG_DEBUG("%s: ENABLE - enable=%d", __FUNCTION__, params->u1);
if (params->u1)
{
tBT_UUID app_uuid = {LEN_UUID_128,{0xAE}};
case 0x02: /* Connect */
{
- ALOGD("%s: CONNECT - device=%02x:%02x:%02x:%02x:%02x:%02x (dev_type=%d, addr_type=%d)",
+ LOG_DEBUG("%s: CONNECT - device=%02x:%02x:%02x:%02x:%02x:%02x (dev_type=%d, addr_type=%d)",
__FUNCTION__,
params->bda1->address[0], params->bda1->address[1],
params->bda1->address[2], params->bda1->address[3],
if ( !GATT_Connect(test_cb.gatt_if, params->bda1->address, TRUE, BT_TRANSPORT_LE) )
{
- ALOGE("%s: GATT_Connect failed!", __FUNCTION__);
+ LOG_ERROR("%s: GATT_Connect failed!", __FUNCTION__);
}
break;
}
case 0x03: /* Disconnect */
{
- ALOGD("%s: DISCONNECT - conn_id=%d", __FUNCTION__, test_cb.conn_id);
+ LOG_DEBUG("%s: DISCONNECT - conn_id=%d", __FUNCTION__, test_cb.conn_id);
GATT_Disconnect(test_cb.conn_id);
break;
}
if (params->u1 >= GATT_DISC_MAX)
{
- ALOGE("%s: DISCOVER - Invalid type (%d)!", __FUNCTION__, params->u1);
+ LOG_ERROR("%s: DISCOVER - Invalid type (%d)!", __FUNCTION__, params->u1);
return 0;
}
param.e_handle = params->u3;
btif_to_bta_uuid(¶m.service, params->uuid1);
- ALOGD("%s: DISCOVER (%s), conn_id=%d, uuid=%s, handles=0x%04x-0x%04x",
+ LOG_DEBUG("%s: DISCOVER (%s), conn_id=%d, uuid=%s, handles=0x%04x-0x%04x",
__FUNCTION__, disc_name[params->u1], test_cb.conn_id,
format_uuid(param.service, buf), params->u2, params->u3);
GATTC_Discover(test_cb.conn_id, params->u1, ¶m);
}
case 0xF0: /* Pairing configuration */
- ALOGD("%s: Setting pairing config auth=%d, iocaps=%d, keys=%d/%d/%d",
+ LOG_DEBUG("%s: Setting pairing config auth=%d, iocaps=%d, keys=%d/%d/%d",
__FUNCTION__, params->u1, params->u2, params->u3, params->u4,
params->u5);
break;
default:
- ALOGE("%s: UNKNOWN TEST COMMAND 0x%02x", __FUNCTION__, command);
+ LOG_ERROR("%s: UNKNOWN TEST COMMAND 0x%02x", __FUNCTION__, command);
break;
}
return 0;
break;
default:
- ALOGE("%s: Unknown UUID length %d!", __FUNCTION__, p_dest->len);
+ LOG_ERROR("%s: Unknown UUID length %d!", __FUNCTION__, p_dest->len);
break;
}
}
break;
default:
- ALOGE("%s: Unknown UUID length %d!", __FUNCTION__, p_src->len);
+ LOG_ERROR("%s: Unknown UUID length %d!", __FUNCTION__, p_src->len);
break;
}
}
default:
if (( p_src->status == BTA_GATT_OK ) &&(p_src->p_value != NULL))
{
- ALOGI("%s unformat.len = %d ", __FUNCTION__, p_src->p_value->unformat.len);
+ LOG_INFO("%s unformat.len = %d ", __FUNCTION__, p_src->p_value->unformat.len);
p_dest->value.len = p_src->p_value->unformat.len;
if ( p_src->p_value->unformat.len > 0 && p_src->p_value->unformat.p_value != NULL )
{
#include "btif_hh.h"
#include "gki.h"
#include "l2c_api.h"
-
+#include "osi/include/log.h"
#define BTIF_HH_APP_ID_MI 0x01
#define BTIF_HH_APP_ID_KB 0x02
btif_hh_device_t *p_dev;
btif_hh_added_device_t *p_added_dev;
- ALOGI("%s: bda = %02x:%02x:%02x:%02x:%02x:%02x", __FUNCTION__,
+ LOG_INFO("%s: bda = %02x:%02x:%02x:%02x:%02x:%02x", __FUNCTION__,
bd_addr.address[0], bd_addr.address[1], bd_addr.address[2], bd_addr.address[3], bd_addr.address[4], bd_addr.address[5]);
for (i = 0; i < BTIF_HH_MAX_ADDED_DEV; i++) {
return;
}
if (p_dev->fd < 0) {
- ALOGE("BTA_HH_GET_DSCP_EVT: Error, failed to find the uhid driver...");
+ LOG_ERROR("BTA_HH_GET_DSCP_EVT: Error, failed to find the uhid driver...");
return;
}
{
break;
case BTA_HH_API_ERR_EVT :
- ALOGI("BTA_HH API_ERR");
+ LOG_INFO("BTA_HH API_ERR");
break;
dscp_info.descriptor.dsc_list = (UINT8 *) GKI_getbuf(dscp_info.descriptor.dl_len);
if (dscp_info.descriptor.dsc_list == NULL)
{
- ALOGE("%s: Failed to allocate DSCP for CB", __FUNCTION__);
+ LOG_ERROR("%s: Failed to allocate DSCP for CB", __FUNCTION__);
return BT_STATUS_FAIL;
}
memcpy(dscp_info.descriptor.dsc_list, &(hid_info.dsc_list), hid_info.dl_len);
memset(hexbuf, 0, len);
//TODO
hex_bytes_filled = ascii_2_hex(report, len, hexbuf);
- BTIF_TRACE_DEBUG("Hex bytes filled, hex value: %d", hex_bytes_filled);
+ LOG_INFO("Hex bytes filled, hex value: %d", hex_bytes_filled);
if (hex_bytes_filled) {
BT_HDR* p_buf = create_pbuf(hex_bytes_filled, hexbuf);
if (p_buf == NULL) {
#include <assert.h>
#include <ctype.h>
-#include <cutils/log.h>
#include <cutils/sockets.h>
#include <errno.h>
#include <fcntl.h>
#include "gki.h"
#include "list.h"
#include "mca_api.h"
+#include "osi/include/log.h"
#define MAX_DATATYPE_SUPPORTED 8
BTIF_TRACE_DEBUG("%s", __FUNCTION__);
soc_queue = list_new(NULL);
if (soc_queue == NULL)
- ALOGE("%s unable to allocate resources for thread", __func__);
+ LOG_ERROR("%s unable to allocate resources for thread", __func__);
select_thread_id = create_thread(btif_hl_select_thread, NULL);
}
/*******************************************************************************
#include "btif_pan_internal.h"
#include "gki.h"
#include "osi.h"
+#include "osi/include/log.h"
#define FORWARD_IGNORE 1
#define FORWARD_SUCCESS 0
memcpy(packet, ð_hdr, sizeof(tETH_HDR));
if(len > 2000)
{
- ALOGE("btpan_tap_send eth packet size:%d is exceeded limit!", len);
+ LOG_ERROR("btpan_tap_send eth packet size:%d is exceeded limit!", len);
return -1;
}
memcpy(packet + sizeof(tETH_HDR), buf, len);
bt_status_t status;
btpan_conn_t *conn = btpan_find_conn_handle(p_data->open.handle);
- ALOGV("%s pan connection open status: %d", __func__, p_data->open.status);
+ LOG_VERBOSE("%s pan connection open status: %d", __func__, p_data->open.status);
if(p_data->open.status == BTA_PAN_SUCCESS)
{
state = BTPAN_STATE_CONNECTED;
{
btpan_conn_t* conn = btpan_find_conn_handle(p_data->close.handle);
- ALOGI("%s: event = BTA_PAN_CLOSE_EVT handle %d", __FUNCTION__, p_data->close.handle);
+ LOG_INFO("%s: event = BTA_PAN_CLOSE_EVT handle %d", __FUNCTION__, p_data->close.handle);
if(conn && conn->handle >= 0)
{
#include "btif_sock_thread.h"
#include "btif_util.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "thread.h"
static bt_status_t btsock_listen(btsock_type_t type, const char *service_name, const uint8_t *uuid, int channel, int *sock_fd, int flags);
btsock_thread_init();
thread_handle = btsock_thread_create(btsock_signaled, NULL);
if (thread_handle == -1) {
- ALOGE("%s unable to create btsock_thread.", __func__);
+ LOG_ERROR("%s unable to create btsock_thread.", __func__);
goto error;
}
bt_status_t status = btsock_rfc_init(thread_handle);
if (status != BT_STATUS_SUCCESS) {
- ALOGE("%s error initializing RFCOMM sockets: %d", __func__, status);
+ LOG_ERROR("%s error initializing RFCOMM sockets: %d", __func__, status);
goto error;
}
thread = thread_new("btif_sock");
if (!thread) {
- ALOGE("%s error creating new thread.", __func__);
+ LOG_ERROR("%s error creating new thread.", __func__);
btsock_rfc_cleanup();
goto error;
}
status = btsock_sco_init(thread);
if (status != BT_STATUS_SUCCESS) {
- ALOGE("%s error initializing SCO sockets: %d", __func__, status);
+ LOG_ERROR("%s error initializing SCO sockets: %d", __func__, status);
btsock_rfc_cleanup();
goto error;
}
break;
default:
- ALOGE("%s unknown/unsupported socket type: %d", __func__, type);
+ LOG_ERROR("%s unknown/unsupported socket type: %d", __func__, type);
status = BT_STATUS_UNSUPPORTED;
break;
}
break;
default:
- ALOGE("%s unknown/unsupported socket type: %d", __func__, type);
+ LOG_ERROR("%s unknown/unsupported socket type: %d", __func__, type);
status = BT_STATUS_UNSUPPORTED;
break;
}
#define LOG_TAG "btif_sock_rfcomm"
#include <assert.h>
-#include <cutils/log.h>
#include <errno.h>
#include <hardware/bluetooth.h>
#include <hardware/bt_sock.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
-#include <utils/Log.h>
#include "bta_api.h"
#include "bt_target.h"
#include "hcimsgs.h"
#include "list.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "port_api.h"
#include "sdp_api.h"
if (rfc_slots[i].id == id)
return &rfc_slots[i];
- ALOGE("%s unable to find RFCOMM slot id: %d", __func__, id);
+ LOG_ERROR("%s unable to find RFCOMM slot id: %d", __func__, id);
return NULL;
}
rfc_slot_t *slot = find_free_slot();
if (!slot) {
- ALOGE("%s unable to find free RFCOMM slot.", __func__);
+ LOG_ERROR("%s unable to find free RFCOMM slot.", __func__);
return NULL;
}
int fds[2] = { INVALID_FD, INVALID_FD };
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, fds) == -1) {
- ALOGE("%s error creating socketpair: %s", __func__, strerror(errno));
+ LOG_ERROR("%s error creating socketpair: %s", __func__, strerror(errno));
return NULL;
}
static rfc_slot_t *create_srv_accept_rfc_slot(rfc_slot_t *srv_rs, const bt_bdaddr_t *addr, int open_handle, int new_listen_handle) {
rfc_slot_t *accept_rs = alloc_rfc_slot(addr, srv_rs->service_name, srv_rs->service_uuid, srv_rs->scn, 0, false);
if (!accept_rs) {
- ALOGE("%s unable to allocate RFCOMM slot.", __func__);
+ LOG_ERROR("%s unable to allocate RFCOMM slot.", __func__);
return NULL;
}
rfc_slot_t *slot = alloc_rfc_slot(NULL, service_name, service_uuid, channel, flags, true);
if (!slot) {
- ALOGE("%s unable to allocate RFCOMM slot.", __func__);
+ LOG_ERROR("%s unable to allocate RFCOMM slot.", __func__);
goto out;
}
rfc_slot_t *slot = alloc_rfc_slot(bd_addr, NULL, service_uuid, channel, flags, false);
if (!slot) {
- ALOGE("%s unable to allocate RFCOMM slot.", __func__);
+ LOG_ERROR("%s unable to allocate RFCOMM slot.", __func__);
goto out;
}
if (is_uuid_empty(service_uuid)) {
tBTA_JV_STATUS ret = BTA_JvRfcommConnect(slot->security, slot->role, slot->scn, slot->addr.address, rfcomm_cback, (void *)(uintptr_t)slot->id);
if (ret != BTA_JV_SUCCESS) {
- ALOGE("%s unable to initiate RFCOMM connection: %d", __func__, ret);
+ LOG_ERROR("%s unable to initiate RFCOMM connection: %d", __func__, ret);
cleanup_rfc_slot(slot);
goto out;
}
if (!send_app_scn(slot)) {
- ALOGE("%s unable to send channel number.", __func__);
+ LOG_ERROR("%s unable to send channel number.", __func__);
cleanup_rfc_slot(slot);
goto out;
}
static int create_server_sdp_record(rfc_slot_t *slot) {
if (slot->scn > 0) {
if (!BTM_TryAllocateSCN(slot->scn)) {
- ALOGE("%s attempting to allocate fixed channel %d which is already in use.", __func__, slot->scn);
+ LOG_ERROR("%s attempting to allocate fixed channel %d which is already in use.", __func__, slot->scn);
return false;
}
} else if ((slot->scn = BTM_AllocateSCN()) == 0) {
- ALOGE("%s unable to allocate RFCOMM server channel.", __func__);
+ LOG_ERROR("%s unable to allocate RFCOMM server channel.", __func__);
return false;
}
slot->rfc_handle = p_start->handle;
if (!send_app_scn(slot)) {
- ALOGE("%s unable to send server channel number for slot %d.", __func__, slot->id);
+ LOG_ERROR("%s unable to send server channel number for slot %d.", __func__, slot->id);
cleanup_rfc_slot(slot);
}
} else
if (send_app_connect_signal(slot->fd, &slot->addr, slot->scn, 0, -1))
slot->f.connected = true;
else
- ALOGE("%s unable to send connect completion signal to caller.", __func__);
+ LOG_ERROR("%s unable to send connect completion signal to caller.", __func__);
out:;
unlock_slot(&slot_lock);
break;
default:
- ALOGE("%s unhandled event %d, slot id: %d", __func__, event, (uintptr_t)user_data);
+ LOG_ERROR("%s unhandled event %d, slot id: %d", __func__, event, (uintptr_t)user_data);
break;
}
return new_user_data;
}
} else if (slot) {
// TODO(sharvil): this is really a logic error and we should probably assert.
- ALOGE("%s SDP response returned but RFCOMM slot %d did not request SDP record.", __func__, id);
+ LOG_ERROR("%s SDP response returned but RFCOMM slot %d did not request SDP record.", __func__, id);
}
} else if (slot) {
cleanup_rfc_slot(slot);
if (sent == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
return SENT_NONE;
- ALOGE("%s error writing RFCOMM data back to app: %s", __func__, strerror(errno));
+ LOG_ERROR("%s error writing RFCOMM data back to app: %s", __func__, strerror(errno));
return SENT_FAILED;
}
if (!(flags & SOCK_THREAD_FD_EXCEPTION) || (ioctl(slot->fd, FIONREAD, &size) == 0 && size))
BTA_JvRfcommWrite(slot->rfc_handle, slot->id);
} else {
- ALOGE("%s socket signaled for read while disconnected, slot: %d, channel: %d", __func__, slot->id, slot->scn);
+ LOG_ERROR("%s socket signaled for read while disconnected, slot: %d, channel: %d", __func__, slot->id, slot->scn);
need_close = true;
}
}
if (flags & SOCK_THREAD_FD_WR) {
// App is ready to receive more data, tell stack to enable data flow.
if (!slot->f.connected || !flush_incoming_que_on_wr_signal(slot)) {
- ALOGE("%s socket signaled for write while disconnected (or write failure), slot: %d, channel: %d", __func__, slot->id, slot->scn);
+ LOG_ERROR("%s socket signaled for write while disconnected (or write failure), slot: %d, channel: %d", __func__, slot->id, slot->scn);
need_close = true;
}
}
if (ioctl(slot->fd, FIONREAD, size) == 0) {
ret = true;
} else {
- ALOGE("%s unable to determine bytes remaining to be read on fd %d: %s", __func__, slot->fd, strerror(errno));
+ LOG_ERROR("%s unable to determine bytes remaining to be read on fd %d: %s", __func__, slot->fd, strerror(errno));
cleanup_rfc_slot(slot);
}
if(received == size) {
ret = true;
} else {
- ALOGE("%s error receiving RFCOMM data from app: %s", __func__, strerror(errno));
+ LOG_ERROR("%s error receiving RFCOMM data from app: %s", __func__, strerror(errno));
cleanup_rfc_slot(slot);
}
#include <hardware/bt_sock.h>
#include <sys/socket.h>
#include <sys/types.h>
-#include <utils/Log.h>
#include "btif_common.h"
#include "list.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "socket.h"
#include "thread.h"
sco_socket_t *sco_socket = NULL;
if (socketpair(AF_LOCAL, SOCK_STREAM, 0, pair) == -1) {
- ALOGE("%s unable to allocate socket pair: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to allocate socket pair: %s", __func__, strerror(errno));
goto error;
}
sco_socket = sco_socket_new();
if (!sco_socket) {
- ALOGE("%s unable to allocate new SCO socket.", __func__);
+ LOG_ERROR("%s unable to allocate new SCO socket.", __func__);
goto error;
}
tBTM_STATUS status = BTM_CreateSco((uint8_t *)bd_addr, !is_listening, sco_parameters.packet_types, &sco_socket->sco_handle, connect_completed_cb, disconnect_completed_cb);
if (status != BTM_CMD_STARTED) {
- ALOGE("%s unable to create SCO socket: %d", __func__, status);
+ LOG_ERROR("%s unable to create SCO socket: %d", __func__, status);
goto error;
}
socket_t *socket = socket_new_from_fd(pair[1]);
if (!socket) {
- ALOGE("%s unable to allocate socket from file descriptor %d.", __func__, pair[1]);
+ LOG_ERROR("%s unable to allocate socket from file descriptor %d.", __func__, pair[1]);
goto error;
}
int client_fd = INVALID_FD;
if (!sco_socket) {
- ALOGE("%s unable to find sco_socket for handle: %hu", __func__, conn_data->sco_inx);
+ LOG_ERROR("%s unable to find sco_socket for handle: %hu", __func__, conn_data->sco_inx);
goto error;
}
if (sco_socket != listen_sco_socket) {
- ALOGE("%s received connection request on non-listening socket handle: %hu", __func__, conn_data->sco_inx);
+ LOG_ERROR("%s received connection request on non-listening socket handle: %hu", __func__, conn_data->sco_inx);
goto error;
}
sco_socket_t *new_sco_socket = sco_socket_establish_locked(true, NULL, &client_fd);
if (!new_sco_socket) {
- ALOGE("%s unable to allocate new sco_socket.", __func__);
+ LOG_ERROR("%s unable to allocate new sco_socket.", __func__);
goto error;
}
connect_signal.status = 0;
if (socket_write_and_transfer_fd(sco_socket->socket, &connect_signal, sizeof(connect_signal), client_fd) != sizeof(connect_signal)) {
- ALOGE("%s unable to send new file descriptor to listening socket.", __func__);
+ LOG_ERROR("%s unable to send new file descriptor to listening socket.", __func__);
goto error;
}
sco_socket_t *sco_socket = sco_socket_find_locked(sco_handle);
if (!sco_socket) {
- ALOGE("%s SCO socket not found on connect for handle: %hu", __func__, sco_handle);
+ LOG_ERROR("%s SCO socket not found on connect for handle: %hu", __func__, sco_handle);
goto out;
}
sco_socket_t *sco_socket = sco_socket_find_locked(sco_handle);
if (!sco_socket) {
- ALOGE("%s SCO socket not found on disconnect for handle: %hu", __func__, sco_handle);
+ LOG_ERROR("%s SCO socket not found on disconnect for handle: %hu", __func__, sco_handle);
goto out;
}
#include <hardware/bluetooth.h>
#include <hardware/bt_sock.h>
-#include <cutils/log.h>
#include "btif_common.h"
#include "btif_util.h"
#include "btif_sock_thread.h"
#include "btif_sock_util.h"
-#include <cutils/log.h>
#define asrt(s) if(!(s)) APPL_TRACE_ERROR("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
#define print_events(events) do { \
APPL_TRACE_DEBUG("print poll event:%x", events); \
#include "bta_jv_api.h"
#include "bta_jv_co.h"
#include "port_api.h"
+#include "osi/include/log.h"
#define asrt(s) if(!(s)) BTIF_TRACE_ERROR("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
char *line;
int i, j, addr;
const int width = 16;
- ALOGD("%s, size:%d, dump started {", title, size);
+ LOG_DEBUG("%s, size:%d, dump started {", title, size);
if(size <= 0)
return;
//write offset
//output the line
PRINT(line_buff);
}
- ALOGD("%s, size:%d, dump ended }", title, size);
+ LOG_DEBUG("%s, size:%d, dump ended }", title, size);
}
#include "osi.h"
#include "bta_hh_api.h"
#include "btif_hh.h"
-
-#include <cutils/log.h>
+#include "osi/include/log.h"
/************************************************************************************
** Constants & Macros
config_t *config = config_new(BTIF_AUTO_PAIR_CONF_FILE);
if (!config) {
- ALOGE("%s failed to open auto pair blacklist conf file '%s'.", __func__, BTIF_AUTO_PAIR_CONF_FILE);
+ LOG_ERROR("%s failed to open auto pair blacklist conf file '%s'.", __func__, BTIF_AUTO_PAIR_CONF_FILE);
return BT_STATUS_FAIL;
}
#define LOG_TAG "bt_stack_manager"
#include <hardware/bluetooth.h>
-#include <utils/Log.h>
#include "btif_api.h"
#include "btif_common.h"
#include "device/include/controller.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "semaphore.h"
#include "stack_manager.h"
#include "thread.h"
static void ensure_stack_is_initialized(void) {
if (!stack_is_initialized) {
- ALOGW("%s found the stack was uninitialized. Initializing now.", __func__);
+ LOG_WARN("%s found the stack was uninitialized. Initializing now.", __func__);
// No semaphore needed since we are calling it directly
event_init_stack(NULL);
}
// Synchronous function to start up the stack
static void event_start_up_stack(UNUSED_ATTR void *context) {
if (stack_is_running) {
- ALOGD("%s stack already brought up.", __func__);
+ LOG_DEBUG("%s stack already brought up.", __func__);
return;
}
ensure_stack_is_initialized();
- ALOGD("%s is bringing up the stack.", __func__);
+ LOG_DEBUG("%s is bringing up the stack.", __func__);
hack_future = future_new();
// Include this for now to put btif config into a shutdown-able state
}
stack_is_running = true;
- ALOGD("%s finished", __func__);
+ LOG_DEBUG("%s finished", __func__);
btif_thread_post(event_signal_stack_up, NULL);
}
// Synchronous function to shut down the stack
static void event_shut_down_stack(UNUSED_ATTR void *context) {
if (!stack_is_running) {
- ALOGD("%s stack is already brought down.", __func__);
+ LOG_DEBUG("%s stack is already brought down.", __func__);
return;
}
- ALOGD("%s is bringing down the stack.", __func__);
+ LOG_DEBUG("%s is bringing down the stack.", __func__);
hack_future = future_new();
stack_is_running = false;
future_await(hack_future);
module_shut_down(get_module(CONTROLLER_MODULE)); // Doesn't do any work, just puts it in a restartable state
- ALOGD("%s finished.", __func__);
+ LOG_DEBUG("%s finished.", __func__);
btif_thread_post(event_signal_stack_down, NULL);
}
static void ensure_stack_is_not_running(void) {
if (stack_is_running) {
- ALOGW("%s found the stack was still running. Bringing it down now.", __func__);
+ LOG_WARN("%s found the stack was still running. Bringing it down now.", __func__);
event_shut_down_stack(NULL);
}
}
// Synchronous function to clean up the stack
static void event_clean_up_stack(UNUSED_ATTR void *context) {
if (!stack_is_initialized) {
- ALOGD("%s found the stack already in a clean state.", __func__);
+ LOG_DEBUG("%s found the stack already in a clean state.", __func__);
return;
}
ensure_stack_is_not_running();
- ALOGD("%s is cleaning up the stack.", __func__);
+ LOG_DEBUG("%s is cleaning up the stack.", __func__);
hack_future = future_new();
stack_is_initialized = false;
future_await(hack_future);
module_management_stop();
- ALOGD("%s finished.", __func__);
+ LOG_DEBUG("%s finished.", __func__);
}
static void event_signal_stack_up(UNUSED_ATTR void *context) {
management_thread = thread_new("stack_manager");
if (!management_thread) {
- ALOGE("%s unable to create stack management thread.", __func__);
+ LOG_ERROR("%s unable to create stack management thread.", __func__);
return;
}
}
#include <assert.h>
#include <stdbool.h>
-#include <utils/Log.h>
#include "bdaddr.h"
#include "bt_types.h"
* limitations under the License.
*
******************************************************************************/
-#include <cutils/log.h>
#include "allocator.h"
#include "gki_int.h"
******************************************************************************/
#include <assert.h>
-#include <utils/Log.h>
#include "gki_int.h"
+#include "osi/include/log.h"
#define GKI_NO_NEW_TMRS_STARTED (0x7fffffffL) /* Largest signed positive timer count */
{
// When using alarms from AlarmService we should
// always have work to be done here.
- ALOGE("%s no work to be done when expected work", __func__);
+ LOG_ERROR("%s no work to be done when expected work", __func__);
gki_cb.com.timer_nesting = 0;
return;
}
#include <hardware/bluetooth.h>
#include <sys/prctl.h>
#include <sys/times.h>
-#include <utils/Log.h>
#include "alarm.h"
#include "bt_utils.h"
#include "gki_int.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
/*****************************************************************************
** Constants & Macros
if (alarm_ticks > 0)
alarm_set(alarm_timer, GKI_TICKS_TO_MS(alarm_ticks), bt_alarm_cb, NULL);
else
- ALOGV("%s no more alarms.", __func__);
+ LOG_VERBOSE("%s no more alarms.", __func__);
}
static future_t *init(void)
void GKI_exception(UINT16 code, char *msg)
{
- ALOGE( "GKI_exception(): Task State Table");
+ LOG_ERROR( "GKI_exception(): Task State Table");
for (int task_id = 0; task_id < GKI_MAX_TASKS; task_id++)
{
- ALOGE( "TASK ID [%d] task name [%s] state [%d]",
+ LOG_ERROR( "TASK ID [%d] task name [%s] state [%d]",
task_id,
gki_cb.com.task_name[task_id],
gki_cb.com.task_state[task_id]);
}
- ALOGE("GKI_exception %d %s", code, msg);
- ALOGE( "********************************************************************");
- ALOGE( "* GKI_exception(): %d %s", code, msg);
- ALOGE( "********************************************************************");
+ LOG_ERROR("GKI_exception %d %s", code, msg);
+ LOG_ERROR( "********************************************************************");
+ LOG_ERROR( "* GKI_exception(): %d %s", code, msg);
+ LOG_ERROR( "********************************************************************");
GKI_TRACE("GKI_exception %d %s done", code, msg);
}
#define LOG_TAG "btsnoop"
#include <assert.h>
-#include <cutils/log.h>
#include <errno.h>
#include <fcntl.h>
#include <stdbool.h>
#include "btsnoop.h"
#include "bt_types.h"
#include "hci_layer.h"
+#include "osi/include/log.h"
#include "stack_config.h"
typedef enum {
logfile_fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
if (logfile_fd == INVALID_FD) {
- ALOGE("%s unable to open '%s': %s", __func__, path, strerror(errno));
+ LOG_ERROR("%s unable to open '%s': %s", __func__, path, strerror(errno));
return;
}
#define LOG_TAG "btsnoop_net"
#include <assert.h>
-#include <cutils/log.h>
#include <errno.h>
#include <netinet/in.h>
#include <pthread.h>
#include <sys/types.h>
#include "osi.h"
+#include "osi/include/log.h"
static void safe_close_(int *fd);
static void *listen_fn_(void *context);
void btsnoop_net_open() {
listen_thread_valid_ = (pthread_create(&listen_thread_, NULL, listen_fn_, NULL) == 0);
if (!listen_thread_valid_) {
- ALOGE("%s pthread_create failed: %s", __func__, strerror(errno));
+ LOG_ERROR("%s pthread_create failed: %s", __func__, strerror(errno));
} else {
- ALOGD("initialized");
+ LOG_DEBUG("initialized");
}
}
listen_socket_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (listen_socket_ == -1) {
- ALOGE("%s socket creation failed: %s", __func__, strerror(errno));
+ LOG_ERROR("%s socket creation failed: %s", __func__, strerror(errno));
goto cleanup;
}
int enable = 1;
if (setsockopt(listen_socket_, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) == -1) {
- ALOGE("%s unable to set SO_REUSEADDR: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to set SO_REUSEADDR: %s", __func__, strerror(errno));
goto cleanup;
}
addr.sin_addr.s_addr = htonl(LOCALHOST_);
addr.sin_port = htons(LISTEN_PORT_);
if (bind(listen_socket_, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- ALOGE("%s unable to bind listen socket: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to bind listen socket: %s", __func__, strerror(errno));
goto cleanup;
}
if (listen(listen_socket_, 10) == -1) {
- ALOGE("%s unable to listen: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to listen: %s", __func__, strerror(errno));
goto cleanup;
}
for (;;) {
- ALOGD("waiting for client connection");
int client_socket = accept(listen_socket_, NULL, NULL);
if (client_socket == -1) {
if (errno == EINVAL || errno == EBADF) {
break;
}
- ALOGW("%s error accepting socket: %s", __func__, strerror(errno));
+ LOG_WARN("%s error accepting socket: %s", __func__, strerror(errno));
continue;
}
/* When a new client connects, we have to send the btsnoop file header. This allows
a decoder to treat the session as a new, valid btsnoop file. */
- ALOGI("client connected");
pthread_mutex_lock(&client_socket_lock_);
safe_close_(&client_socket_);
client_socket_ = client_socket;
#define LOG_TAG "hci_hal_h4"
#include <assert.h>
-#include <utils/Log.h>
#include "eager_reader.h"
#include "hci_hal.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "reactor.h"
#include "vendor.h"
}
static bool hal_open() {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
// TODO(zachoverflow): close if already open / or don't reopen (maybe at the hci layer level)
int fd_array[CH_MAX];
int number_of_ports = vendor->send_command(VENDOR_OPEN_USERIAL, &fd_array);
if (number_of_ports != 1) {
- ALOGE("%s opened the wrong number of ports: got %d, expected 1.", __func__, number_of_ports);
+ LOG_ERROR("%s opened the wrong number of ports: got %d, expected 1.", __func__, number_of_ports);
goto error;
}
uart_fd = fd_array[0];
if (uart_fd == INVALID_FD) {
- ALOGE("%s unable to open the uart serial port.", __func__);
+ LOG_ERROR("%s unable to open the uart serial port.", __func__);
goto error;
}
uart_stream = eager_reader_new(uart_fd, &allocator_malloc, HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX, "hci_single_channel");
if (!uart_stream) {
- ALOGE("%s unable to create eager reader for the uart serial port.", __func__);
+ LOG_ERROR("%s unable to create eager reader for the uart serial port.", __func__);
goto error;
}
}
static void hal_close() {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
eager_reader_free(uart_stream);
vendor->send_command(VENDOR_CLOSE_USERIAL, NULL);
static size_t read_data(serial_data_type_t type, uint8_t *buffer, size_t max_size, bool block) {
if (type < DATA_TYPE_ACL || type > DATA_TYPE_EVENT) {
- ALOGE("%s invalid data type: %d", __func__, type);
+ LOG_ERROR("%s invalid data type: %d", __func__, type);
return 0;
} else if (!stream_has_interpretation) {
- ALOGE("%s with no valid stream intepretation.", __func__);
+ LOG_ERROR("%s with no valid stream intepretation.", __func__);
return 0;
} else if (current_data_type != type) {
- ALOGE("%s with different type than existing interpretation.", __func__);
+ LOG_ERROR("%s with different type than existing interpretation.", __func__);
return 0;
}
static void packet_finished(serial_data_type_t type) {
if (!stream_has_interpretation)
- ALOGE("%s with no existing stream interpretation.", __func__);
+ LOG_ERROR("%s with no existing stream interpretation.", __func__);
else if (current_data_type != type)
- ALOGE("%s with different type than existing interpretation.", __func__);
+ LOG_ERROR("%s with different type than existing interpretation.", __func__);
stream_has_interpretation = false;
}
assert(length > 0);
if (type < DATA_TYPE_COMMAND || type > DATA_TYPE_SCO) {
- ALOGE("%s invalid data type: %d", __func__, type);
+ LOG_ERROR("%s invalid data type: %d", __func__, type);
return 0;
}
ssize_t ret = write(uart_fd, data + transmitted_length, length);
switch (ret) {
case -1:
- ALOGE("In %s, error writing to the uart serial port: %s", __func__, strerror(errno));
+ LOG_ERROR("In %s, error writing to the uart serial port: %s", __func__, strerror(errno));
goto done;
case 0:
// If we wrote nothing, don't loop more because we
uint8_t type_byte;
eager_reader_read(reader, &type_byte, 1, true);
if (type_byte < DATA_TYPE_ACL || type_byte > DATA_TYPE_EVENT) {
- ALOGE("[h4] Unknown HCI message type. Dropping this byte 0x%x, min %x, max %x", type_byte, DATA_TYPE_ACL, DATA_TYPE_EVENT);
+ LOG_ERROR("[h4] Unknown HCI message type. Dropping this byte 0x%x, min %x, max %x", type_byte, DATA_TYPE_ACL, DATA_TYPE_EVENT);
return;
}
#define LOG_TAG "hci_hal_mct"
#include <assert.h>
-#include <utils/Log.h>
#include "bt_vendor_lib.h"
#include "eager_reader.h"
#include "hci_hal.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "reactor.h"
#include "vendor.h"
}
static bool hal_open() {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
// TODO(zachoverflow): close if already open / or don't reopen (maybe at the hci layer level)
int number_of_ports = vendor->send_command(VENDOR_OPEN_USERIAL, &uart_fds);
if (number_of_ports != 2 && number_of_ports != 4) {
- ALOGE("%s opened the wrong number of ports: got %d, expected 2 or 4.", __func__, number_of_ports);
+ LOG_ERROR("%s opened the wrong number of ports: got %d, expected 2 or 4.", __func__, number_of_ports);
goto error;
}
- ALOGI("%s got uart fds: CMD=%d, EVT=%d, ACL_OUT=%d, ACL_IN=%d",
+ LOG_INFO("%s got uart fds: CMD=%d, EVT=%d, ACL_OUT=%d, ACL_IN=%d",
__func__, uart_fds[CH_CMD], uart_fds[CH_EVT], uart_fds[CH_ACL_OUT], uart_fds[CH_ACL_IN]);
if (uart_fds[CH_CMD] == INVALID_FD) {
- ALOGE("%s unable to open the command uart serial port.", __func__);
+ LOG_ERROR("%s unable to open the command uart serial port.", __func__);
goto error;
}
if (uart_fds[CH_EVT] == INVALID_FD) {
- ALOGE("%s unable to open the event uart serial port.", __func__);
+ LOG_ERROR("%s unable to open the event uart serial port.", __func__);
goto error;
}
if (uart_fds[CH_ACL_OUT] == INVALID_FD) {
- ALOGE("%s unable to open the acl-out uart serial port.", __func__);
+ LOG_ERROR("%s unable to open the acl-out uart serial port.", __func__);
goto error;
}
if (uart_fds[CH_ACL_IN] == INVALID_FD) {
- ALOGE("%s unable to open the acl-in uart serial port.", __func__);
+ LOG_ERROR("%s unable to open the acl-in uart serial port.", __func__);
goto error;
}
event_stream = eager_reader_new(uart_fds[CH_EVT], &allocator_malloc, HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX, "hci_mct");
if (!event_stream) {
- ALOGE("%s unable to create eager reader for the event uart serial port.", __func__);
+ LOG_ERROR("%s unable to create eager reader for the event uart serial port.", __func__);
goto error;
}
acl_stream = eager_reader_new(uart_fds[CH_ACL_IN], &allocator_malloc, HCI_HAL_SERIAL_BUFFER_SIZE, SIZE_MAX, "hci_mct");
if (!event_stream) {
- ALOGE("%s unable to create eager reader for the acl-in uart serial port.", __func__);
+ LOG_ERROR("%s unable to create eager reader for the acl-in uart serial port.", __func__);
goto error;
}
}
static void hal_close() {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
+
eager_reader_free(event_stream);
eager_reader_free(acl_stream);
vendor->send_command(VENDOR_CLOSE_USERIAL, NULL);
return eager_reader_read(event_stream, buffer, max_size, block);
}
- ALOGE("%s invalid data type: %d", __func__, type);
+ LOG_ERROR("%s invalid data type: %d", __func__, type);
return 0;
}
return transmit_data_on(uart_fds[CH_CMD], data, length);
}
- ALOGE("%s invalid data type: %d", __func__, type);
+ LOG_ERROR("%s invalid data type: %d", __func__, type);
return 0;
}
ssize_t ret = write(fd, data + transmitted_length, length);
switch (ret) {
case -1:
- ALOGE("In %s, error writing to the serial port with fd %d: %s", __func__, fd, strerror(errno));
+ LOG_ERROR("In %s, error writing to the serial port with fd %d: %s", __func__, fd, strerror(errno));
return transmitted_length;
case 0:
// If we wrote nothing, don't loop more because we
#include <assert.h>
#include <errno.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "bt_types.h"
#include "hci_layer.h"
#include "list.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "socket.h"
#include "thread.h"
case HCI_PACKET_SCO_DATA:
return MSG_STACK_TO_HC_HCI_SCO;
default:
- ALOGE("%s unsupported packet type: %d", __func__, packet);
+ LOG_ERROR("%s unsupported packet type: %d", __func__, packet);
return -1;
}
}
client_t *client = (client_t *)osi_calloc(sizeof(client_t));
if (!client) {
- ALOGE("%s unable to allocate memory for client.", __func__);
+ LOG_ERROR("%s unable to allocate memory for client.", __func__);
socket_free(socket);
return;
}
client->socket = socket;
if (!list_append(clients, client)) {
- ALOGE("%s unable to add client to list.", __func__);
+ LOG_ERROR("%s unable to add client to list.", __func__);
client_free(client);
return;
}
memcpy(buf->data, buffer + 3, packet_len);
hci->transmit_downward(buf->event, buf);
} else {
- ALOGE("%s dropping injected packet of length %zu", __func__, packet_len);
+ LOG_ERROR("%s dropping injected packet of length %zu", __func__, packet_len);
}
size_t remainder = client->buffer_size - frame_len;
#include <assert.h>
#include <cutils/properties.h>
-#include <utils/Log.h>
#include "buffer_allocator.h"
#include "btsnoop.h"
#include "module.h"
#include "non_repeating_timer.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "packet_fragmenter.h"
#include "reactor.h"
#include "vendor.h"
// Module lifecycle functions
static future_t *start_up(void) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
// The host is only allowed to send at most one command initially,
// as per the Bluetooth spec, Volume 2, Part E, 4.4 (Command Flow Control)
startup_timer = non_repeating_timer_new(startup_timeout_ms, startup_timer_expired, NULL);
if (!startup_timer) {
- ALOGE("%s unable to create startup timer.", __func__);
+ LOG_ERROR("%s unable to create startup timer.", __func__);
goto error;
}
epilog_timer = non_repeating_timer_new(EPILOG_TIMEOUT_MS, epilog_timer_expired, NULL);
if (!epilog_timer) {
- ALOGE("%s unable to create epilog timer.", __func__);
+ LOG_ERROR("%s unable to create epilog timer.", __func__);
goto error;
}
command_response_timer = non_repeating_timer_new(COMMAND_PENDING_TIMEOUT, command_timed_out, NULL);
if (!command_response_timer) {
- ALOGE("%s unable to create command response timer.", __func__);
+ LOG_ERROR("%s unable to create command response timer.", __func__);
goto error;
}
command_queue = fixed_queue_new(SIZE_MAX);
if (!command_queue) {
- ALOGE("%s unable to create pending command queue.", __func__);
+ LOG_ERROR("%s unable to create pending command queue.", __func__);
goto error;
}
packet_queue = fixed_queue_new(SIZE_MAX);
if (!packet_queue) {
- ALOGE("%s unable to create pending packet queue.", __func__);
+ LOG_ERROR("%s unable to create pending packet queue.", __func__);
goto error;
}
thread = thread_new("hci_thread");
if (!thread) {
- ALOGE("%s unable to create thread.", __func__);
+ LOG_ERROR("%s unable to create thread.", __func__);
goto error;
}
commands_pending_response = list_new(NULL);
if (!commands_pending_response) {
- ALOGE("%s unable to create list for commands pending response.", __func__);
+ LOG_ERROR("%s unable to create list for commands pending response.", __func__);
goto error;
}
int power_state = BT_VND_PWR_OFF;
#if (defined (BT_CLEAN_TURN_ON_DISABLED) && BT_CLEAN_TURN_ON_DISABLED == TRUE)
- ALOGW("%s not turning off the chip before turning on.", __func__);
+ LOG_WARN("%s not turning off the chip before turning on.", __func__);
// So apparently this hack was needed in the past because a Wingray kernel driver
// didn't handle power off commands in a powered off state correctly.
vendor->send_command(VENDOR_CHIP_POWER_CONTROL, &power_state);
startup_future = future_new();
- ALOGD("%s starting async portion", __func__);
+ LOG_DEBUG("%s starting async portion", __func__);
thread_post(thread, event_finish_startup, NULL);
return startup_future;
error:;
}
static future_t *shut_down() {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
hci_inject->close();
// Interface functions
static void do_postload() {
- ALOGD("%s posting postload work item", __func__);
+ LOG_DEBUG("%s posting postload work item", __func__);
thread_post(thread, event_postload, NULL);
}
void *context) {
waiting_command_t *wait_entry = osi_calloc(sizeof(waiting_command_t));
if (!wait_entry) {
- ALOGE("%s couldn't allocate space for wait entry.", __func__);
+ LOG_ERROR("%s couldn't allocate space for wait entry.", __func__);
return;
}
if (type == MSG_STACK_TO_HC_HCI_CMD) {
// TODO(zachoverflow): eliminate this call
transmit_command((BT_HDR *)data, NULL, NULL, NULL);
- ALOGW("%s legacy transmit of command. Use transmit_command instead.", __func__);
+ LOG_WARN("%s legacy transmit of command. Use transmit_command instead.", __func__);
} else {
fixed_queue_enqueue(packet_queue, data);
}
// Start up functions
static void event_finish_startup(UNUSED_ATTR void *context) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
hal->open();
vendor->send_async_command(VENDOR_CONFIGURE_FIRMWARE, NULL);
}
static void firmware_config_callback(UNUSED_ATTR bool success) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
firmware_is_configured = true;
non_repeating_timer_cancel(startup_timer);
}
static void startup_timer_expired(UNUSED_ATTR void *context) {
- ALOGE("%s", __func__);
+ LOG_ERROR("%s", __func__);
future_ready(startup_future, FUTURE_FAIL);
startup_future = NULL;
}
// Postload functions
static void event_postload(UNUSED_ATTR void *context) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
if(vendor->send_async_command(VENDOR_CONFIGURE_SCO, NULL) == -1) {
// If couldn't configure sco, we won't get the sco configuration callback
// so go pretend to do it now
}
static void sco_config_callback(UNUSED_ATTR bool success) {
- ALOGI("%s postload finished.", __func__);
+ LOG_INFO("%s postload finished.", __func__);
}
// Epilog functions
}
static void epilog_finished_callback(UNUSED_ATTR bool success) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
thread_stop(thread);
}
static void epilog_timer_expired(UNUSED_ATTR void *context) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
thread_stop(thread);
}
pthread_mutex_lock(&commands_pending_response_lock);
if (list_is_empty(commands_pending_response)) {
- ALOGE("%s with no commands pending response", __func__);
+ LOG_ERROR("%s with no commands pending response", __func__);
} else {
waiting_command_t *wait_entry = list_front(commands_pending_response);
pthread_mutex_unlock(&commands_pending_response_lock);
// We shouldn't try to recover the stack from this command timeout.
// If it's caused by a software bug, fix it. If it's a hardware bug, fix it.
- ALOGE("%s hci layer timeout waiting for response to a command. opcode: 0x%x", __func__, wait_entry->opcode);
+ LOG_ERROR("%s hci layer timeout waiting for response to a command. opcode: 0x%x", __func__, wait_entry->opcode);
}
- ALOGE("%s restarting the bluetooth process.", __func__);
+ LOG_ERROR("%s restarting the bluetooth process.", __func__);
usleep(10000);
kill(getpid(), SIGKILL);
}
incoming->buffer = (BT_HDR *)buffer_allocator->alloc(buffer_size);
if (!incoming->buffer) {
- ALOGE("%s error getting buffer for incoming packet of type %d and size %d", __func__, type, buffer_size);
+ LOG_ERROR("%s error getting buffer for incoming packet of type %d and size %d", __func__, type, buffer_size);
// Can't read any more of this current packet, so jump out
incoming->state = incoming->bytes_remaining == 0 ? BRAND_NEW : IGNORE;
break;
break;
case FINISHED:
- ALOGE("%s the state machine should not have been left in the finished state.", __func__);
+ LOG_ERROR("%s the state machine should not have been left in the finished state.", __func__);
break;
}
wait_entry = get_waiting_command(opcode);
if (!wait_entry)
- ALOGW("%s command complete event with no matching command. opcode: 0x%x.", __func__, opcode);
+ LOG_WARN("%s command complete event with no matching command. opcode: 0x%x.", __func__, opcode);
else if (wait_entry->complete_callback)
wait_entry->complete_callback(packet, wait_entry->context);
else if (wait_entry->complete_future)
wait_entry = get_waiting_command(opcode);
if (!wait_entry)
- ALOGW("%s command status event with no matching command. opcode: 0x%x", __func__, opcode);
+ LOG_WARN("%s command status event with no matching command. opcode: 0x%x", __func__, opcode);
else if (wait_entry->status_callback)
wait_entry->status_callback(status, wait_entry->command, wait_entry->context);
else if (event == MSG_STACK_TO_HC_HCI_CMD)
return DATA_TYPE_COMMAND;
else
- ALOGE("%s invalid event type, could not translate 0x%x", __func__, event);
+ LOG_ERROR("%s invalid event type, could not translate 0x%x", __func__, event);
return 0;
}
// there's only one instance of the hci interface.
interface.upward_dispatcher = data_dispatcher_new("hci_layer");
if (!interface.upward_dispatcher) {
- ALOGE("%s could not create upward dispatcher.", __func__);
+ LOG_ERROR("%s could not create upward dispatcher.", __func__);
return;
}
#include <assert.h>
#include <stdint.h>
-#include <utils/Log.h>
#include "alarm.h"
#include "low_power_manager.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "thread.h"
#include "vendor.h"
idle_alarm = alarm_new();
if (!idle_alarm) {
- ALOGE("%s could not create idle alarm.", __func__);
+ LOG_ERROR("%s could not create idle alarm.", __func__);
}
reset_state();
static void post_command(low_power_command_t command) {
if (command > LPM_WAKE_DEASSERT) {
- ALOGE("%s unknown low power command %d", __func__, command);
+ LOG_ERROR("%s unknown low power command %d", __func__, command);
return;
}
static void enable(bool enable) {
if (state == LPM_DISABLING) {
if (enable)
- ALOGE("%s still processing prior disable request, cannot enable.", __func__);
+ LOG_ERROR("%s still processing prior disable request, cannot enable.", __func__);
else
- ALOGW("%s still processing prior disable request, ignoring new request to disable.", __func__);
+ LOG_WARN("%s still processing prior disable request, ignoring new request to disable.", __func__);
} else if (state == LPM_ENABLING) {
if (enable)
- ALOGE("%s still processing prior enable request, ignoring new request to enable.", __func__);
+ LOG_ERROR("%s still processing prior enable request, ignoring new request to enable.", __func__);
else
- ALOGW("%s still processing prior enable request, cannot disable.", __func__);
+ LOG_WARN("%s still processing prior enable request, cannot disable.", __func__);
} else if (state == LPM_ENABLED && enable) {
- ALOGI("%s already enabled.", __func__);
+ LOG_INFO("%s already enabled.", __func__);
} else if (state == LPM_DISABLED && !enable) {
- ALOGI("%s already disabled.", __func__);
+ LOG_INFO("%s already disabled.", __func__);
} else {
uint8_t command = enable ? BT_VND_LPM_ENABLE : BT_VND_LPM_DISABLE;
state = enable ? LPM_ENABLING : LPM_DISABLING;
#define LOG_TAG "hci_packet_fragmenter"
#include <assert.h>
-#include <utils/Log.h>
#include "buffer_allocator.h"
#include "device/include/controller.h"
#include "hci_layer.h"
#include "packet_fragmenter.h"
#include "osi.h"
+#include "osi/include/log.h"
#define APPLY_CONTINUATION_FLAG(handle) (((handle) & 0xCFFF) | 0x1000)
#define APPLY_START_FLAG(handle) (((handle) & 0xCFFF) | 0x2000)
if (boundary_flag == START_PACKET_BOUNDARY) {
if (partial_packet) {
- ALOGW("%s found unfinished packet for handle with start packet. Dropping old.", __func__);
+ LOG_WARN("%s found unfinished packet for handle with start packet. Dropping old.", __func__);
hash_map_erase(partial_packets, (void *)(uintptr_t)handle);
buffer_allocator->free(partial_packet);
uint16_t full_length = l2cap_length + L2CAP_HEADER_SIZE + HCI_ACL_PREAMBLE_SIZE;
if (full_length <= packet->len) {
if (full_length < packet->len)
- ALOGW("%s found l2cap full length %d less than the hci length %d.", __func__, l2cap_length, packet->len);
+ LOG_WARN("%s found l2cap full length %d less than the hci length %d.", __func__, l2cap_length, packet->len);
callbacks->reassembled(packet);
return;
buffer_allocator->free(packet);
} else {
if (!partial_packet) {
- ALOGW("%s got continuation for unknown packet. Dropping it.", __func__);
+ LOG_WARN("%s got continuation for unknown packet. Dropping it.", __func__);
buffer_allocator->free(packet);
return;
}
packet->offset = HCI_ACL_PREAMBLE_SIZE;
uint16_t projected_offset = partial_packet->offset + (packet->len - HCI_ACL_PREAMBLE_SIZE);
if (projected_offset > partial_packet->len) { // len stores the expected length
- ALOGW("%s got packet which would exceed expected length of %d. Truncating.", __func__, partial_packet->len);
+ LOG_WARN("%s got packet which would exceed expected length of %d. Truncating.", __func__, partial_packet->len);
packet->len = partial_packet->len - partial_packet->offset;
projected_offset = partial_packet->len;
}
#include <assert.h>
#include <dlfcn.h>
-#include <utils/Log.h>
#include "buffer_allocator.h"
#include "bt_vendor_lib.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "vendor.h"
#define LAST_VENDOR_OPCODE_VALUE VENDOR_DO_EPILOG
lib_handle = dlopen(VENDOR_LIBRARY_NAME, RTLD_NOW);
if (!lib_handle) {
- ALOGE("%s unable to open %s: %s", __func__, VENDOR_LIBRARY_NAME, dlerror());
+ LOG_ERROR("%s unable to open %s: %s", __func__, VENDOR_LIBRARY_NAME, dlerror());
goto error;
}
lib_interface = (bt_vendor_interface_t *)dlsym(lib_handle, VENDOR_LIBRARY_SYMBOL_NAME);
if (!lib_interface) {
- ALOGE("%s unable to find symbol %s in %s: %s", __func__, VENDOR_LIBRARY_SYMBOL_NAME, VENDOR_LIBRARY_NAME, dlerror());
+ LOG_ERROR("%s unable to find symbol %s in %s: %s", __func__, VENDOR_LIBRARY_SYMBOL_NAME, VENDOR_LIBRARY_NAME, dlerror());
goto error;
}
- ALOGI("alloc value %p", lib_callbacks.alloc);
+ LOG_INFO("alloc value %p", lib_callbacks.alloc);
int status = lib_interface->init(&lib_callbacks, (unsigned char *)local_bdaddr);
if (status) {
- ALOGE("%s unable to initialize vendor library: %d", __func__, status);
+ LOG_ERROR("%s unable to initialize vendor library: %d", __func__, status);
goto error;
}
// Called back from vendor library when the firmware configuration
// completes.
static void firmware_config_cb(bt_vendor_op_result_t result) {
- ALOGI("firmware callback");
+ LOG_INFO("firmware callback");
vendor_cb callback = callbacks[VENDOR_CONFIGURE_FIRMWARE];
assert(callback != NULL);
callback(result == BT_VND_OP_RESULT_SUCCESS);
// SCO configuration request. This should only happen during the
// postload process.
static void sco_config_cb(bt_vendor_op_result_t result) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
vendor_cb callback = callbacks[VENDOR_CONFIGURE_SCO];
assert(callback != NULL);
callback(result == BT_VND_OP_RESULT_SUCCESS);
// Called back from vendor library to indicate status of previous
// LPM enable/disable request.
static void low_power_mode_cb(bt_vendor_op_result_t result) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
vendor_cb callback = callbacks[VENDOR_SET_LPM_MODE];
assert(callback != NULL);
callback(result == BT_VND_OP_RESULT_SUCCESS);
{
uint8_t status = (result == BT_VND_OP_RESULT_SUCCESS) ? 0 : 1;
- ALOGI("sco_audiostate_cb(status: %d)",status);
+ LOG_INFO("sco_audiostate_cb(status: %d)",status);
}
// Called by vendor library when it needs an HCI buffer.
// completed. It is safe to call vendor_interface->cleanup() after
// this callback has been received.
static void epilog_cb(bt_vendor_op_result_t result) {
- ALOGI("%s", __func__);
+ LOG_INFO("%s", __func__);
vendor_cb callback = callbacks[VENDOR_DO_EPILOG];
assert(callback != NULL);
callback(result == BT_VND_OP_RESULT_SUCCESS);
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
-#include <utils/Log.h>
#include "hci_hal.h"
#include "osi.h"
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
-#include <utils/Log.h>
#include "hci_hal.h"
#include "osi.h"
extern "C" {
#include <stdint.h>
-#include <utils/Log.h>
#include "allocation_tracker.h"
#include "allocator.h"
extern "C" {
#include <stdint.h>
-#include <utils/Log.h>
#include "low_power_manager.h"
#include "osi.h"
extern "C" {
#include <stdint.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "device/include/controller.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include <utils/Log.h>
#include "bta_api.h"
#include "config.h"
+#include "osi/include/log.h"
#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
extern int btm_ble_tx_power[BTM_BLE_ADV_TX_POWER_MAX + 1];
{
assert(path != NULL);
- ALOGI("%s attempt to load ble stack conf from %s", __func__, path);
+ LOG_INFO("%s attempt to load ble stack conf from %s", __func__, path);
config_t *config = config_new(path);
if (!config) {
- ALOGI("%s file >%s< not found", __func__, path);
+ LOG_INFO("%s file >%s< not found", __func__, path);
return;
}
if(*ble_adv_tx_power) {
sscanf(ble_adv_tx_power, "%d,%d,%d,%d,%d", btm_ble_tx_power, btm_ble_tx_power + 1, btm_ble_tx_power + 2,
btm_ble_tx_power + 3, btm_ble_tx_power + 4);
- ALOGI("loaded btm_ble_tx_power: %d, %d, %d, %d, %d", (char)btm_ble_tx_power[0], (char)btm_ble_tx_power[1],
+ LOG_INFO("loaded btm_ble_tx_power: %d, %d, %d, %d, %d", (char)btm_ble_tx_power[0], (char)btm_ble_tx_power[1],
btm_ble_tx_power[2], btm_ble_tx_power[3], btm_ble_tx_power[4]);
}
config_free(config);
config_t *config = config_new(p_path);
if (!config) {
- ALOGE("%s unable to load DID config '%s'.", __func__, p_path);
+ LOG_ERROR("%s unable to load DID config '%s'.", __func__, p_path);
return;
}
snprintf(section_name, sizeof(section_name), "DID%d", i);
if (!config_has_section(config, section_name)) {
- ALOGD("%s no section named %s.", __func__, section_name);
+ LOG_DEBUG("%s no section named %s.", __func__, section_name);
break;
}
if (record.vendor_id_source != DI_VENDOR_ID_SOURCE_BTSIG &&
record.vendor_id_source != DI_VENDOR_ID_SOURCE_USBIF) {
- ALOGE("%s invalid vendor id source %d; ignoring DID record %d.", __func__, record.vendor_id_source, i);
+ LOG_ERROR("%s invalid vendor id source %d; ignoring DID record %d.", __func__, record.vendor_id_source, i);
continue;
}
- ALOGD("Device ID record %d : %s", i, (record.primary_record ? "primary" : "not primary"));
- ALOGD(" vendorId = %04x", record.vendor);
- ALOGD(" vendorIdSource = %04x", record.vendor_id_source);
- ALOGD(" product = %04x", record.product);
- ALOGD(" version = %04x", record.version);
- ALOGD(" clientExecutableURL = %s", record.client_executable_url);
- ALOGD(" serviceDescription = %s", record.service_description);
- ALOGD(" documentationURL = %s", record.documentation_url);
+ LOG_DEBUG("Device ID record %d : %s", i, (record.primary_record ? "primary" : "not primary"));
+ LOG_DEBUG(" vendorId = %04x", record.vendor);
+ LOG_DEBUG(" vendorIdSource = %04x", record.vendor_id_source);
+ LOG_DEBUG(" product = %04x", record.product);
+ LOG_DEBUG(" version = %04x", record.version);
+ LOG_DEBUG(" clientExecutableURL = %s", record.client_executable_url);
+ LOG_DEBUG(" serviceDescription = %s", record.service_description);
+ LOG_DEBUG(" documentationURL = %s", record.documentation_url);
uint32_t record_handle;
tBTA_STATUS status = BTA_DmSetLocalDiRecord(&record, &record_handle);
if (status != BTA_SUCCESS) {
- ALOGE("%s unable to set device ID record %d: error %d.", __func__, i, status);
+ LOG_ERROR("%s unable to set device ID record %d: error %d.", __func__, i, status);
}
}
******************************************************************************/
#include <assert.h>
-#include <cutils/log.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "gki.h"
#include "l2c_api.h"
+#include "osi/include/log.h"
#include "stack_config.h"
#if (RFCOMM_INCLUDED==TRUE)
assert(config != NULL);
for (tBTTRC_FUNC_MAP *functions = &bttrc_set_level_map[0]; functions->trc_name; ++functions) {
- ALOGI("BTE_InitTraceLevels -- %s", functions->trc_name);
+ LOG_INFO("BTE_InitTraceLevels -- %s", functions->trc_name);
int value = config_get_int(config, CONFIG_DEFAULT_SECTION, functions->trc_name, -1);
if (value != -1)
functions->trace_level = value;
static future_t *init(void) {
const stack_config_t *stack_config = stack_config_get_interface();
if (!stack_config->get_trace_config_enabled()) {
- ALOGI("[bttrc] using compile default trace settings");
+ LOG_INFO("[bttrc] using compile default trace settings");
return NULL;
}
* Description: Contains BTE core stack initialization and shutdown code
*
******************************************************************************/
+
+#define LOG_TAG "bt_main"
+
#include <assert.h>
#include <cutils/properties.h>
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <time.h>
-#include <utils/Log.h>
#include "alarm.h"
#include "bta_api.h"
#include "hci_layer.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "stack_config.h"
#include "thread.h"
hci = hci_layer_get_interface();
if (!hci)
- ALOGE("%s could not get hci layer interface.", __func__);
+ LOG_ERROR("%s could not get hci layer interface.", __func__);
btu_hci_msg_queue = fixed_queue_new(SIZE_MAX);
if (btu_hci_msg_queue == NULL) {
- ALOGE("%s unable to allocate hci message queue.", __func__);
+ LOG_ERROR("%s unable to allocate hci message queue.", __func__);
return;
}
#define LOG_TAG "bt_stack_config"
#include <assert.h>
-#include <utils/Log.h>
#include "future.h"
#include "stack_config.h"
+#include "osi/include/log.h"
const char *BTSNOOP_LOG_PATH_KEY = "BtSnoopFileName";
const char *BTSNOOP_TURNED_ON_KEY = "BtSnoopLogOutput";
const char *path = "/etc/bluetooth/bt_stack.conf";
assert(path != NULL);
- ALOGI("%s attempt to load stack conf from %s", __func__, path);
+ LOG_INFO("%s attempt to load stack conf from %s", __func__, path);
config = config_new(path);
if (!config) {
- ALOGI("%s file >%s< not found", __func__, path);
+ LOG_INFO("%s file >%s< not found", __func__, path);
return future_new_immediate(FUTURE_FAIL);
}
#pragma once
+#include <stdint.h>
+
typedef struct alarm_t alarm_t;
typedef uint64_t period_ms_t;
#include <stdbool.h>
#include <stddef.h>
+#include <stdint.h>
typedef struct array_t array_t;
--- /dev/null
+/******************************************************************************
+ *
+ * Copyright (C) 2014 Google, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************************/
+
+#pragma once
+
+#include <cutils/log.h>
+
+#define LOG_VERBOSE(...) ALOGV(__VA_ARGS__)
+#define LOG_DEBUG(...) ALOGD(__VA_ARGS__)
+#define LOG_INFO(...) ALOGI(__VA_ARGS__)
+#define LOG_WARN(...) ALOGW(__VA_ARGS__)
+#define LOG_ERROR(...) ALOGE(__VA_ARGS__)
#pragma once
#include <stdbool.h>
+#include <stdint.h>
#define THREAD_NAME_MAX 16
#include <hardware/bluetooth.h>
#include <inttypes.h>
#include <time.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "alarm.h"
#include "list.h"
#include "osi.h"
+#include "osi/include/log.h"
struct alarm_t {
// The lock is held while the callback for this alarm is being executed.
alarm_t *ret = osi_calloc(sizeof(alarm_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for alarm.", __func__);
+ LOG_ERROR("%s unable to allocate memory for alarm.", __func__);
goto error;
}
// within the callback function of the alarm.
int error = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
if (error) {
- ALOGE("%s unable to create a recursive mutex: %s", __func__, strerror(error));
+ LOG_ERROR("%s unable to create a recursive mutex: %s", __func__, strerror(error));
goto error;
}
error = pthread_mutex_init(&ret->callback_lock, &attr);
if (error) {
- ALOGE("%s unable to initialize mutex: %s", __func__, strerror(error));
+ LOG_ERROR("%s unable to initialize mutex: %s", __func__, strerror(error));
goto error;
}
alarms = list_new(NULL);
if (!alarms) {
- ALOGE("%s unable to allocate alarm list.", __func__);
+ LOG_ERROR("%s unable to allocate alarm list.", __func__);
return false;
}
struct timespec ts;
if (clock_gettime(CLOCK_ID, &ts) == -1) {
- ALOGE("%s unable to get current time: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to get current time: %s", __func__, strerror(errno));
return 0;
}
if (next_exp < TIMER_INTERVAL_FOR_WAKELOCK_IN_MS) {
int status = bt_os_callouts->acquire_wake_lock(WAKE_LOCK_ID);
if (status != BT_STATUS_SUCCESS) {
- ALOGE("%s unable to acquire wake lock: %d", __func__, status);
+ LOG_ERROR("%s unable to acquire wake lock: %d", __func__, status);
return;
}
sigevent.sigev_notify_function = (void (*)(union sigval))timer_callback;
sigevent.sigev_value.sival_ptr = next;
if (timer_create(CLOCK_ID, &sigevent, &timer) == -1) {
- ALOGE("%s unable to create timer: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to create timer: %s", __func__, strerror(errno));
return;
}
wakeup_time.it_value.tv_sec = (next->deadline / 1000);
wakeup_time.it_value.tv_nsec = (next->deadline % 1000) * 1000000LL;
if (timer_settime(timer, TIMER_ABSTIME, &wakeup_time, NULL) == -1) {
- ALOGE("%s unable to set timer: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to set timer: %s", __func__, strerror(errno));
timer_delete(timer);
return;
}
timer_set = true;
} else {
if (!bt_os_callouts->set_wake_alarm(next_exp, true, timer_callback, next))
- ALOGE("%s unable to set wake alarm for %" PRId64 "ms.", __func__, next_exp);
+ LOG_ERROR("%s unable to set wake alarm for %" PRId64 "ms.", __func__, next_exp);
bt_os_callouts->release_wake_lock(WAKE_LOCK_ID);
}
#include <assert.h>
#include <pthread.h>
#include <stdint.h>
-#include <utils/Log.h>
#include "allocation_tracker.h"
#include "allocator.h"
#include "hash_functions.h"
#include "hash_map.h"
#include "osi.h"
+#include "osi/include/log.h"
typedef struct {
uint8_t allocator_id;
allocation_t *allocation = (allocation_t *)entry->data;
if (!allocation->freed) {
*((size_t *)context) += allocation->size; // Report back the unfreed byte count
- ALOGE("%s found unfreed allocation. address: 0x%x size: %d bytes", __func__, (uintptr_t)allocation->ptr, allocation->size);
+ LOG_ERROR("%s found unfreed allocation. address: 0x%x size: %d bytes", __func__, (uintptr_t)allocation->ptr, allocation->size);
}
return true;
#define LOG_TAG "bt_array"
#include <assert.h>
-#include <cutils/log.h>
#include "allocator.h"
#include "array.h"
+#include "osi/include/log.h"
struct array_t {
size_t element_size;
array_t *array = osi_calloc(sizeof(array_t) + element_size * INTERNAL_ELEMENTS);
if (!array) {
- ALOGE("%s unable to allocate memory for array with elements of size %zu.", __func__, element_size);
+ LOG_ERROR("%s unable to allocate memory for array with elements of size %zu.", __func__, element_size);
return NULL;
}
assert(data != NULL);
if (array->length == array->capacity && !grow(array)) {
- ALOGE("%s unable to grow array past current capacity of %zu elements of size %zu.", __func__, array->capacity, array->element_size);
+ LOG_ERROR("%s unable to grow array past current capacity of %zu elements of size %zu.", __func__, array->capacity, array->element_size);
return false;
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "config.h"
#include "list.h"
+#include "osi/include/log.h"
typedef struct {
char *key;
config_t *config_new_empty(void) {
config_t *config = osi_calloc(sizeof(config_t));
if (!config) {
- ALOGE("%s unable to allocate memory for config_t.", __func__);
+ LOG_ERROR("%s unable to allocate memory for config_t.", __func__);
goto error;
}
config->sections = list_new(section_free);
if (!config->sections) {
- ALOGE("%s unable to allocate list for sections.", __func__);
+ LOG_ERROR("%s unable to allocate list for sections.", __func__);
goto error;
}
FILE *fp = fopen(filename, "rt");
if (!fp) {
- ALOGE("%s unable to open file '%s': %s", __func__, filename, strerror(errno));
+ LOG_ERROR("%s unable to open file '%s': %s", __func__, filename, strerror(errno));
config_free(config);
return NULL;
}
FILE *fp = fopen(filename, "wt");
if (!fp) {
- ALOGE("%s unable to write file '%s': %s", __func__, filename, strerror(errno));
+ LOG_ERROR("%s unable to write file '%s': %s", __func__, filename, strerror(errno));
return false;
}
if (*line_ptr == '[') {
size_t len = strlen(line_ptr);
if (line_ptr[len - 1] != ']') {
- ALOGD("%s unterminated section name on line %d.", __func__, line_num);
+ LOG_DEBUG("%s unterminated section name on line %d.", __func__, line_num);
continue;
}
strncpy(section, line_ptr + 1, len - 2);
} else {
char *split = strchr(line_ptr, '=');
if (!split) {
- ALOGD("%s no key/value separator found on line %d.", __func__, line_num);
+ LOG_DEBUG("%s no key/value separator found on line %d.", __func__, line_num);
continue;
}
#define LOG_TAG "bt_osi_data_dispatcher"
#include <assert.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "data_dispatcher.h"
#include "hash_functions.h"
#include "hash_map.h"
#include "osi.h"
+#include "osi/include/log.h"
#define DEFAULT_TABLE_BUCKETS 10
data_dispatcher_t *ret = osi_calloc(sizeof(data_dispatcher_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for new data dispatcher.", __func__);
+ LOG_ERROR("%s unable to allocate memory for new data dispatcher.", __func__);
goto error;
}
ret->dispatch_table = hash_map_new(DEFAULT_TABLE_BUCKETS, hash_function_naive, NULL, NULL);
if (!ret->dispatch_table) {
- ALOGE("%s unable to create dispatch table.", __func__);
+ LOG_ERROR("%s unable to create dispatch table.", __func__);
goto error;
}
ret->name = osi_strdup(name);
if (!ret->name) {
- ALOGE("%s unable to duplicate provided name.", __func__);
+ LOG_ERROR("%s unable to duplicate provided name.", __func__);
goto error;
}
if (queue)
fixed_queue_enqueue(queue, data);
else
- ALOGW("%s has no handler for type (%d) in data dispatcher named: %s", __func__, type, dispatcher->name);
+ LOG_WARN("%s has no handler for type (%d) in data dispatcher named: %s", __func__, type, dispatcher->name);
return queue != NULL;
}
#include <errno.h>
#include <stddef.h>
#include <sys/eventfd.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "eager_reader.h"
#include "fixed_queue.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "reactor.h"
#include "thread.h"
eager_reader_t *ret = osi_calloc(sizeof(eager_reader_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for new eager_reader.", __func__);
+ LOG_ERROR("%s unable to allocate memory for new eager_reader.", __func__);
goto error;
}
ret->bytes_available_fd = eventfd(0, EFD_SEMAPHORE);
if (ret->bytes_available_fd == INVALID_FD) {
- ALOGE("%s unable to create output reading semaphore.", __func__);
+ LOG_ERROR("%s unable to create output reading semaphore.", __func__);
goto error;
}
ret->buffers = fixed_queue_new(max_buffer_count);
if (!ret->buffers) {
- ALOGE("%s unable to create buffers queue.", __func__);
+ LOG_ERROR("%s unable to create buffers queue.", __func__);
goto error;
}
ret->inbound_read_thread = thread_new(thread_name);
if (!ret->inbound_read_thread) {
- ALOGE("%s unable to make reading thread.", __func__);
+ LOG_ERROR("%s unable to make reading thread.", __func__);
goto error;
}
eventfd_t value;
if (eventfd_read(reader->bytes_available_fd, &value) == -1)
- ALOGE("%s unable to read semaphore for output data.", __func__);
+ LOG_ERROR("%s unable to read semaphore for output data.", __func__);
if (!reader->current_buffer)
reader->current_buffer = fixed_queue_dequeue(reader->buffers);
data_buffer_t *buffer = (data_buffer_t *)reader->allocator->alloc(reader->buffer_size + sizeof(data_buffer_t));
if (!buffer) {
- ALOGE("%s couldn't aquire memory for inbound data buffer.", __func__);
+ LOG_ERROR("%s couldn't aquire memory for inbound data buffer.", __func__);
return;
}
eventfd_write(reader->bytes_available_fd, bytes_read);
} else {
if (bytes_read == 0)
- ALOGW("%s fd said bytes existed, but none were found.", __func__);
+ LOG_WARN("%s fd said bytes existed, but none were found.", __func__);
else
- ALOGW("%s unable to read from file descriptor: %s", __func__, strerror(errno));
+ LOG_WARN("%s unable to read from file descriptor: %s", __func__, strerror(errno));
reader->allocator->free(buffer);
}
#include <assert.h>
#include <pthread.h>
#include <stdlib.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "fixed_queue.h"
#define LOG_TAG "osi_future"
#include <assert.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "future.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "semaphore.h"
struct future_t {
future_t *future_new(void) {
future_t *ret = osi_calloc(sizeof(future_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for return value.", __func__);
+ LOG_ERROR("%s unable to allocate memory for return value.", __func__);
goto error;
}
ret->semaphore = semaphore_new(0);
if (!ret->semaphore) {
- ALOGE("%s unable to allocate memory for the semaphore.", __func__);
+ LOG_ERROR("%s unable to allocate memory for the semaphore.", __func__);
goto error;
}
future_t *future_new_immediate(void *value) {
future_t *ret = osi_calloc(sizeof(future_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for return value.", __func__);
+ LOG_ERROR("%s unable to allocate memory for return value.", __func__);
goto error;
}
#include <stdlib.h>
#include <sys/epoll.h>
#include <sys/eventfd.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "list.h"
+#include "osi/include/log.h"
#include "reactor.h"
#if !defined(EFD_SEMAPHORE)
ret->epoll_fd = epoll_create(MAX_EVENTS);
if (ret->epoll_fd == INVALID_FD) {
- ALOGE("%s unable to create epoll instance: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to create epoll instance: %s", __func__, strerror(errno));
goto error;
}
ret->event_fd = eventfd(0, 0);
if (ret->event_fd == INVALID_FD) {
- ALOGE("%s unable to create eventfd: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to create eventfd: %s", __func__, strerror(errno));
goto error;
}
pthread_mutex_init(&ret->list_lock, NULL);
ret->invalidation_list = list_new(NULL);
if (!ret->invalidation_list) {
- ALOGE("%s unable to allocate object invalidation list.", __func__);
+ LOG_ERROR("%s unable to allocate object invalidation list.", __func__);
goto error;
}
event.events = EPOLLIN;
event.data.ptr = NULL;
if (epoll_ctl(ret->epoll_fd, EPOLL_CTL_ADD, ret->event_fd, &event) == -1) {
- ALOGE("%s unable to register eventfd with epoll set: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to register eventfd with epoll set: %s", __func__, strerror(errno));
goto error;
}
reactor_object_t *object = (reactor_object_t *)osi_calloc(sizeof(reactor_object_t));
if (!object) {
- ALOGE("%s unable to allocate reactor object: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to allocate reactor object: %s", __func__, strerror(errno));
return NULL;
}
event.data.ptr = object;
if (epoll_ctl(reactor->epoll_fd, EPOLL_CTL_ADD, fd, &event) == -1) {
- ALOGE("%s unable to register fd %d to epoll set: %s", __func__, fd, strerror(errno));
+ LOG_ERROR("%s unable to register fd %d to epoll set: %s", __func__, fd, strerror(errno));
pthread_mutex_destroy(&object->lock);
osi_free(object);
return NULL;
event.data.ptr = object;
if (epoll_ctl(object->reactor->epoll_fd, EPOLL_CTL_MOD, object->fd, &event) == -1) {
- ALOGE("%s unable to modify interest set for fd %d: %s", __func__, object->fd, strerror(errno));
+ LOG_ERROR("%s unable to modify interest set for fd %d: %s", __func__, object->fd, strerror(errno));
return false;
}
reactor_t *reactor = obj->reactor;
if (epoll_ctl(reactor->epoll_fd, EPOLL_CTL_DEL, obj->fd, NULL) == -1)
- ALOGE("%s unable to unregister fd %d from epoll set: %s", __func__, obj->fd, strerror(errno));
+ LOG_ERROR("%s unable to unregister fd %d from epoll set: %s", __func__, obj->fd, strerror(errno));
if (reactor->is_running && pthread_equal(pthread_self(), reactor->run_thread)) {
reactor->object_removed = true;
} while (ret == -1 && errno == EINTR);
if (ret == -1) {
- ALOGE("%s error in epoll_wait: %s", __func__, strerror(errno));
+ LOG_ERROR("%s error in epoll_wait: %s", __func__, strerror(errno));
reactor->is_running = false;
return REACTOR_STATUS_ERROR;
}
#include <fcntl.h>
#include <string.h>
#include <sys/eventfd.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "semaphore.h"
#if !defined(EFD_SEMAPHORE)
if (ret) {
ret->fd = eventfd(value, EFD_SEMAPHORE);
if (ret->fd == INVALID_FD) {
- ALOGE("%s unable to allocate semaphore: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to allocate semaphore: %s", __func__, strerror(errno));
osi_free(ret);
ret = NULL;
}
uint64_t value;
if (eventfd_read(semaphore->fd, &value) == -1)
- ALOGE("%s unable to wait on semaphore: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to wait on semaphore: %s", __func__, strerror(errno));
}
bool semaphore_try_wait(semaphore_t *semaphore) {
int flags = fcntl(semaphore->fd, F_GETFL);
if (flags == -1) {
- ALOGE("%s unable to get flags for semaphore fd: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to get flags for semaphore fd: %s", __func__, strerror(errno));
return false;
}
if (fcntl(semaphore->fd, F_SETFL, flags | O_NONBLOCK) == -1) {
- ALOGE("%s unable to set O_NONBLOCK for semaphore fd: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to set O_NONBLOCK for semaphore fd: %s", __func__, strerror(errno));
return false;
}
return false;
if (fcntl(semaphore->fd, F_SETFL, flags) == -1)
- ALOGE("%s unable to resetore flags for semaphore fd: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to resetore flags for semaphore fd: %s", __func__, strerror(errno));
return true;
}
assert(semaphore->fd != INVALID_FD);
if (eventfd_write(semaphore->fd, 1ULL) == -1)
- ALOGE("%s unable to post to semaphore: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to post to semaphore: %s", __func__, strerror(errno));
}
int semaphore_get_fd(const semaphore_t *semaphore) {
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "reactor.h"
#include "socket.h"
socket_t *socket_new(void) {
socket_t *ret = (socket_t *)osi_calloc(sizeof(socket_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for socket.", __func__);
+ LOG_ERROR("%s unable to allocate memory for socket.", __func__);
goto error;
}
ret->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (ret->fd == INVALID_FD) {
- ALOGE("%s unable to create socket: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to create socket: %s", __func__, strerror(errno));
goto error;
}
int enable = 1;
if (setsockopt(ret->fd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) == -1) {
- ALOGE("%s unable to set SO_REUSEADDR: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to set SO_REUSEADDR: %s", __func__, strerror(errno));
goto error;
}
socket_t *ret = (socket_t *)osi_calloc(sizeof(socket_t));
if (!ret) {
- ALOGE("%s unable to allocate memory for socket.", __func__);
+ LOG_ERROR("%s unable to allocate memory for socket.", __func__);
return NULL;
}
addr.sin_addr.s_addr = 0;
addr.sin_port = htons(port);
if (bind(socket->fd, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
- ALOGE("%s unable to bind socket to port %u: %s", __func__, port, strerror(errno));
+ LOG_ERROR("%s unable to bind socket to port %u: %s", __func__, port, strerror(errno));
return false;
}
if (listen(socket->fd, 10) == -1) {
- ALOGE("%s unable to listen on port %u: %s", __func__, port, strerror(errno));
+ LOG_ERROR("%s unable to listen on port %u: %s", __func__, port, strerror(errno));
return false;
}
int fd = accept(socket->fd, NULL, NULL);
if (fd == INVALID_FD) {
- ALOGE("%s unable to accept socket: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to accept socket: %s", __func__, strerror(errno));
return NULL;
}
socket_t *ret = (socket_t *)osi_calloc(sizeof(socket_t));
if (!ret) {
close(fd);
- ALOGE("%s unable to allocate memory for socket.", __func__);
+ LOG_ERROR("%s unable to allocate memory for socket.", __func__);
return NULL;
}
#include <string.h>
#include <sys/prctl.h>
#include <sys/types.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "fixed_queue.h"
+#include "log.h"
#include "reactor.h"
#include "semaphore.h"
#include "thread.h"
// or when the item is removed from the queue for dispatch.
work_item_t *item = (work_item_t *)osi_malloc(sizeof(work_item_t));
if (!item) {
- ALOGE("%s unable to allocate memory: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to allocate memory: %s", __func__, strerror(errno));
return false;
}
item->func = func;
assert(thread != NULL);
if (prctl(PR_SET_NAME, (unsigned long)thread->name) == -1) {
- ALOGE("%s unable to set thread name: %s", __func__, strerror(errno));
+ LOG_ERROR("%s unable to set thread name: %s", __func__, strerror(errno));
start->error = errno;
semaphore_post(start->start_sem);
return NULL;
}
if (count > fixed_queue_capacity(thread->work_queue))
- ALOGD("%s growing event queue on shutdown.", __func__);
+ LOG_DEBUG("%s growing event queue on shutdown.", __func__);
return NULL;
}
extern "C" {
#include <stdint.h>
#include <unistd.h>
-#include <utils/Log.h>
#include "allocator.h"
#include "eager_reader.h"
extern "C" {
#include <sys/select.h>
-#include <utils/Log.h>
#include "reactor.h"
#include "semaphore.h"
#include "gatt_int.h"
#include "btm_ble_int.h"
+#include "osi/include/log.h"
#define BTM_BLE_NAME_SHORT 0x01
#define BTM_BLE_NAME_CMPL 0x02
else
flag &= ~(BTM_BLE_DMT_CONTROLLER_SPT|BTM_BLE_DMT_HOST_SPT);
- BTM_TRACE_DEBUG("disc_mode %04x", disc_mode);
+ LOG_DEBUG("disc_mode %04x", disc_mode);
/* update discoverable flag */
if (disc_mode & BTM_BLE_LIMITED_DISCOVERABLE)
{
#include <string.h>
#include <stdio.h>
#include <stddef.h>
-#include <utils/Log.h>
#include "bt_types.h"
#include "bt_utils.h"
#define LOG_TAG "bt_pm"
-#include <cutils/log.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
+
#include "bt_types.h"
#include "gki.h"
#include "hcimsgs.h"
#include "l2c_int.h"
#include "hcidefs.h"
#include "bt_utils.h"
+#include "osi/include/log.h"
/*****************************************************************************/
/* to handle different modes */
BTM_TRACE_DEBUG("btm_pm_snd_md_req state:0x%x, link_ind: %d", p_cb->state, link_ind);
#endif // BTM_PM_DEBUG
- ALOGD("%s switching from %s to %s.", __func__, mode_to_string(p_cb->state), mode_to_string(md_res.mode));
+ LOG_DEBUG("%s switching from %s to %s.", __func__, mode_to_string(p_cb->state), mode_to_string(md_res.mode));
switch(md_res.mode)
{
case BTM_PM_MD_ACTIVE:
*
******************************************************************************/
+#define LOG_TAG "bt_btm_sec"
+
#include <string.h>
#include "bt_types.h"
#include "btm_int.h"
#include "l2c_int.h"
#include "bt_utils.h"
+#include "osi/include/log.h"
#if (BT_USE_TRACES == TRUE && BT_TRACE_VERBOSE == FALSE)
/* needed for sprintf() */
*
******************************************************************************/
+#define LOG_TAG "BTLD"
+
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include "btm_int.h"
#include "bt_utils.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "hci_layer.h"
// TODO(zachoverflow): remove this horrible hack
extern void btm_ble_test_command_complete(UINT8 *p);
// btla-specific ++
-#define LOG_TAG "BTLD"
-#if (defined(ANDROID_APP_INCLUDED) && (ANDROID_APP_INCLUDED == TRUE) && (!defined(LINUX_NATIVE)) )
-#include <cutils/log.h>
-#else
-#define LOGV(format, ...) fprintf (stdout, LOG_TAG format"\n", ## __VA_ARGS__)
-#define LOGE(format, ...) fprintf (stderr, LOG_TAG format"\n", ## __VA_ARGS__)
-#define LOGI(format, ...) fprintf (stdout, LOG_TAG format"\n", ## __VA_ARGS__)
-#endif
-
-// btla-specific ++
/* BTE application task */
#if APPL_INCLUDED == TRUE
#include "bte_appl.h"
btu_hcif_qos_setup_comp_evt (p);
break;
case HCI_COMMAND_COMPLETE_EVT:
- ALOGE("%s should not have received a command complete event. "
+ LOG_ERROR("%s should not have received a command complete event. "
"Someone didn't go through the hci transmit_command function.", __func__);
break;
case HCI_COMMAND_STATUS_EVT:
- ALOGE("%s should not have received a command status event. "
+ LOG_ERROR("%s should not have received a command status event. "
"Someone didn't go through the hci transmit_command function.", __func__);
break;
case HCI_HARDWARE_ERROR_EVT:
*
******************************************************************************/
+#define LOG_TAG "bt_task"
+
#include <assert.h>
#include "bt_target.h"
-#define LOG_TAG "bt_task"
-#include <cutils/log.h>
#include <pthread.h>
#include <string.h>
#include "dyn_mem.h"
#include "sdpint.h"
#include "thread.h"
#include "l2c_int.h"
+#include "osi/include/log.h"
#if (BLE_INCLUDED == TRUE)
#include "gatt_api.h"
return;
error_exit:;
- ALOGE("%s Unable to allocate resources for bt_workqueue", __func__);
+ LOG_ERROR("%s Unable to allocate resources for bt_workqueue", __func__);
BTU_ShutDown();
}
#define LOG_TAG "btu_task"
#include <assert.h>
-#include <cutils/log.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "l2c_int.h"
#include "module.h"
#include "osi.h"
+#include "osi/include/log.h"
#include "sdpint.h"
#include "thread.h"
BT_TRACE(TRACE_LAYER_BTU, TRACE_TYPE_API,
"btu_task pending for preload complete event");
- ALOGI("Bluetooth chip preload is complete");
+ LOG_INFO("Bluetooth chip preload is complete");
BT_TRACE(TRACE_LAYER_BTU, TRACE_TYPE_API,
"btu_task received preload complete event");
alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGE("%s Unable to create alarm\n", __func__);
+ LOG_ERROR("%s Unable to create alarm\n", __func__);
return;
}
alarm_cancel(alarm);
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_general_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGW("%s Unable to find expected alarm in hashmap\n", __func__);
+ LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__);
return;
}
alarm_cancel(alarm);
alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGE("%s Unable to create alarm\n", __func__);
+ LOG_ERROR("%s Unable to create alarm\n", __func__);
return;
}
alarm_cancel(alarm);
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_l2cap_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGW("%s Unable to find expected alarm in hashmap\n", __func__);
+ LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__);
return;
}
alarm_cancel(alarm);
alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGE("%s Unable to create alarm\n", __func__);
+ LOG_ERROR("%s Unable to create alarm\n", __func__);
return;
}
alarm_cancel(alarm);
// Get the alarm for the timer list entry.
alarm_t *alarm = hash_map_get(btu_oneshot_alarm_hash_map, p_tle);
if (alarm == NULL) {
- ALOGW("%s Unable to find expected alarm in hashmap\n", __func__);
+ LOG_WARN("%s Unable to find expected alarm in hashmap\n", __func__);
return;
}
alarm_cancel(alarm);
*
******************************************************************************/
-#include <cutils/log.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "l2c_api.h"
#include "l2c_int.h"
#include "l2cdefs.h"
+#include "osi/include/log.h"
/********************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
l2cb.rcv_pending_q = list_new(NULL);
if (l2cb.rcv_pending_q == NULL)
- ALOGE("%s unable to allocate memory for link layer control block", __func__);
+ LOG_ERROR("%s unable to allocate memory for link layer control block", __func__);
}
void l2c_free(void) {
#include "rfc_int.h"
#include "l2c_api.h"
#include "sdp_api.h"
+#include "osi/include/log.h"
/* duration of break in 200ms units */
#define PORT_BREAK_DURATION 1
-#include <cutils/log.h>
-#define info(fmt, ...) ALOGI ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define debug(fmt, ...) ALOGD ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define error(fmt, ...) ALOGE ("## ERROR : %s: " fmt "##",__FUNCTION__, ## __VA_ARGS__)
-#define asrt(s) if(!(s)) ALOGE ("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
+#define info(fmt, ...) LOG_INFO ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
+#define debug(fmt, ...) LOG_DEBUG ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
+#define error(fmt, ...) LOG_ERROR ("## ERROR : %s: " fmt "##",__FUNCTION__, ## __VA_ARGS__)
+#define asrt(s) if(!(s)) LOG_ERROR ("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
/* Mapping from PORT_* result codes to human readable strings. */
static const char *result_code_strings[] = {
#include "sdpint.h"
#include "btu.h"
-#include <cutils/log.h>
-#define info(fmt, ...) LOGI ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define debug(fmt, ...) LOGD ("%s: " fmt,__FUNCTION__, ## __VA_ARGS__)
-#define error(fmt, ...) LOGE ("## ERROR : %s: " fmt "##",__FUNCTION__, ## __VA_ARGS__)
-#define asrt(s) if(!(s)) LOGE ("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
-
-
/**********************************************************************
** C L I E N T F U N C T I O N P R O T O T Y P E S *
***********************************************************************/
*
***********************************************************************************/
+#define LOG_TAG "BT_UTILS"
+
#include <cutils/properties.h>
#include <cutils/sched_policy.h>
#include <errno.h>
#include <unistd.h>
#include <utils/ThreadDefs.h>
-#define LOG_TAG "BT_UTILS"
-
-#include <utils/Log.h>
-
#include "bt_types.h"
#include "bt_utils.h"
#include "module.h"
+#include "osi/include/log.h"
/*******************************************************************************
** Type definitions for callback functions
pthread_mutex_unlock(&gIdxLock);
if (rc) {
- ALOGW("failed to change sched policy, tid %d, err: %d", tid, errno);
+ LOG_WARN("failed to change sched policy, tid %d, err: %d", tid, errno);
}
// always use urgent priority for HCI worker thread until we can adjust
priority = ANDROID_PRIORITY_URGENT_AUDIO;
if (setpriority(PRIO_PROCESS, tid, priority) < 0) {
- ALOGW("failed to change priority tid: %d to %d", tid, priority);
+ LOG_WARN("failed to change priority tid: %d to %d", tid, priority);
}
}
{
if (setpriority(PRIO_PROCESS, tid, priority) < 0)
{
- ALOGW("failed to change priority tid: %d to %d", tid, priority);
+ LOG_WARN("failed to change priority tid: %d to %d", tid, priority);
}
}
}