static void bta_ag_sco_event(tBTA_AG_SCB* p_scb, uint8_t event) {
tBTA_AG_SCO_CB* p_sco = &bta_ag_cb.sco;
uint8_t previous_state = p_sco->state;
- LOG_DEBUG("index=0x%04x, device=%s, state=%s[%d], event=%s[%d]",
- p_scb->sco_idx, p_scb->peer_addr.ToString().c_str(),
- bta_ag_sco_state_str(p_sco->state), p_sco->state,
- bta_ag_sco_evt_str(event), event);
+ LOG_INFO("index=0x%04x, device=%s, state=%s[%d], event=%s[%d]",
+ p_scb->sco_idx, p_scb->peer_addr.ToString().c_str(),
+ bta_ag_sco_state_str(p_sco->state), p_sco->state,
+ bta_ag_sco_evt_str(event), event);
switch (p_sco->state) {
case BTA_AG_SCO_SHUTDOWN_ST:
void bta_ag_sco_codec_nego(tBTA_AG_SCB* p_scb, bool result) {
if (result) {
/* Subsequent SCO connection will skip codec negotiation */
- LOG_DEBUG("Succeeded for index 0x%04x, device %s", p_scb->sco_idx,
- p_scb->peer_addr.ToString().c_str());
+ LOG_INFO("Succeeded for index 0x%04x, device %s", p_scb->sco_idx,
+ p_scb->peer_addr.ToString().c_str());
p_scb->codec_updated = false;
bta_ag_sco_event(p_scb, BTA_AG_SCO_CN_DONE_E);
} else {
/* codec negotiation failed */
- LOG_DEBUG("Failed for index 0x%04x, device %s", p_scb->sco_idx,
- p_scb->peer_addr.ToString().c_str());
+ LOG_INFO("Failed for index 0x%04x, device %s", p_scb->sco_idx,
+ p_scb->peer_addr.ToString().c_str());
bta_ag_sco_event(p_scb, BTA_AG_SCO_CLOSE_E);
}
}
/* we like this codec_type. find the sep_idx */
local_sep = bta_av_get_scb_sep_type(p_scb, avdt_handle);
bta_av_adjust_seps_idx(p_scb, avdt_handle);
- LOG_DEBUG(
+ LOG_INFO(
"%s: peer %s bta_handle=0x%x avdt_handle=%d sep_idx=%d cur_psc_mask:0x%x",
__func__, p_scb->PeerAddress().ToString().c_str(), p_scb->hndl,
p_scb->avdt_handle, p_scb->sep_idx, p_scb->cur_psc_mask);
else if (uuid_int == UUID_SERVCLASS_AUDIO_SINK)
bta_av_adjust_seps_idx(p_scb,
bta_av_get_scb_handle(p_scb, AVDT_TSEP_SNK));
- LOG_DEBUG("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
- p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
+ LOG_INFO("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
+ p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
/* use only the services peer supports */
cfg.psc_mask &= p_scb->peer_cap.psc_mask;
uint8_t avdt_handle = p_data->ci_setconfig.avdt_handle;
bta_av_adjust_seps_idx(p_scb, avdt_handle);
- LOG_DEBUG("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
- p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
+ LOG_INFO("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
+ p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
AVDT_ConfigRsp(p_scb->avdt_handle, p_scb->avdt_label, AVDT_ERR_UNSUP_CFG, 0);
reject.bd_addr = p_data->str_msg.bd_addr;
/* we may choose to use a different SEP at reconfig.
* adjust the sep_idx now */
bta_av_adjust_seps_idx(p_scb, bta_av_get_scb_handle(p_scb, AVDT_TSEP_SRC));
- LOG_DEBUG("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
- p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
+ LOG_INFO("%s: sep_idx=%d avdt_handle=%d bta_handle=0x%x", __func__,
+ p_scb->sep_idx, p_scb->avdt_handle, p_scb->hndl);
/* open the stream with the new config */
p_scb->sep_info_idx = p_scb->rcfg_idx;
uint8_t bta_av_rc_create(tBTA_AV_CB* p_cb, uint8_t role, uint8_t shdl,
uint8_t lidx) {
if (is_new_avrcp_enabled()) {
- LOG_DEBUG("Skipping RC creation for the old AVRCP profile");
+ LOG_INFO("Skipping RC creation for the old AVRCP profile");
return BTA_AV_RC_HANDLE_NONE;
}
void bta_av_ci_setconfig(tBTA_AV_HNDL bta_av_handle, uint8_t err_code,
uint8_t category, uint8_t num_seid, uint8_t* p_seid,
bool recfg_needed, uint8_t avdt_handle) {
- LOG_DEBUG(
+ LOG_INFO(
"%s: bta_av_handle=0x%x err_code=%d category=%d "
"num_seid=%d recfg_needed=%s avdt_handle=%d",
__func__, bta_av_handle, err_code, category, num_seid,
void tBTA_AV_SCB::SetAvdtpVersion(uint16_t avdtp_version) {
avdtp_version_ = avdtp_version;
- LOG_DEBUG("%s: AVDTP version for %s set to 0x%x", __func__,
- peer_address_.ToString().c_str(), avdtp_version_);
+ LOG_INFO("%s: AVDTP version for %s set to 0x%x", __func__,
+ peer_address_.ToString().c_str(), avdtp_version_);
}
/*******************************************************************************
memset(p, 0x00, HCI_EXT_INQ_RESPONSE_LEN);
- LOG_DEBUG("Generating extended inquiry response packet EIR");
+ LOG_INFO("Generating extended inquiry response packet EIR");
if (local_name)
local_name_len = strlen(local_name);
if (!BTM_HasEirService(p_bta_dm_eir_cfg->uuid_mask, uuid16)) return;
if (adding) {
- LOG_DEBUG("EIR Adding UUID=0x%04X into extended inquiry response", uuid16);
+ LOG_INFO("EIR Adding UUID=0x%04X into extended inquiry response", uuid16);
BTM_AddEirService(bta_dm_cb.eir_uuid, uuid16);
} else {
- LOG_DEBUG("EIR Removing UUID=0x%04X from extended inquiry response",
- uuid16);
+ LOG_INFO("EIR Removing UUID=0x%04X from extended inquiry response", uuid16);
BTM_RemoveEirService(bta_dm_cb.eir_uuid, uuid16);
}
bta_dm_conn_srvcs.conn_srvc[j].new_request = true;
bta_dm_conn_srvcs.conn_srvc[j].peer_bdaddr = peer_addr;
- LOG_DEBUG("New connection service id:%d app_id:%d", id, app_id);
+ LOG_INFO("New connection service id:%d app_id:%d", id, app_id);
bta_dm_conn_srvcs.count++;
bta_dm_conn_srvcs.conn_srvc[j].state = status;
int* count) {
tBTA_GATTC_CLCB* p_clcb = bta_gattc_find_clcb_by_conn_id(conn_id);
- LOG_DEBUG("%s", __func__);
+ LOG_INFO("%s", __func__);
if (p_clcb == NULL) {
LOG(ERROR) << "Unknown conn_id=" << loghex(conn_id);
return;
if (!charac.uuid.Is16Bit()) continue;
uint16_t uuid16 = charac.uuid.As16Bit();
- LOG_DEBUG("%s: %s %s", __func__, bta_hh_uuid_to_str(uuid16),
- charac.uuid.ToString().c_str());
+ LOG_INFO("%s: %s %s", __func__, bta_hh_uuid_to_str(uuid16),
+ charac.uuid.ToString().c_str());
switch (uuid16) {
case GATT_UUID_HID_CONTROL_POINT:
LOG_ERROR("%s: Cannot observe the Bluetooth Audio HAL's death", __func__);
}
- LOG_DEBUG("%s: IBluetoothAudioOffload::getService() returned %p (%s)",
- __func__, btAudio.get(),
- (btAudio->isRemote() ? "remote" : "local"));
+ LOG_INFO("%s: IBluetoothAudioOffload::getService() returned %p (%s)",
+ __func__, btAudio.get(), (btAudio->isRemote() ? "remote" : "local"));
LOG_INFO("%s:Init returned", __func__);
}
uint8_t btif_av_get_peer_sep(void) {
BtifAvPeer* peer = btif_av_find_active_peer();
if (peer == nullptr) {
- LOG_DEBUG("No active sink or source peer found");
+ LOG_INFO("No active sink or source peer found");
return AVDT_TSEP_SNK;
}
uint8_t peer_sep = peer->PeerSep();
- LOG_DEBUG("Peer %s SEP is %s (%d)", peer->PeerAddress().ToString().c_str(),
- (peer_sep == AVDT_TSEP_SRC) ? "Source" : "Sink", peer_sep);
+ LOG_INFO("Peer %s SEP is %s (%d)", peer->PeerAddress().ToString().c_str(),
+ (peer_sep == AVDT_TSEP_SRC) ? "Source" : "Sink", peer_sep);
return peer_sep;
}
void BtifAvrcpAudioTrackStop(void* handle) {
if (handle == NULL) {
- LOG_DEBUG("%s handle is null.", __func__);
+ LOG_INFO("%s handle is null.", __func__);
return;
}
BtifAvrcpAudioTrack* trackHolder = static_cast<BtifAvrcpAudioTrack*>(handle);
void BtifAvrcpAudioTrackDelete(void* handle) {
if (handle == NULL) {
- LOG_DEBUG("%s handle is null.", __func__);
+ LOG_INFO("%s handle is null.", __func__);
return;
}
BtifAvrcpAudioTrack* trackHolder = static_cast<BtifAvrcpAudioTrack*>(handle);
void BtifAvrcpAudioTrackPause(void* handle) {
if (handle == NULL) {
- LOG_DEBUG("%s handle is null.", __func__);
+ LOG_INFO("%s handle is null.", __func__);
return;
}
BtifAvrcpAudioTrack* trackHolder = static_cast<BtifAvrcpAudioTrack*>(handle);
void BtifAvrcpSetAudioTrackGain(void* handle, float gain) {
if (handle == NULL) {
- LOG_DEBUG("%s handle is null.", __func__);
+ LOG_INFO("%s handle is null.", __func__);
return;
}
// Does nothing right now
if (!btif_config_get_int(bd_addr_str, "DevType", p_device_type)) return false;
- LOG_DEBUG("Device [%s] device type %d", bd_addr_str, *p_device_type);
+ LOG_INFO("Device [%s] device type %d", bd_addr_str, *p_device_type);
return true;
}
if (!btif_config_get_int(bd_addr_str, "AddrType", &val)) return false;
*p_addr_type = static_cast<tBLE_ADDR_TYPE>(val);
- LOG_DEBUG("Device [%s] address type %d", bd_addr_str, *p_addr_type);
+ LOG_INFO("Device [%s] address type %d", bd_addr_str, *p_addr_type);
return true;
}
strcmp(bdstr.c_str(), val) != 0) {
// We failed to get an address or the one in the config file does not match
// the address given by the controller interface. Update the config cache
- LOG_DEBUG("%s: Storing '%s' into the config file", __func__, bdstr.c_str());
+ LOG_INFO("%s: Storing '%s' into the config file", __func__, bdstr.c_str());
btif_config_set_str("Adapter", "Address", bdstr.c_str());
btif_config_save();
if (pairing_cb.bond_type == tBTM_SEC_DEV_REC::BOND_TYPE_TEMPORARY)
state = BT_BOND_STATE_NONE;
- LOG_DEBUG(
+ LOG_INFO(
"Bond state changed to state=%d [0:none, 1:bonding, 2:bonded],"
" prev_state=%d, sdp_attempts = %d",
state, pairing_cb.state, pairing_cb.sdp_attempts);
btm_status = BTM_ReadRemoteVersion(*p_bd, &lmp_ver, &mfct_set, &lmp_subver);
- LOG_DEBUG("remote version info [%s]: %x, %x, %x", p_bd->ToString().c_str(),
- lmp_ver, mfct_set, lmp_subver);
+ LOG_INFO("remote version info [%s]: %x, %x, %x", p_bd->ToString().c_str(),
+ lmp_ver, mfct_set, lmp_subver);
if (btm_status == BTM_SUCCESS) {
// Always update cache to ensure we have availability whenever BTM API is
&bdaddr, &properties[num_properties]);
LOG_VERBOSE("cod retrieved from storage is 0x%06x", cod);
if (cod == 0) {
- LOG_DEBUG("cod from storage is also unclassified");
+ LOG_INFO("cod from storage is also unclassified");
cod = COD_UNCLASSIFIED;
}
} else {
- LOG_DEBUG("class of device (cod) is 0x%06x", cod);
+ LOG_INFO("class of device (cod) is 0x%06x", cod);
}
BTIF_STORAGE_FILL_PROPERTY(&properties[num_properties],
cod = devclass2uint(p_ssp_cfm_req->dev_class);
if (cod == 0) {
- LOG_DEBUG("%s cod is 0, set as unclassified", __func__);
+ LOG_INFO("%s cod is 0, set as unclassified", __func__);
cod = COD_UNCLASSIFIED;
}
cod = devclass2uint(p_ssp_key_notif->dev_class);
if (cod == 0) {
- LOG_DEBUG("%s cod is 0, set as unclassified", __func__);
+ LOG_INFO("%s cod is 0, set as unclassified", __func__);
cod = COD_UNCLASSIFIED;
}
int num_properties = 0;
if (p_data->disc_ble_res.service.As16Bit() == UUID_SERVCLASS_LE_HID ||
p_data->disc_ble_res.service == UUID_HEARING_AID) {
- LOG_DEBUG("Found HOGP or HEARING AID UUID");
+ LOG_INFO("Found HOGP or HEARING AID UUID");
bt_property_t prop[2];
bt_status_t ret;
*
******************************************************************************/
void btif_dm_cancel_discovery(void) {
- LOG_DEBUG("Cancel search");
+ LOG_INFO("Cancel search");
BTA_DmSearchCancel();
}
}
case BTA_GATTC_ACL_EVT:
- LOG_DEBUG("BTA_GATTC_ACL_EVT: status = %d", p_data->status);
+ LOG_INFO("BTA_GATTC_ACL_EVT: status = %d", p_data->status);
/* Ignore for now */
break;
case BTA_GATTS_OPEN_EVT:
case BTA_GATTS_CANCEL_OPEN_EVT:
case BTA_GATTS_CLOSE_EVT:
- LOG_DEBUG("%s: Empty event (%d)!", __func__, event);
+ LOG_INFO("%s: Empty event (%d)!", __func__, event);
break;
case BTA_GATTS_PHY_UPDATE_EVT:
static void btif_test_connect_cback(tGATT_IF, const RawAddress&,
uint16_t conn_id, bool connected,
tGATT_DISCONN_REASON, tBT_TRANSPORT) {
- LOG_DEBUG("%s: conn_id=%d, connected=%d", __func__, conn_id, connected);
+ LOG_INFO("%s: conn_id=%d, connected=%d", __func__, conn_id, connected);
test_cb.conn_id = connected ? conn_id : 0;
}
static void btif_test_command_complete_cback(uint16_t conn_id, tGATTC_OPTYPE op,
tGATT_STATUS status,
tGATT_CL_COMPLETE* p_data) {
- LOG_DEBUG("%s: op_code=0x%02x, conn_id=0x%x. status=0x%x", __func__, op,
- conn_id, status);
+ LOG_INFO("%s: op_code=0x%02x, conn_id=0x%x. status=0x%x", __func__, op,
+ conn_id, status);
switch (op) {
case GATTC_OPTYPE_READ:
break;
default:
- LOG_DEBUG("%s: Unknown op_code (0x%02x)", __func__, op);
+ LOG_INFO("%s: Unknown op_code (0x%02x)", __func__, op);
break;
}
}
static void btif_test_discovery_result_cback(UNUSED_ATTR uint16_t conn_id,
tGATT_DISC_TYPE disc_type,
tGATT_DISC_RES* p_data) {
- LOG_DEBUG("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
- LOG_DEBUG(" Attribute handle: 0x%04x (%d)", p_data->handle,
- p_data->handle);
+ LOG_INFO("------ GATT Discovery result %-22s -------", disc_name[disc_type]);
+ LOG_INFO(" Attribute handle: 0x%04x (%d)", p_data->handle,
+ p_data->handle);
if (disc_type != GATT_DISC_CHAR_DSCPT) {
- LOG_DEBUG(" Attribute type: %s", p_data->type.ToString().c_str());
+ LOG_INFO(" Attribute type: %s", p_data->type.ToString().c_str());
}
switch (disc_type) {
case GATT_DISC_SRVC_ALL:
- 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);
- LOG_DEBUG(" Service UUID: %s",
- p_data->value.group_value.service_type.ToString().c_str());
+ LOG_INFO(" 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);
+ LOG_INFO(" Service UUID: %s",
+ p_data->value.group_value.service_type.ToString().c_str());
break;
case GATT_DISC_SRVC_BY_UUID:
- LOG_DEBUG(" Handle range: 0x%04x ~ 0x%04x (%d ~ %d)",
- p_data->handle, p_data->value.handle, p_data->handle,
- p_data->value.handle);
+ LOG_INFO(" 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:
- 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);
- LOG_DEBUG(" Service UUID: %s",
- p_data->value.incl_service.service_type.ToString().c_str());
+ LOG_INFO(" 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);
+ LOG_INFO(" Service UUID: %s",
+ p_data->value.incl_service.service_type.ToString().c_str());
break;
case GATT_DISC_CHAR:
- LOG_DEBUG(" Properties: 0x%02x",
- p_data->value.dclr_value.char_prop);
- LOG_DEBUG(" Characteristic UUID: %s",
- p_data->value.dclr_value.char_uuid.ToString().c_str());
+ LOG_INFO(" Properties: 0x%02x",
+ p_data->value.dclr_value.char_prop);
+ LOG_INFO(" Characteristic UUID: %s",
+ p_data->value.dclr_value.char_uuid.ToString().c_str());
break;
case GATT_DISC_CHAR_DSCPT:
- LOG_DEBUG(" Descriptor UUID: %s", p_data->type.ToString().c_str());
+ LOG_INFO(" Descriptor UUID: %s", p_data->type.ToString().c_str());
break;
}
- LOG_DEBUG("-----------------------------------------------------------");
+ LOG_INFO("-----------------------------------------------------------");
}
static void btif_test_discovery_complete_cback(
UNUSED_ATTR uint16_t conn_id, UNUSED_ATTR tGATT_DISC_TYPE disc_type,
tGATT_STATUS status) {
- LOG_DEBUG("%s: status=%d", __func__, status);
+ LOG_INFO("%s: status=%d", __func__, status);
}
static tGATT_CBACK btif_test_callbacks = {btif_test_connect_cback,
switch (command) {
case 0x01: /* Enable */
{
- LOG_DEBUG("%s: ENABLE - enable=%d", __func__, params->u1);
+ LOG_INFO("%s: ENABLE - enable=%d", __func__, params->u1);
if (params->u1) {
std::array<uint8_t, Uuid::kNumBytes128> tmp;
tmp.fill(0xAE);
case 0x02: /* Connect */
{
- LOG_DEBUG("%s: CONNECT - device=%s (dev_type=%d, addr_type=%d)", __func__,
- params->bda1->ToString().c_str(), params->u1, params->u2);
+ LOG_INFO("%s: CONNECT - device=%s (dev_type=%d, addr_type=%d)", __func__,
+ params->bda1->ToString().c_str(), params->u1, params->u2);
if (params->u1 == BT_DEVICE_TYPE_BLE)
BTM_SecAddBleDevice(*params->bda1, NULL, BT_DEVICE_TYPE_BLE,
case 0x03: /* Disconnect */
{
- LOG_DEBUG("%s: DISCONNECT - conn_id=%d", __func__, test_cb.conn_id);
+ LOG_INFO("%s: DISCONNECT - conn_id=%d", __func__, test_cb.conn_id);
GATT_Disconnect(test_cb.conn_id);
break;
}
return (bt_status_t)0;
}
- LOG_DEBUG("%s: DISCOVER (%s), conn_id=%d, uuid=%s, handles=0x%04x-0x%04x",
- __func__, disc_name[params->u1], test_cb.conn_id,
- params->uuid1->ToString().c_str(), params->u2, params->u3);
+ LOG_INFO("%s: DISCOVER (%s), conn_id=%d, uuid=%s, handles=0x%04x-0x%04x",
+ __func__, disc_name[params->u1], test_cb.conn_id,
+ params->uuid1->ToString().c_str(), params->u2, params->u3);
GATTC_Discover(test_cb.conn_id, params->u1, params->u2, params->u3,
*params->uuid1);
break;
}
case 0xF0: /* Pairing configuration */
- LOG_DEBUG("%s: Setting pairing config auth=%d, iocaps=%d, keys=%d/%d/%d",
- __func__, params->u1, params->u2, params->u3, params->u4,
- params->u5);
+ LOG_INFO("%s: Setting pairing config auth=%d, iocaps=%d, keys=%d/%d/%d",
+ __func__, params->u1, params->u2, params->u3, params->u4,
+ params->u5);
bte_appl_cfg.ble_auth_req = params->u1;
bte_appl_cfg.ble_io_cap = params->u2;
break;
}
flags |= BTSOCK_FLAG_LE_COC;
- LOG_DEBUG(
+ LOG_INFO(
"%s: type=BTSOCK_L2CAP_LE, channel=0x%x, original=0x%x, flags=0x%x",
__func__, channel, original_channel, flags);
BTA_DmAddBleDevice(*bd_addr, addr_type, device_type);
}
- LOG_DEBUG("%s: type=BTSOCK_L2CAP_LE, channel=0x%x, flags=0x%x", __func__,
- channel, flags);
+ LOG_INFO("%s: type=BTSOCK_L2CAP_LE, channel=0x%x, flags=0x%x", __func__,
+ channel, flags);
status = btsock_l2cap_connect(bd_addr, channel, sock_fd, flags, app_uid);
break;
}
}
if ((sock->channel >= 0) && (sock->server)) {
BTA_JvFreeChannel(sock->channel, BTA_JV_CONN_TYPE_L2CAP_LE);
- LOG_DEBUG("Stopped L2CAP LE COC server socket_id:%u channel:%u", sock->id,
- sock->channel);
+ LOG_INFO("Stopped L2CAP LE COC server socket_id:%u channel:%u", sock->id,
+ sock->channel);
BTA_JvL2capStopServer(sock->channel, sock->id);
}
} else {
sock->id++;
}
last_sock_id = sock->id;
- LOG_DEBUG("Allocated l2cap socket structure socket_id:%u", sock->id);
+ LOG_INFO("Allocated l2cap socket structure socket_id:%u", sock->id);
return sock;
fail_sockpair:
}
static inline bool send_app_psm_or_chan_l(l2cap_socket* sock) {
- LOG_DEBUG("Sending l2cap socket socket_id:%u channel:%d", sock->id,
- sock->channel);
+ LOG_INFO("Sending l2cap socket socket_id:%u channel:%d", sock->id,
+ sock->channel);
return sock_send_all(sock->our_fd, (const uint8_t*)&sock->channel,
sizeof(sock->channel)) == sizeof(sock->channel);
}
if (!sock->server_psm_sent) {
if (!send_app_psm_or_chan_l(sock)) {
// closed
- LOG_DEBUG("Unable to send socket to application socket_id:%u", sock->id);
+ LOG_INFO("Unable to send socket to application socket_id:%u", sock->id);
btsock_l2cap_free_l(sock);
} else {
sock->server_psm_sent = true;
// start monitoring the socketpair to get call back when app writing data
btsock_thread_add_fd(pth, sock->our_fd, BTSOCK_L2CAP, SOCK_THREAD_FD_RD,
sock->id);
- LOG_DEBUG("Connected l2cap socket socket_id:%u", sock->id);
+ LOG_INFO("Connected l2cap socket socket_id:%u", sock->id);
sock->connected = true;
}
LOG_ERROR("unable to allocate RFCOMM slot");
return BT_STATUS_FAIL;
}
- LOG_DEBUG("Adding listening socket service_name: %s - channel: %d",
- service_name, channel);
+ LOG_INFO("Adding listening socket service_name: %s - channel: %d",
+ service_name, channel);
BTA_JvGetChannelId(BTA_JV_CONN_TYPE_RFCOMM, slot->id, channel);
*sock_fd = slot->app_fd; // Transfer ownership of fd to caller.
/*TODO:
}
if (need_process_data_fd) process_data_sock(h, pfds, ret);
} else {
- LOG_DEBUG("no data, select ret: %d", ret);
+ LOG_INFO("no data, select ret: %d", ret);
};
}
LOG_INFO("socket poll thread exiting, h:%d", h);
bt_status_t btif_storage_remove_bonded_device(
const RawAddress* remote_bd_addr) {
std::string bdstr = remote_bd_addr->ToString();
- LOG_DEBUG("Removing bonded device addr:%s", bdstr.c_str());
+ LOG_INFO("Removing bonded device addr:%s", bdstr.c_str());
btif_storage_remove_ble_bonding_keys(remote_bd_addr);
bt_status_t btif_storage_remove_ble_bonding_keys(
const RawAddress* remote_bd_addr) {
std::string bdstr = remote_bd_addr->ToString();
- LOG_DEBUG("Removing bonding keys for bd addr:%s", bdstr.c_str());
+ LOG_INFO("Removing bonding keys for bd addr:%s", bdstr.c_str());
int ret = 1;
if (btif_config_exist(bdstr, "LE_KEY_PENC"))
ret &= btif_config_remove(bdstr, "LE_KEY_PENC");
std::optional<std::vector<uint8_t>> FromHexString(const std::string& str) {
if (str.size() % 2 != 0) {
- LOG_DEBUG("str size is not divisible by 2, size is %zu", str.size());
+ LOG_INFO("str size is not divisible by 2, size is %zu", str.size());
return std::nullopt;
}
if (std::find_if_not(str.begin(), str.end(), IsHexDigit{}) != str.end()) {
- LOG_DEBUG("value contains none hex digit");
+ LOG_INFO("value contains none hex digit");
return std::nullopt;
}
std::vector<uint8_t> value;
uint8_t v = 0;
auto ret = std::from_chars(str.c_str() + i, str.c_str() + i + 2, v, 16);
if (std::make_error_code(ret.ec)) {
- LOG_DEBUG("failed to parse hex char at index %zu", i);
+ LOG_INFO("failed to parse hex char at index %zu", i);
return std::nullopt;
}
value.push_back(v);
errno = 0;
int64_t value = std::strtoll(str.c_str(), &ptr, 10);
if (errno != 0) {
- LOG_DEBUG("cannot parse string '%s' with error '%s'", str.c_str(), strerror(errno));
+ LOG_INFO("cannot parse string '%s' with error '%s'", str.c_str(), strerror(errno));
return std::nullopt;
}
if (ptr == str.c_str()) {
- LOG_DEBUG("string '%s' is empty or has wrong format", str.c_str());
+ LOG_INFO("string '%s' is empty or has wrong format", str.c_str());
return std::nullopt;
}
if (ptr != (str.c_str() + str.size())) {
- LOG_DEBUG("cannot parse whole string '%s'", str.c_str());
+ LOG_INFO("cannot parse whole string '%s'", str.c_str());
return std::nullopt;
}
return value;
std::optional<uint64_t> Uint64FromString(const std::string& str) {
if (str.find('-') != std::string::npos) {
- LOG_DEBUG("string '%s' contains minus sign, this function is for unsigned", str.c_str());
+ LOG_INFO("string '%s' contains minus sign, this function is for unsigned", str.c_str());
return std::nullopt;
}
char* ptr = nullptr;
errno = 0;
uint64_t value = std::strtoull(str.c_str(), &ptr, 10);
if (errno != 0) {
- LOG_DEBUG("cannot parse string '%s' with error '%s'", str.c_str(), strerror(errno));
+ LOG_INFO("cannot parse string '%s' with error '%s'", str.c_str(), strerror(errno));
return std::nullopt;
}
if (ptr == str.c_str()) {
- LOG_DEBUG("string '%s' is empty or has wrong format", str.c_str());
+ LOG_INFO("string '%s' is empty or has wrong format", str.c_str());
return std::nullopt;
}
if (ptr != (str.c_str() + str.size())) {
- LOG_DEBUG("cannot parse whole string '%s'", str.c_str());
+ LOG_INFO("cannot parse whole string '%s'", str.c_str());
return std::nullopt;
}
return value;
} else if (str == "false") {
return false;
} else {
- LOG_DEBUG("string '%s' is neither true nor false", str.c_str());
+ LOG_INFO("string '%s' is neither true nor false", str.c_str());
return std::nullopt;
}
}
log levels are available.
* LOG_VERBOSE(fmt, args...): Will be disabled by default
-* LOG_DEBUG(fmt, args...): Will be disabled by default
+* LOG_INFO(fmt, args...): Will be disabled by default
* LOG_INFO(fmt, args...): Enabled
* LOG_WARN(fmt, args...): Enabled
* LOG_ERROR(fmt, args...): Enabled
}
if (DBG) {
- LOG_DEBUG(
+ LOG_INFO(
"Integer Field_name:%s privacy_level:%s old_value:%d / 0x%x ==> new_value:%d\n",
field.name()->c_str(),
PrivacyLevelName(privacy_level),
break;
}
if (DBG) {
- LOG_DEBUG(
+ LOG_INFO(
"Float Field_name:%s privacy_level:%s old_value:%f ==> new_value:%f",
field.name()->c_str(),
PrivacyLevelName(privacy_level),
break;
}
if (DBG) {
- LOG_DEBUG(
+ LOG_INFO(
"%s Field_name:%s size:%u privacy_level:%s old_string:%s ==> new_string:%s",
__func__,
field.name()->c_str(),
flatbuffers::SetFieldT(table, field, nullptr);
internal::ScrubFromTable(table, field_offset);
if (DBG) {
- LOG_DEBUG(
+ LOG_INFO(
" Table Removing field name:%s privacy_level:%s", field.name()->c_str(), PrivacyLevelName(privacy_level));
}
}
while (!context->IsCancelled()) {
// Wait for 500 ms so that cancellation can be caught in amortized 250 ms latency
if (pending_events_.wait_to_take(500ms)) {
- LOG_DEBUG("%s: Got event after queue", log_name_.c_str());
+ LOG_INFO("%s: Got event after queue", log_name_.c_str());
writer->Write(pending_events_.take());
}
}
*/
void OnIncomingEvent(T event) {
if (!running_) {
- LOG_DEBUG("%s: Discarding an event while not running the loop", log_name_.c_str());
+ LOG_INFO("%s: Discarding an event while not running the loop", log_name_.c_str());
return;
}
- LOG_DEBUG("%s: Got event before queue", log_name_.c_str());
+ LOG_INFO("%s: Got event before queue", log_name_.c_str());
pending_events_.push(std::move(event));
}
}
void OnMasterLinkKeyComplete(KeyFlag key_flag) override {
- LOG_DEBUG("key_flag:%s", KeyFlagText(key_flag).c_str());
+ LOG_INFO("key_flag:%s", KeyFlagText(key_flag).c_str());
}
void OnRoleChange(Role new_role) override {
- LOG_DEBUG("new_role:%d", (uint8_t)new_role);
+ LOG_INFO("new_role:%d", (uint8_t)new_role);
}
void OnReadLinkPolicySettingsComplete(uint16_t link_policy_settings) override {
- LOG_DEBUG("link_policy_settings:%d", link_policy_settings);
+ LOG_INFO("link_policy_settings:%d", link_policy_settings);
}
void OnConnectionPacketTypeChanged(uint16_t packet_type) override {
- LOG_DEBUG("OnConnectionPacketTypeChanged packet_type:%d", packet_type);
+ LOG_INFO("OnConnectionPacketTypeChanged packet_type:%d", packet_type);
}
void OnAuthenticationComplete() override {
- LOG_DEBUG("OnAuthenticationComplete");
+ LOG_INFO("OnAuthenticationComplete");
}
void OnEncryptionChange(EncryptionEnabled enabled) override {
- LOG_DEBUG("OnConnectionPacketTypeChanged enabled:%d", (uint8_t)enabled);
+ LOG_INFO("OnConnectionPacketTypeChanged enabled:%d", (uint8_t)enabled);
}
void OnChangeConnectionLinkKeyComplete() override {
- LOG_DEBUG("OnChangeConnectionLinkKeyComplete");
+ LOG_INFO("OnChangeConnectionLinkKeyComplete");
};
void OnReadClockOffsetComplete(uint16_t clock_offset) override {
- LOG_DEBUG("OnReadClockOffsetComplete clock_offset:%d", clock_offset);
+ LOG_INFO("OnReadClockOffsetComplete clock_offset:%d", clock_offset);
};
void OnModeChange(Mode current_mode, uint16_t interval) override {
- LOG_DEBUG("OnModeChange Mode:%d, interval:%d", (uint8_t)current_mode, interval);
+ LOG_INFO("OnModeChange Mode:%d, interval:%d", (uint8_t)current_mode, interval);
};
void OnQosSetupComplete(
uint32_t peak_bandwidth,
uint32_t latency,
uint32_t delay_variation) override {
- LOG_DEBUG(
+ LOG_INFO(
"OnQosSetupComplete service_type:%d, token_rate:%d, peak_bandwidth:%d, latency:%d, delay_variation:%d",
(uint8_t)service_type,
token_rate,
uint32_t token_bucket_size,
uint32_t peak_bandwidth,
uint32_t access_latency) override {
- LOG_DEBUG(
+ LOG_INFO(
"OnFlowSpecificationComplete flow_direction:%d. service_type:%d, token_rate:%d, token_bucket_size:%d, "
"peak_bandwidth:%d, access_latency:%d",
(uint8_t)flow_direction,
}
void OnFlushOccurred() override {
- LOG_DEBUG("OnFlushOccurred");
+ LOG_INFO("OnFlushOccurred");
}
void OnRoleDiscoveryComplete(Role current_role) override {
- LOG_DEBUG("OnRoleDiscoveryComplete current_role:%d", (uint8_t)current_role);
+ LOG_INFO("OnRoleDiscoveryComplete current_role:%d", (uint8_t)current_role);
}
void OnReadAutomaticFlushTimeoutComplete(uint16_t flush_timeout) override {
- LOG_DEBUG("OnReadAutomaticFlushTimeoutComplete flush_timeout:%d", flush_timeout);
+ LOG_INFO("OnReadAutomaticFlushTimeoutComplete flush_timeout:%d", flush_timeout);
}
void OnReadTransmitPowerLevelComplete(uint8_t transmit_power_level) override {
- LOG_DEBUG("OnReadTransmitPowerLevelComplete transmit_power_level:%d", transmit_power_level);
+ LOG_INFO("OnReadTransmitPowerLevelComplete transmit_power_level:%d", transmit_power_level);
}
void OnReadLinkSupervisionTimeoutComplete(uint16_t link_supervision_timeout) override {
- LOG_DEBUG("OnReadLinkSupervisionTimeoutComplete link_supervision_timeout:%d", link_supervision_timeout);
+ LOG_INFO("OnReadLinkSupervisionTimeoutComplete link_supervision_timeout:%d", link_supervision_timeout);
}
void OnReadFailedContactCounterComplete(uint16_t failed_contact_counter) override {
- LOG_DEBUG("OnReadFailedContactCounterComplete failed_contact_counter:%d", failed_contact_counter);
+ LOG_INFO("OnReadFailedContactCounterComplete failed_contact_counter:%d", failed_contact_counter);
}
void OnReadLinkQualityComplete(uint8_t link_quality) override {
- LOG_DEBUG("OnReadLinkQualityComplete link_quality:%d", link_quality);
+ LOG_INFO("OnReadLinkQualityComplete link_quality:%d", link_quality);
}
void OnReadAfhChannelMapComplete(AfhMode afh_mode, std::array<uint8_t, 10> afh_channel_map) override {
- LOG_DEBUG("OnReadAfhChannelMapComplete afh_mode:%d", (uint8_t)afh_mode);
+ LOG_INFO("OnReadAfhChannelMapComplete afh_mode:%d", (uint8_t)afh_mode);
}
void OnReadRssiComplete(uint8_t rssi) override {
- LOG_DEBUG("OnReadRssiComplete rssi:%d", rssi);
+ LOG_INFO("OnReadRssiComplete rssi:%d", rssi);
}
void OnReadClockComplete(uint32_t clock, uint16_t accuracy) override {
- LOG_DEBUG("OnReadClockComplete clock:%d, accuracy:%d", clock, accuracy);
+ LOG_INFO("OnReadClockComplete clock:%d, accuracy:%d", clock, accuracy);
}
void OnDisconnection(ErrorCode reason) override {
- LOG_DEBUG("OnDisconnection reason: %s", ErrorCodeText(reason).c_str());
+ LOG_INFO("OnDisconnection reason: %s", ErrorCodeText(reason).c_str());
std::unique_ptr<BasePacketBuilder> builder =
DisconnectionCompleteBuilder::Create(ErrorCode::SUCCESS, handle_, reason);
ConnectionEvent disconnection;
}
void OnReadRemoteVersionInformationComplete(
uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) override {
- LOG_DEBUG(
+ LOG_INFO(
"OnReadRemoteVersionInformationComplete lmp_version:%hhu manufacturer_name:%hu sub_version:%hu",
lmp_version,
manufacturer_name,
}
void OnLeConnectSuccess(AddressWithType address_with_type, std::unique_ptr<LeAclConnection> connection) override {
- LOG_DEBUG("%s", address_with_type.ToString().c_str());
+ LOG_INFO("%s", address_with_type.ToString().c_str());
std::unique_lock<std::mutex> lock(acl_connections_mutex_);
auto addr = address_with_type.GetAddress();
: handle_(handle), connection_(std::move(connection)), event_stream_(std::move(event_stream)) {}
void OnConnectionUpdate(
uint16_t connection_interval, uint16_t connection_latency, uint16_t supervision_timeout) override {
- LOG_DEBUG(
+ LOG_INFO(
"interval: 0x%hx, latency: 0x%hx, timeout 0x%hx",
connection_interval,
connection_latency,
}
void OnDataLengthChange(uint16_t tx_octets, uint16_t tx_time, uint16_t rx_octets, uint16_t rx_time) override {
- LOG_DEBUG(
+ LOG_INFO(
"tx_octets: 0x%hx, tx_time: 0x%hx, rx_octets 0x%hx, rx_time 0x%hx", tx_octets, tx_time, rx_octets, rx_time);
}
void OnDisconnection(ErrorCode reason) override {
void LeAddressManager::register_client(LeAddressManagerCallback* callback) {
registered_clients_.insert(std::pair<LeAddressManagerCallback*, ClientState>(callback, ClientState::RESUMED));
if (address_policy_ == AddressPolicy::POLICY_NOT_SET) {
- LOG_DEBUG("address policy isn't set yet, pause clients and return");
+ LOG_INFO("address policy isn't set yet, pause clients and return");
pause_registered_clients();
return;
} else if (
for (auto client : registered_clients_) {
if (client.second != ClientState::PAUSED) {
// make sure all client paused, if not, this function will be trigger again by ack_pause
- LOG_DEBUG("waiting for ack_pause, return");
+ LOG_INFO("waiting for ack_pause, return");
return;
}
}
return;
}
std::string op_code = OpCodeText(view.GetCommandOpCode());
- LOG_DEBUG("Received command complete with op_code %s", op_code.c_str());
+ LOG_INFO("Received command complete with op_code %s", op_code.c_str());
// The command was sent before any client registered, we can make sure all the clients paused when command complete.
if (view.GetCommandOpCode() == OpCode::LE_SET_RANDOM_ADDRESS &&
address_policy_ == AddressPolicy::USE_STATIC_ADDRESS) {
- LOG_DEBUG("Received LE_SET_RANDOM_ADDRESS complete and Address policy is USE_STATIC_ADDRESS, return");
+ LOG_INFO("Received LE_SET_RANDOM_ADDRESS complete and Address policy is USE_STATIC_ADDRESS, return");
return;
}
return;
}
if (acquired_) {
- LOG_DEBUG("%s was already acquired", ToString().c_str());
+ LOG_INFO("%s was already acquired", ToString().c_str());
return;
}
acquired_ = true;
return;
}
if (!acquired_) {
- LOG_DEBUG("%s was already released", ToString().c_str());
+ LOG_INFO("%s was already released", ToString().c_str());
return;
}
acquired_ = false;
}
void Link::OnConnectionPacketTypeChanged(uint16_t packet_type) {
- LOG_DEBUG("UNIMPLEMENTED %s packet_type:%x", __func__, packet_type);
+ LOG_INFO("UNIMPLEMENTED %s packet_type:%x", __func__, packet_type);
}
void Link::OnAuthenticationComplete() {
}
void Link::OnChangeConnectionLinkKeyComplete() {
- LOG_DEBUG("UNIMPLEMENTED %s", __func__);
+ LOG_INFO("UNIMPLEMENTED %s", __func__);
}
void Link::OnReadClockOffsetComplete(uint16_t clock_offset) {
- LOG_DEBUG("UNIMPLEMENTED %s clock_offset:%d", __func__, clock_offset);
+ LOG_INFO("UNIMPLEMENTED %s clock_offset:%d", __func__, clock_offset);
}
void Link::OnModeChange(hci::Mode current_mode, uint16_t interval) {
- LOG_DEBUG("UNIMPLEMENTED %s mode:%s interval:%d", __func__, hci::ModeText(current_mode).c_str(), interval);
+ LOG_INFO("UNIMPLEMENTED %s mode:%s interval:%d", __func__, hci::ModeText(current_mode).c_str(), interval);
}
void Link::OnQosSetupComplete(hci::ServiceType service_type, uint32_t token_rate, uint32_t peak_bandwidth,
uint32_t latency, uint32_t delay_variation) {
- LOG_DEBUG("UNIMPLEMENTED %s service_type:%s token_rate:%d peak_bandwidth:%d latency:%d delay_varitation:%d", __func__,
- hci::ServiceTypeText(service_type).c_str(), token_rate, peak_bandwidth, latency, delay_variation);
+ LOG_INFO(
+ "UNIMPLEMENTED %s service_type:%s token_rate:%d peak_bandwidth:%d latency:%d delay_varitation:%d",
+ __func__,
+ hci::ServiceTypeText(service_type).c_str(),
+ token_rate,
+ peak_bandwidth,
+ latency,
+ delay_variation);
}
void Link::OnFlowSpecificationComplete(hci::FlowDirection flow_direction, hci::ServiceType service_type,
uint32_t token_rate, uint32_t token_bucket_size, uint32_t peak_bandwidth,
uint32_t access_latency) {
- LOG_DEBUG(
+ LOG_INFO(
"UNIMPLEMENTED %s flow_direction:%s service_type:%s token_rate:%d token_bucket_size:%d peak_bandwidth:%d "
"access_latency:%d",
- __func__, hci::FlowDirectionText(flow_direction).c_str(), hci::ServiceTypeText(service_type).c_str(), token_rate,
- token_bucket_size, peak_bandwidth, access_latency);
+ __func__,
+ hci::FlowDirectionText(flow_direction).c_str(),
+ hci::ServiceTypeText(service_type).c_str(),
+ token_rate,
+ token_bucket_size,
+ peak_bandwidth,
+ access_latency);
}
void Link::OnFlushOccurred() {
- LOG_DEBUG("UNIMPLEMENTED %s", __func__);
+ LOG_INFO("UNIMPLEMENTED %s", __func__);
}
void Link::OnRoleDiscoveryComplete(hci::Role current_role) {
- LOG_DEBUG("UNIMPLEMENTED %s current_role:%s", __func__, hci::RoleText(current_role).c_str());
+ LOG_INFO("UNIMPLEMENTED %s current_role:%s", __func__, hci::RoleText(current_role).c_str());
}
void Link::OnReadLinkPolicySettingsComplete(uint16_t link_policy_settings) {
- LOG_DEBUG("UNIMPLEMENTED %s link_policy_settings:0x%x", __func__, link_policy_settings);
+ LOG_INFO("UNIMPLEMENTED %s link_policy_settings:0x%x", __func__, link_policy_settings);
}
void Link::OnReadAutomaticFlushTimeoutComplete(uint16_t flush_timeout) {
- LOG_DEBUG("UNIMPLEMENTED %s flush_timeout:%d", __func__, flush_timeout);
+ LOG_INFO("UNIMPLEMENTED %s flush_timeout:%d", __func__, flush_timeout);
}
void Link::OnReadTransmitPowerLevelComplete(uint8_t transmit_power_level) {
- LOG_DEBUG("UNIMPLEMENTED %s transmit_power_level:%d", __func__, transmit_power_level);
+ LOG_INFO("UNIMPLEMENTED %s transmit_power_level:%d", __func__, transmit_power_level);
}
void Link::OnReadLinkSupervisionTimeoutComplete(uint16_t link_supervision_timeout) {
- LOG_DEBUG("UNIMPLEMENTED %s link_supervision_timeout:%d", __func__, link_supervision_timeout);
+ LOG_INFO("UNIMPLEMENTED %s link_supervision_timeout:%d", __func__, link_supervision_timeout);
}
void Link::OnReadFailedContactCounterComplete(uint16_t failed_contact_counter) {
- LOG_DEBUG("UNIMPLEMENTED %sfailed_contact_counter:%hu", __func__, failed_contact_counter);
+ LOG_INFO("UNIMPLEMENTED %sfailed_contact_counter:%hu", __func__, failed_contact_counter);
}
void Link::OnReadLinkQualityComplete(uint8_t link_quality) {
- LOG_DEBUG("UNIMPLEMENTED %s link_quality:%hhu", __func__, link_quality);
+ LOG_INFO("UNIMPLEMENTED %s link_quality:%hhu", __func__, link_quality);
}
void Link::OnReadAfhChannelMapComplete(hci::AfhMode afh_mode, std::array<uint8_t, 10> afh_channel_map) {
- LOG_DEBUG("UNIMPLEMENTED %s afh_mode:%s", __func__, hci::AfhModeText(afh_mode).c_str());
+ LOG_INFO("UNIMPLEMENTED %s afh_mode:%s", __func__, hci::AfhModeText(afh_mode).c_str());
}
void Link::OnReadRssiComplete(uint8_t rssi) {
- LOG_DEBUG("UNIMPLEMENTED %s rssi:%hhd", __func__, rssi);
+ LOG_INFO("UNIMPLEMENTED %s rssi:%hhd", __func__, rssi);
}
void Link::OnReadClockComplete(uint32_t clock, uint16_t accuracy) {
- LOG_DEBUG("UNIMPLEMENTED %s clock:%u accuracy:%hu", __func__, clock, accuracy);
+ LOG_INFO("UNIMPLEMENTED %s clock:%u accuracy:%hu", __func__, clock, accuracy);
}
void Link::OnMasterLinkKeyComplete(hci::KeyFlag key_flag) {
- LOG_DEBUG("UNIMPLEMENTED key_flag:%s", hci::KeyFlagText(key_flag).c_str());
+ LOG_INFO("UNIMPLEMENTED key_flag:%s", hci::KeyFlagText(key_flag).c_str());
}
void Link::OnRoleChange(hci::Role new_role) {
- LOG_DEBUG("UNIMPLEMENTED role:%s", hci::RoleText(new_role).c_str());
+ LOG_INFO("UNIMPLEMENTED role:%s", hci::RoleText(new_role).c_str());
}
void Link::OnDisconnection(hci::ErrorCode reason) {
OnAclDisconnected(reason);
}
void Link::OnReadRemoteVersionInformationComplete(
uint8_t lmp_version, uint16_t manufacturer_name, uint16_t sub_version) {
- LOG_DEBUG(
+ LOG_INFO(
"UNIMPLEMENTED lmp_version:%hhu manufacturer_name:%hu sub_version:%hu",
lmp_version,
manufacturer_name,
auto pending_link = pending_links_.find(device);
if (pending_link == pending_links_.end()) {
// There is no pending link, exit
- LOG_DEBUG("Connection to %s failed without a pending link; reason: %s", device.ToString().c_str(),
- hci::ErrorCodeText(reason).c_str());
+ LOG_INFO(
+ "Connection to %s failed without a pending link; reason: %s",
+ device.ToString().c_str(),
+ hci::ErrorCodeText(reason).c_str());
if (pending_dynamic_channels_callbacks_.find(device) != pending_dynamic_channels_callbacks_.end()) {
for (Link::PendingDynamicChannelConnection& callbacks : pending_dynamic_channels_callbacks_[device]) {
callbacks.on_fail_callback_.Invoke(DynamicChannelManager::ConnectionResult{
if (can_negotiate) {
send_configuration_request(channel->GetRemoteCid(), std::move(negotiation_config));
} else {
- LOG_DEBUG("No suggested parameter received");
+ LOG_INFO("No suggested parameter received");
}
}
return;
}
if (acquired_) {
- LOG_DEBUG("%s was already acquired", ToString().c_str());
+ LOG_INFO("%s was already acquired", ToString().c_str());
return;
}
acquired_ = true;
return;
}
if (!acquired_) {
- LOG_DEBUG("%s was already released", ToString().c_str());
+ LOG_INFO("%s was already released", ToString().c_str());
return;
}
acquired_ = false;
}
void Link::OnConnectionUpdate(uint16_t connection_interval, uint16_t connection_latency, uint16_t supervision_timeout) {
- LOG_DEBUG("interval %hx latency %hx supervision_timeout %hx", connection_interval, connection_latency,
- supervision_timeout);
+ LOG_INFO(
+ "interval %hx latency %hx supervision_timeout %hx", connection_interval, connection_latency, supervision_timeout);
if (update_request_signal_id_ != kInvalidSignalId) {
hci::ErrorCode result = hci::ErrorCode::SUCCESS;
if (connection_interval > update_request_interval_max_ || connection_interval < update_request_interval_min_ ||
}
void Link::OnDataLengthChange(uint16_t tx_octets, uint16_t tx_time, uint16_t rx_octets, uint16_t rx_time) {
- LOG_DEBUG("tx_octets %hx tx_time %hx rx_octets %hx rx_time %hx", tx_octets, tx_time, rx_octets, rx_time);
+ LOG_INFO("tx_octets %hx tx_time %hx rx_octets %hx rx_time %hx", tx_octets, tx_time, rx_octets, rx_time);
}
void Link::Disconnect() {
acl_connection_->Disconnect(hci::DisconnectReason::REMOTE_USER_TERMINATED_CONNECTION);
auto pending_link = pending_links_.find(address_with_type);
if (pending_link == pending_links_.end()) {
// There is no pending link, exit
- LOG_DEBUG("Connection to %s failed without a pending link", address_with_type.ToString().c_str());
+ LOG_INFO("Connection to %s failed without a pending link", address_with_type.ToString().c_str());
return;
}
for (auto& pending_fixed_channel_connection : pending_link->second.pending_fixed_channel_connections_) {
hci_layer_->EnqueueCommand(
hci::ReadNumberOfSupportedIacBuilder::Create(), handler_->BindOnceOn(this, &impl::OnCommandComplete));
- LOG_DEBUG("Started discoverability module");
+ LOG_INFO("Started discoverability module");
}
void neighbor::DiscoverabilityModule::impl::Dump() const {
- LOG_DEBUG("Number of supported iacs:%hhd", num_supported_iac_);
- LOG_DEBUG("Number of current iacs:%zd", laps_.size());
+ LOG_INFO("Number of supported iacs:%hhd", num_supported_iac_);
+ LOG_INFO("Number of current iacs:%zd", laps_.size());
for (auto it : laps_) {
- LOG_DEBUG(" discoverability lap:%x", it.lap_);
+ LOG_INFO(" discoverability lap:%x", it.lap_);
}
}
auto packet = hci::InquiryStatusView::Create(status);
ASSERT(packet.IsValid());
if (active_limited_one_shot_ || active_general_one_shot_) {
- LOG_DEBUG("Inquiry started lap: %s", active_limited_one_shot_ ? "Limited" : "General");
+ LOG_INFO("Inquiry started lap: %s", active_limited_one_shot_ ? "Limited" : "General");
}
} break;
case hci::EventCode::INQUIRY_COMPLETE: {
auto packet = hci::InquiryCompleteView::Create(view);
ASSERT(packet.IsValid());
- LOG_DEBUG("inquiry complete");
+ LOG_INFO("inquiry complete");
active_limited_one_shot_ = false;
active_general_one_shot_ = false;
inquiry_callbacks_.complete(packet.GetStatus());
case hci::EventCode::INQUIRY_RESULT: {
auto packet = hci::InquiryResultView::Create(view);
ASSERT(packet.IsValid());
- LOG_DEBUG("Inquiry result size:%zd num_responses:%zu", packet.size(), packet.GetInquiryResults().size());
+ LOG_INFO("Inquiry result size:%zd num_responses:%zu", packet.size(), packet.GetInquiryResults().size());
inquiry_callbacks_.result(packet);
} break;
case hci::EventCode::INQUIRY_RESULT_WITH_RSSI: {
auto packet = hci::InquiryResultWithRssiView::Create(view);
ASSERT(packet.IsValid());
- LOG_DEBUG("Inquiry result with rssi num_responses:%zu", packet.GetInquiryResults().size());
+ LOG_INFO("Inquiry result with rssi num_responses:%zu", packet.GetInquiryResults().size());
inquiry_callbacks_.result_with_rssi(packet);
} break;
case hci::EventCode::EXTENDED_INQUIRY_RESULT: {
auto packet = hci::ExtendedInquiryResultView::Create(view);
ASSERT(packet.IsValid());
- LOG_DEBUG(
+ LOG_INFO(
"Extended inquiry result addr:%s repetition_mode:%s cod:%s clock_offset:%d rssi:%hhd",
packet.GetAddress().ToString().c_str(),
hci::PageScanRepetitionModeText(packet.GetPageScanRepetitionMode()).c_str(),
EnqueueCommandComplete(hci::ReadInquiryScanTypeBuilder::Create());
EnqueueCommandCompleteSync(hci::ReadInquiryModeBuilder::Create());
- LOG_DEBUG("Started inquiry module");
+ LOG_INFO("Started inquiry module");
}
void neighbor::InquiryModule::impl::Stop() {
hci::InquiryModeText(inquiry_mode_).c_str(),
hci::InquiryScanTypeText(inquiry_scan_type_).c_str());
LOG_INFO("Inquiry response tx power:%hhd", inquiry_response_tx_power_);
- LOG_DEBUG("Stopped inquiry module");
+ LOG_INFO("Stopped inquiry module");
}
void neighbor::InquiryModule::impl::SetInquiryMode(hci::InquiryMode mode) {
EnqueueCommandComplete(hci::WriteInquiryModeBuilder::Create(mode));
inquiry_mode_ = mode;
- LOG_DEBUG("Set inquiry mode:%s", hci::InquiryModeText(mode).c_str());
+ LOG_INFO("Set inquiry mode:%s", hci::InquiryModeText(mode).c_str());
}
void neighbor::InquiryModule::impl::SetScanActivity(ScanParameters params) {
EnqueueCommandComplete(hci::WriteInquiryScanActivityBuilder::Create(params.interval, params.window));
inquiry_scan_ = params;
- LOG_DEBUG(
+ LOG_INFO(
"Set scan activity interval:0x%x/%.02fms window:0x%x/%.02fms",
params.interval,
ScanIntervalTimeMs(params.interval),
void neighbor::InquiryModule::impl::SetScanType(hci::InquiryScanType scan_type) {
EnqueueCommandComplete(hci::WriteInquiryScanTypeBuilder::Create(scan_type));
- LOG_DEBUG("Set scan type:%s", hci::InquiryScanTypeText(scan_type).c_str());
+ LOG_INFO("Set scan type:%s", hci::InquiryScanTypeText(scan_type).c_str());
}
bool neighbor::InquiryModule::impl::HasCallbacks() const {
hci::ClockOffsetValid clock_offset_valid,
ReadRemoteNameCallback callback,
os::Handler* handler) {
- LOG_DEBUG("%s Start read remote name request for %s", __func__, address.ToString().c_str());
+ LOG_INFO("%s Start read remote name request for %s", __func__, address.ToString().c_str());
if (read_callback_handler_map_.find(address) != read_callback_handler_map_.end()) {
LOG_WARN("Ignoring duplicate read remote name request to:%s", address.ToString().c_str());
void neighbor::NameModule::impl::CancelRemoteNameRequest(
hci::Address address, CancelRemoteNameCallback callback, os::Handler* handler) {
- LOG_DEBUG("%s Cancel remote name request for %s", __func__, address.ToString().c_str());
+ LOG_INFO("%s Cancel remote name request for %s", __func__, address.ToString().c_str());
if (cancel_callback_handler_map_.find(address) != cancel_callback_handler_map_.end()) {
LOG_WARN("Ignoring duplicate cancel remote name request to:%s", address.ToString().c_str());
}
void neighbor::PageModule::impl::Stop() {
- LOG_DEBUG("Page scan interval:%hd window:%hd", scan_parameters_.interval, scan_parameters_.window);
- LOG_DEBUG("Page scan_type:%s", hci::PageScanTypeText(scan_type_).c_str());
+ LOG_INFO("Page scan interval:%hd window:%hd", scan_parameters_.interval, scan_parameters_.window);
+ LOG_INFO("Page scan_type:%s", hci::PageScanTypeText(scan_type_).c_str());
}
void neighbor::PageModule::impl::SetScanActivity(ScanParameters params) {
hci_layer_->EnqueueCommand(
hci::ReadPageScanActivityBuilder::Create(), handler_->BindOnceOn(this, &impl::OnCommandComplete));
- LOG_DEBUG(
+ LOG_INFO(
"Set page scan activity interval:0x%x/%.02fms window:0x%x/%.02fms",
params.interval,
ScanIntervalTimeMs(params.interval),
hci_layer_->EnqueueCommand(
hci::ReadPageScanTypeBuilder::Create(), handler_->BindOnceOn(this, &impl::OnCommandComplete));
- LOG_DEBUG("Set page scan type:%s", hci::PageScanTypeText(scan_type).c_str());
+ LOG_INFO("Set page scan type:%s", hci::PageScanTypeText(scan_type).c_str());
}
void neighbor::PageModule::impl::SetTimeout(PageTimeout timeout) {
hci_layer_->EnqueueCommand(
hci::ReadPageTimeoutBuilder::Create(), handler_->BindOnceOn(this, &impl::OnCommandComplete));
- LOG_DEBUG("Set page scan timeout:0x%x/%.02fms", timeout, PageTimeoutMs(timeout));
+ LOG_INFO("Set page scan timeout:0x%x/%.02fms", timeout, PageTimeoutMs(timeout));
}
/**
}
void neighbor::ScanModule::impl::Stop() {
- LOG_DEBUG("inquiry scan enabled:%d page scan enabled:%d", inquiry_scan_enabled_, page_scan_enabled_);
+ LOG_INFO("inquiry scan enabled:%d page scan enabled:%d", inquiry_scan_enabled_, page_scan_enabled_);
}
neighbor::ScanModule::ScanModule() : pimpl_(std::make_unique<impl>(*this)) {}
s << "void CompareBytes(std::vector<uint8_t> captured_packet) {";
s << name_ << "View view = " << name_ << "View::FromBytes(captured_packet);";
s << "if (!view.IsValid()) { LOG_INFO(\"Invalid Packet Bytes (size = %zu)\", view.size());";
- s << "for (size_t i = 0; i < view.size(); i++) { LOG_DEBUG(\"%5zd:%02X\", i, *(view.begin() + i)); }}";
+ s << "for (size_t i = 0; i < view.size(); i++) { LOG_INFO(\"%5zd:%02X\", i, *(view.begin() + i)); }}";
s << "ASSERT_TRUE(view.IsValid());";
s << "auto packet = " << name_ << "Builder::FromView(view);";
s << "std::shared_ptr<std::vector<uint8_t>> packet_bytes = std::make_shared<std::vector<uint8_t>>();";
}
void OnConnectionClosed(hci::Address address) override {
- LOG_DEBUG("Called");
+ LOG_INFO("Called");
}
void OnEncryptionChange(hci::Address address, bool encrypted) override {}
void SecurityManagerImpl::OnConnectionClosed(hci::Address address) {
auto entry = pairing_handler_map_.find(address);
if (entry != pairing_handler_map_.end()) {
- LOG_DEBUG("Cancelling pairing handler for '%s'", address.ToString().c_str());
+ LOG_INFO("Cancelling pairing handler for '%s'", address.ToString().c_str());
entry->second->Cancel();
}
auto record = security_database_.FindOrCreate(hci::AddressWithType(address, hci::AddressType::PUBLIC_DEVICE_ADDRESS));
void ClassicPairingHandler::Initiate(bool locally_initiated, hci::IoCapability io_capability,
hci::OobDataPresent oob_present,
hci::AuthenticationRequirements auth_requirements) {
- LOG_DEBUG("Initiate");
+ LOG_INFO("Initiate");
locally_initiated_ = locally_initiated;
local_io_capability_ = io_capability;
local_oob_present_ = oob_present;
}
void OnConnectionClosed(hci::Address address) override {
- LOG_DEBUG("Called");
+ LOG_INFO("Called");
}
void OnEncryptionChange(hci::Address address, bool encrypted) override {}
}
void Write(std::unique_ptr<packet::RawBuilder> packet) {
- LOG_DEBUG("Writing packet cid:%hd size:%zd", cid_, packet->size());
+ LOG_INFO("Writing packet cid:%hd size:%zd", cid_, packet->size());
write_queue_.push(std::move(packet));
if (!enqueue_registered_) {
enqueue_registered_ = true;
}
void OnConnectionClosed(hci::ErrorCode error_code) {
- LOG_DEBUG(
+ LOG_INFO(
"Channel interface closed reason:%s cid:%hd device:%s",
hci::ErrorCodeText(error_code).c_str(),
cid_,
ConnectionInterfaceDescriptor cid,
l2cap::Cid remote_cid) {
hci::Address address = cid_to_interface_map_[cid]->GetRemoteAddress();
- LOG_DEBUG("Connection opened address:%s psm:%hd cid:%hd", address.ToString().c_str(), psm, cid);
+ LOG_INFO("Connection opened address:%s psm:%hd cid:%hd", address.ToString().c_str(), psm, cid);
on_complete(
address.ToString(),
static_cast<uint16_t>(psm),
void ConnectionFailed(
ConnectionCompleteCallback on_complete, hci::Address address, l2cap::Psm psm, ConnectionInterfaceDescriptor cid) {
- LOG_DEBUG("Connection failed address:%s psm:%hd", address.ToString().c_str(), psm);
+ LOG_INFO("Connection failed address:%s psm:%hd", address.ToString().c_str(), psm);
on_complete(address.ToString(), static_cast<uint16_t>(psm), static_cast<uint16_t>(cid), 0, kConnectionFailed);
}
cid,
std::make_unique<ConnectionInterface>(
cid, std::move(channel), handler_, [this](ConnectionInterfaceDescriptor cid) {
- LOG_DEBUG("Deleting connection interface cid:%hd", cid);
+ LOG_INFO("Deleting connection interface cid:%hd", cid);
auto connection = std::move(cid_to_interface_map_.at(cid));
handler_->Post(common::BindOnce(
&ConnectionInterfaceManager::ConnectionClosed, common::Unretained(this), cid, std::move(connection)));
pending_fail_(pending_fail) {}
void OnConnectionOpen(std::unique_ptr<l2cap::classic::DynamicChannel> channel) {
- LOG_DEBUG("Local initiated connection is open to device:%s for psm:%hd", address_.ToString().c_str(), psm_);
+ LOG_INFO("Local initiated connection is open to device:%s for psm:%hd", address_.ToString().c_str(), psm_);
ASSERT_LOG(
address_ == channel->GetDevice().GetAddress(), " Expected remote device does not match actual remote device");
pending_open_(std::move(channel));
}
void OnConnectionFailure(l2cap::classic::DynamicChannelManager::ConnectionResult result) {
- LOG_DEBUG("Connection failed to device:%s for psm:%hd", address_.ToString().c_str(), psm_);
+ LOG_INFO("Connection failed to device:%s for psm:%hd", address_.ToString().c_str(), psm_);
switch (result.connection_result_code) {
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::SUCCESS:
LOG_WARN("Connection failed result:success hci:%s", hci::ErrorCodeText(result.hci_error).c_str());
break;
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::FAIL_NO_SERVICE_REGISTERED:
- LOG_DEBUG(
- "Connection failed result:no service registered hci:%s", hci::ErrorCodeText(result.hci_error).c_str());
+ LOG_INFO("Connection failed result:no service registered hci:%s", hci::ErrorCodeText(result.hci_error).c_str());
break;
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::FAIL_HCI_ERROR:
- LOG_DEBUG("Connection failed result:hci error hci:%s", hci::ErrorCodeText(result.hci_error).c_str());
+ LOG_INFO("Connection failed result:hci error hci:%s", hci::ErrorCodeText(result.hci_error).c_str());
break;
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::FAIL_L2CAP_ERROR:
- LOG_DEBUG(
+ LOG_INFO(
"Connection failed result:l2cap error hci:%s l2cap:%s",
hci::ErrorCodeText(result.hci_error).c_str(),
l2cap::ConnectionResponseResultText(result.l2cap_connection_response_result).c_str());
break;
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::FAIL_REMOTE_NOT_SUPPORT:
- LOG_DEBUG("Connection failed result:Remote not support required retransmission and flow control mode");
+ LOG_INFO("Connection failed result:Remote not support required retransmission and flow control mode");
break;
case l2cap::classic::DynamicChannelManager::ConnectionResultCode::FAIL_SECURITY_BLOCK:
- LOG_DEBUG("Connection failed result:security block");
+ LOG_INFO("Connection failed result:security block");
break;
}
pending_fail_(result);
std::unique_ptr<l2cap::classic::DynamicChannelService> service_ = std::move(service);
switch (result) {
case l2cap::classic::DynamicChannelManager::RegistrationResult::SUCCESS:
- LOG_DEBUG("Service is registered for psm:%hd", service_->GetPsm());
+ LOG_INFO("Service is registered for psm:%hd", service_->GetPsm());
register_promise.set_value(service_->GetPsm());
psm_to_service_interface_map_->emplace(service_->GetPsm(), std::move(service_));
break;
ConnectionCompleteCallback on_complete,
ConnectionInterfaceManager* connection_interface_manager_,
std::unique_ptr<l2cap::classic::DynamicChannel> channel) {
- LOG_DEBUG("Remote initiated connection is open from device:%s", channel->GetDevice().ToString().c_str());
+ LOG_INFO("Remote initiated connection is open from device:%s", channel->GetDevice().ToString().c_str());
ConnectionInterfaceDescriptor cid = connection_interface_manager_->AllocateConnectionInterfaceDescriptor();
uint16_t remote_cid = channel->HACK_GetRemoteCid();
connection_interface_manager_->AddConnection(cid, std::move(channel));
connection_interface_manager_->ConnectionOpened(on_complete, psm, cid, remote_cid);
- LOG_DEBUG("connection open");
+ LOG_INFO("connection open");
},
psm,
on_complete,
for (auto* config_section : {&information_sections_, &persistent_devices_}) {
for (auto it = config_section->begin(); it != config_section->end();) {
if (it->second.contains(property)) {
- LOG_DEBUG("Removing persistent section %s with property %s", it->first.c_str(), property.c_str());
+ LOG_INFO("Removing persistent section %s with property %s", it->first.c_str(), property.c_str());
it = config_section->erase(it);
num_persistent_removed++;
continue;
}
for (auto it = temporary_devices_.begin(); it != temporary_devices_.end();) {
if (it->second.contains(property)) {
- LOG_DEBUG("Removing temporary section %s with property %s", it->first.c_str(), property.c_str());
+ LOG_INFO("Removing temporary section %s with property %s", it->first.c_str(), property.c_str());
it = temporary_devices_.erase(it);
continue;
}
hci_thread.DoInThread(FROM_HERE, base::Bind(&hci_initialize));
- LOG_DEBUG("%s starting async portion", __func__);
+ LOG_INFO("%s starting async portion", __func__);
return local_startup_future;
error:
snprintf(section_name, sizeof(section_name), "DID%d", i);
if (!config_has_section(*config, section_name)) {
- LOG_DEBUG("%s no section named %s.", __func__, section_name);
+ LOG_INFO("%s no section named %s.", __func__, section_name);
break;
}
continue;
}
- 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);
+ LOG_INFO("Device ID record %d : %s", i,
+ (record.primary_record ? "primary" : "not primary"));
+ LOG_INFO(" vendorId = %04x", record.vendor);
+ LOG_INFO(" vendorIdSource = %04x", record.vendor_id_source);
+ LOG_INFO(" product = %04x", record.product);
+ LOG_INFO(" version = %04x", record.version);
+ LOG_INFO(" clientExecutableURL = %s", record.client_executable_url);
+ LOG_INFO(" serviceDescription = %s", record.service_description);
+ LOG_INFO(" documentationURL = %s", record.documentation_url);
uint32_t record_handle;
tBTA_STATUS status = BTA_DmSetLocalDiRecord(&record, &record_handle);
LOG_INFO("%s", buffer);
break;
case TRACE_TYPE_DEBUG:
- LOG_DEBUG("%s", buffer);
+ LOG_INFO("%s", buffer);
break;
default:
/* we should never get this */
void OnReadRemoteVersionInformationComplete(uint8_t lmp_version,
uint16_t manufacturer_name,
uint16_t sub_version) override {
- LOG_DEBUG(
+ LOG_INFO(
"UNIMPLEMENTED lmp_version:%hhu manufacturer_name:%hu sub_version:%hu",
lmp_version, manufacturer_name, sub_version);
}
void bluetooth::shim::legacy::Acl::CreateClassicConnection(
const bluetooth::hci::Address& address) {
- LOG_DEBUG("%s Initiate the creation of a classic connection %s", __func__,
- address.ToString().c_str());
+ LOG_INFO("%s Initiate the creation of a classic connection %s", __func__,
+ address.ToString().c_str());
GetAclManager()->CreateConnection(address);
}
void bluetooth::shim::legacy::Acl::CreateLeConnection(
const bluetooth::hci::AddressWithType& address_with_type) {
- LOG_DEBUG("%s Initiate the creation of a le connection %s", __func__,
- address_with_type.ToString().c_str());
+ LOG_INFO("%s Initiate the creation of a le connection %s", __func__,
+ address_with_type.ToString().c_str());
GetAclManager()->CreateLeConnection(address_with_type);
}
handler_, std::move(connection)));
pimpl_->handle_to_classic_connection_map_[handle]->RegisterCallbacks();
- LOG_DEBUG("%s Classic ACL created successfully peer:%s", __func__,
- bd_addr.ToString().c_str());
+ LOG_INFO("%s Classic ACL created successfully peer:%s", __func__,
+ bd_addr.ToString().c_str());
btm_acl_connected(bd_addr, handle, HCI_SUCCESS, false);
}
std::make_unique<LeShimAclConnection>(handler_, std::move(connection)));
pimpl_->handle_to_le_connection_map_[handle]->RegisterCallbacks();
- LOG_DEBUG("%s Le ACL created successfully peer:%s", __func__,
- address_with_type.ToString().c_str());
+ LOG_INFO("%s Le ACL created successfully peer:%s", __func__,
+ address_with_type.ToString().c_str());
tBLE_BD_ADDR legacy_address_with_type =
ToLegacyAddressWithType(address_with_type);
LegacyInquiryCompleteCallback legacy_inquiry_complete_callback) {
switch (mode) {
case kInquiryModeOff:
- LOG_DEBUG("%s Stopping inquiry mode", __func__);
+ LOG_INFO("%s Stopping inquiry mode", __func__);
if (limited_inquiry_active_ || general_inquiry_active_) {
GetInquiry()->StopInquiry();
limited_inquiry_active_ = false;
case kLimitedInquiryMode:
case kGeneralInquiryMode: {
if (mode == kLimitedInquiryMode) {
- LOG_DEBUG(
+ LOG_INFO(
"%s Starting limited inquiry mode duration:%hhd max responses:%hhd",
__func__, duration, max_responses);
GetInquiry()->StartLimitedInquiry(duration, max_responses);
active_inquiry_mode_ = kLimitedInquiryMode;
} else {
- LOG_DEBUG(
+ LOG_INFO(
"%s Starting general inquiry mode duration:%hhd max responses:%hhd",
__func__, duration, max_responses);
}
void Btm::CancelInquiry() {
- LOG_DEBUG("%s", __func__);
+ LOG_INFO("%s", __func__);
if (limited_inquiry_active_ || general_inquiry_active_) {
GetInquiry()->StopInquiry();
limited_inquiry_active_ = false;
case kLimitedInquiryMode:
case kGeneralInquiryMode: {
if (mode == kLimitedInquiryMode) {
- LOG_DEBUG("%s Starting limited periodic inquiry mode", __func__);
+ LOG_INFO("%s Starting limited periodic inquiry mode", __func__);
limited_periodic_inquiry_active_ = true;
GetInquiry()->StartLimitedPeriodicInquiry(duration, max_responses,
max_delay, min_delay);
} else {
- LOG_DEBUG("%s Starting general periodic inquiry mode", __func__);
+ LOG_INFO("%s Starting general periodic inquiry mode", __func__);
general_periodic_inquiry_active_ = true;
GetInquiry()->StartGeneralPeriodicInquiry(duration, max_responses,
max_delay, min_delay);
return BTM_BUSY;
}
- LOG_DEBUG("%s Start read name from address:%s", __func__,
- raw_address.ToString().c_str());
+ LOG_INFO("%s Start read name from address:%s", __func__,
+ raw_address.ToString().c_str());
GetName()->ReadRemoteNameRequest(
ToGdAddress(raw_address), hci::PageScanRepetitionMode::R1,
0 /* clock_offset */, hci::ClockOffsetValid::INVALID,
};
std::copy(remote_name.begin(), remote_name.end(),
name.remote_bd_name);
- LOG_DEBUG("%s Finish read name from address:%s name:%s", __func__,
- address.ToString().c_str(), name.remote_bd_name);
+ LOG_INFO("%s Finish read name from address:%s name:%s", __func__,
+ address.ToString().c_str(), name.remote_bd_name);
callback(&name);
classic_read_remote_name->Stop();
},
LOG_WARN("%s Unable to start advertising", __func__);
return;
}
- LOG_DEBUG("%s Started advertising", __func__);
+ LOG_INFO("%s Started advertising", __func__);
}
void Btm::StopAdvertising() {
}
GetAdvertising()->RemoveAdvertiser(advertiser_id_);
advertiser_id_ = hci::LeAdvertisingManager::kInvalidId;
- LOG_DEBUG("%s Stopped advertising", __func__);
+ LOG_INFO("%s Stopped advertising", __func__);
}
void Btm::StartConnectability() { StartAdvertising(); }
} else if (device_type & BT_DEVICE_TYPE_BREDR) {
transport = BT_TRANSPORT_BR_EDR;
}
- LOG_DEBUG("%s guessing transport as %02x ", __func__, transport);
+ LOG_INFO("%s guessing transport as %02x ", __func__, transport);
}
auto security_manager = GetSecurityModule()->GetSecurityManager();
if (!Stack::GetInstance()->GetBtm()->StartInquiry(
classic_mode, inqparms.duration, 0,
[](uint16_t status, uint8_t inquiry_mode) {
- LOG_DEBUG("%s Inquiry is complete status:%hd inquiry_mode:%hhd",
- __func__, status, inquiry_mode);
+ LOG_INFO("%s Inquiry is complete status:%hd inquiry_mode:%hhd",
+ __func__, status, inquiry_mode);
btm_cb.btm_inq_vars.inqparms.mode &= ~(inquiry_mode);
btm_acl_update_inquiry_status(BTM_INQUIRY_COMPLETE);
btm_cb.btm_inq_vars.p_inq_cmpl_cb = nullptr;
if (btm_cb.btm_inq_vars.p_inq_cmpl_cb != nullptr) {
- LOG_DEBUG("%s Sending inquiry completion to upper layer",
- __func__);
+ LOG_INFO("%s Sending inquiry completion to upper layer",
+ __func__);
(btm_cb.btm_inq_vars.p_inq_cmpl_cb)(
(tBTM_INQUIRY_CMPL*)&btm_cb.btm_inq_vars.inq_cmpl_info);
btm_cb.btm_inq_vars.p_inq_cmpl_cb = nullptr;
if (duration_sec != 0) {
Stack::GetInstance()->GetBtm()->SetObservingTimer(
duration_sec * 1000, common::BindOnce([]() {
- LOG_DEBUG("%s observing timeout popped", __func__);
+ LOG_INFO("%s observing timeout popped", __func__);
Stack::GetInstance()->GetBtm()->CancelObservingTimer();
Stack::GetInstance()->GetBtm()->StopObserving();
}
void bluetooth::shim::BTM_CancelInquiry(void) {
- LOG_DEBUG("%s Cancel inquiry", __func__);
+ LOG_INFO("%s Cancel inquiry", __func__);
Stack::GetInstance()->GetBtm()->CancelInquiry();
btm_cb.btm_inq_vars.state = BTM_INQ_INACTIVE_STATE;
btm_cb.btm_inq_vars.inq_counter++;
if (btm_cb.btm_inq_vars.p_inq_cmpl_cb != nullptr) {
- LOG_DEBUG("%s Sending cancel inquiry completion to upper layer",
- __func__);
+ LOG_INFO("%s Sending cancel inquiry completion to upper layer", __func__);
(btm_cb.btm_inq_vars.p_inq_cmpl_cb)(
(tBTM_INQUIRY_CMPL*)&btm_cb.btm_inq_vars.inq_cmpl_info);
btm_cb.btm_inq_vars.p_inq_cmpl_cb = nullptr;
bool bluetooth::shim::BTM_SecRegister(const tBTM_APPL_INFO* bta_callbacks) {
CHECK(bta_callbacks != nullptr);
- LOG_DEBUG("%s Registering security application", __func__);
+ LOG_INFO("%s Registering security application", __func__);
if (bta_callbacks->p_pin_callback == nullptr) {
LOG_INFO("UNIMPLEMENTED %s pin_callback", __func__);
void OnTransmitPacketCommandComplete(command_complete_cb complete_callback,
void* context,
bluetooth::hci::CommandCompleteView view) {
- LOG_DEBUG("Received cmd complete for %s",
- bluetooth::hci::OpCodeText(view.GetCommandOpCode()).c_str());
+ LOG_INFO("Received cmd complete for %s",
+ bluetooth::hci::OpCodeText(view.GetCommandOpCode()).c_str());
std::vector<const uint8_t> data(view.begin(), view.end());
BT_HDR* response = WrapPacketAndCopy(MSG_HC_TO_STACK_HCI_EVT, &view);
complete_callback(response, context);
void OnTransmitPacketStatus(command_status_cb status_callback, void* context,
std::unique_ptr<OsiObject> command,
bluetooth::hci::CommandStatusView view) {
- LOG_DEBUG("Received cmd status %s for %s",
- bluetooth::hci::ErrorCodeText(view.GetStatus()).c_str(),
- bluetooth::hci::OpCodeText(view.GetCommandOpCode()).c_str());
+ LOG_INFO("Received cmd status %s for %s",
+ bluetooth::hci::ErrorCodeText(view.GetStatus()).c_str(),
+ bluetooth::hci::OpCodeText(view.GetCommandOpCode()).c_str());
uint8_t status = static_cast<uint8_t>(view.GetStatus());
status_callback(status, static_cast<BT_HDR*>(command->Release()), context);
}
LOG_INFO("Disable snooping on psm basis unsupported psm:%d", psm);
}
- LOG_DEBUG("Registering service on psm:%hd", psm);
+ LOG_INFO("Registering service on psm:%hd", psm);
RegisterServicePromise register_promise;
auto service_registered = register_promise.get_future();
bool use_ertm = false;
if (registered_psm != psm) {
LOG_WARN("Unable to register psm:%hd", psm);
} else {
- LOG_DEBUG("Successfully registered psm:%hd", psm);
+ LOG_INFO("Successfully registered psm:%hd", psm);
Classic().RegisterPsm(registered_psm, callbacks);
}
return registered_psm;
}
}
- LOG_DEBUG("Unregistering service on psm:%hd", psm);
+ LOG_INFO("Unregistering service on psm:%hd", psm);
UnregisterServicePromise unregister_promise;
auto service_unregistered = unregister_promise.get_future();
bluetooth::shim::GetL2cap()->UnregisterClassicService(
CreateConnectionPromise create_promise;
auto created = create_promise.get_future();
- LOG_DEBUG("Initiating local connection to psm:%hd address:%s", psm,
- raw_address.ToString().c_str());
+ LOG_INFO("Initiating local connection to psm:%hd address:%s", psm,
+ raw_address.ToString().c_str());
bluetooth::shim::GetL2cap()->CreateClassicConnection(
psm, raw_address.ToString(),
LOG_WARN("Failed to initiate connection interface to psm:%hd address:%s",
psm, raw_address.ToString().c_str());
} else {
- LOG_DEBUG(
+ LOG_INFO(
"Successfully initiated connection to psm:%hd address:%s"
" connection_interface_descriptor:%hd",
psm, raw_address.ToString().c_str(), cid);
L2CAP_INITIATOR_LOCAL, base::Unretained(&cfg_info)));
} else {
- LOG_DEBUG("Connection Closed before presentation to upper layer");
+ LOG_INFO("Connection Closed before presentation to upper layer");
if (connected) {
SetDownstreamCallbacks(cid);
bluetooth::shim::GetL2cap()->CloseClassicConnection(cid);
} else {
- LOG_DEBUG("Connection failed after initiator closed");
+ LOG_INFO("Connection failed after initiator closed");
}
}
}
RawAddress raw_address;
RawAddress::FromString(string_address, raw_address);
- LOG_DEBUG(
+ LOG_INFO(
"Sending connection indicator to upper stack from device:%s "
"psm:%hd cid:%hd",
string_address.c_str(), psm, cid);
if (!ConnectionExists(cid) || len == 0) {
return false;
}
- LOG_DEBUG("Writing data cid:%hd len:%zd", cid, len);
+ LOG_INFO("Writing data cid:%hd len:%zd", cid, len);
bluetooth::shim::GetL2cap()->Write(cid, data, len);
return true;
}
void bluetooth::shim::legacy::L2cap::SetDownstreamCallbacks(uint16_t cid) {
bluetooth::shim::GetL2cap()->SetReadDataReadyCallback(
cid, [this](uint16_t cid, std::vector<const uint8_t> data) {
- LOG_DEBUG("OnDataReady cid:%hd len:%zd", cid, data.size());
+ LOG_INFO("OnDataReady cid:%hd len:%zd", cid, data.size());
BT_HDR* bt_hdr =
static_cast<BT_HDR*>(osi_calloc(data.size() + kBtHdrSize));
std::copy(data.begin(), data.end(), bt_hdr->data);
bluetooth::shim::GetL2cap()->SetConnectionClosedCallback(
cid, [this](uint16_t cid, int error_code) {
- LOG_DEBUG("OnChannel closed callback cid:%hd", cid);
+ LOG_INFO("OnChannel closed callback cid:%hd", cid);
if (!ConnectionExists(cid)) {
LOG_WARN("%s Unexpected channel closure cid:%hd", __func__, cid);
return;
LOG_WARN("%s Channel already in closing state cid:%hu", __func__, cid);
return false;
}
- LOG_DEBUG("%s initiated locally cid:%hu", __func__, cid);
+ LOG_INFO("%s initiated locally cid:%hu", __func__, cid);
cid_closing_set_.insert(cid);
bluetooth::shim::GetL2cap()->CloseClassicConnection(cid);
return true;
void Stack::Start(ModuleList* modules) {
ASSERT_LOG(!is_running_, "%s Gd stack already running", __func__);
- LOG_DEBUG("%s Starting Gd stack", __func__);
+ LOG_INFO("%s Starting Gd stack", __func__);
stack_thread_ =
new os::Thread("gd_stack_thread", os::Thread::Priority::NORMAL);
timer_gettime(timer, &time_to_expire);
if (time_to_expire.it_value.tv_sec == 0 &&
time_to_expire.it_value.tv_nsec == 0) {
- LOG_DEBUG(
+ LOG_INFO(
"%s alarm expiration too close for posix timers, switching to guns",
__func__);
}
}
- LOG_DEBUG("%s Callback thread exited", __func__);
+ LOG_INFO("%s Callback thread exited", __func__);
}
static bool timer_create_internal(const clockid_t clock_id, timer_t* timer) {
// randomize the canary contents
for (size_t i = 0; i < canary_size; i++) canary[i] = (char)osi_rand();
- LOG_DEBUG("canary initialized");
+ LOG_INFO("canary initialized");
enabled = true;
}
}
if (count > fixed_queue_capacity(thread->work_queue))
- LOG_DEBUG("%s growing event queue on shutdown.", __func__);
+ LOG_INFO("%s growing event queue on shutdown.", __func__);
LOG_WARN("%s: thread id %d, thread name %s exited", __func__, thread->tid,
thread->name);
}
static void wakelock_initialize_native(void) {
- LOG_DEBUG("%s opening wake locks", __func__);
+ LOG_INFO("%s opening wake locks", __func__);
if (wake_lock_path.empty()) wake_lock_path = DEFAULT_WAKE_LOCK_PATH;
p_feeding_params->bits_per_sample =
a2dp_codec_config->getAudioBitsPerSample();
p_feeding_params->channel_count = A2DP_GetTrackChannelCountAac(p_codec_info);
- LOG_DEBUG("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
- p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
- p_feeding_params->channel_count);
+ LOG_INFO("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
+ p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
+ p_feeding_params->channel_count);
// The codec parameters
p_encoder_params->sample_rate =
a2dp_aac_encoder_cb.TxAaMtuSize = peer_mtu;
}
- LOG_DEBUG("%s: MTU=%d, peer_mtu=%d", __func__,
- a2dp_aac_encoder_cb.TxAaMtuSize, peer_mtu);
- LOG_DEBUG("%s: sample_rate: %d channel_mode: %d ", __func__,
- p_encoder_params->sample_rate, p_encoder_params->channel_mode);
+ LOG_INFO("%s: MTU=%d, peer_mtu=%d", __func__, a2dp_aac_encoder_cb.TxAaMtuSize,
+ peer_mtu);
+ LOG_INFO("%s: sample_rate: %d channel_mode: %d ", __func__,
+ p_encoder_params->sample_rate, p_encoder_params->channel_mode);
// Set the encoder's parameters: Audio Object Type - MANDATORY
// A2DP_AAC_OBJECT_TYPE_MPEG2_LC -> AOT_AAC_LC
aac_peak_bit_rate =
A2DP_ComputeMaxBitRateAac(p_codec_info, a2dp_aac_encoder_cb.TxAaMtuSize);
aac_param_value = std::min(aac_param_value, aac_peak_bit_rate);
- LOG_DEBUG("%s: MTU = %d Sampling Frequency = %d Bit Rate = %d", __func__,
- a2dp_aac_encoder_cb.TxAaMtuSize, aac_sampling_freq,
- aac_param_value);
+ LOG_INFO("%s: MTU = %d Sampling Frequency = %d Bit Rate = %d", __func__,
+ a2dp_aac_encoder_cb.TxAaMtuSize, aac_sampling_freq, aac_param_value);
if (aac_param_value == -1) {
LOG_ERROR(
"%s: Cannot set AAC parameter AACENC_BITRATE: "
p_encoder_params->frame_length = aac_info.frameLength;
p_encoder_params->input_channels_n = aac_info.inputChannels;
p_encoder_params->max_encoded_buffer_bytes = aac_info.maxOutBufBytes;
- LOG_DEBUG(
+ LOG_INFO(
"%s: AAC frame_length = %u input_channels_n = %u "
"max_encoded_buffer_bytes = %d",
__func__, p_encoder_params->frame_length,
A2dpCodecConfig* A2dpCodecConfig::createCodec(
btav_a2dp_codec_index_t codec_index,
btav_a2dp_codec_priority_t codec_priority) {
- LOG_DEBUG("%s: codec %s", __func__, A2DP_CodecIndexStr(codec_index));
+ LOG_INFO("%s: codec %s", __func__, A2DP_CodecIndexStr(codec_index));
A2dpCodecConfig* codec_config = nullptr;
switch (codec_index) {
}
bool A2dpCodecs::init() {
- LOG_DEBUG("%s", __func__);
+ LOG_INFO("%s", __func__);
std::lock_guard<std::recursive_mutex> lock(codec_mutex_);
char* tok = NULL;
char* tmp_token = NULL;
*p_restart_output = false;
*p_config_updated = false;
- LOG_DEBUG("%s: Configuring: %s", __func__,
- codec_user_config.ToString().c_str());
+ LOG_INFO("%s: Configuring: %s", __func__,
+ codec_user_config.ToString().c_str());
if (codec_user_config.codec_type < BTAV_A2DP_CODEC_INDEX_MAX) {
auto iter = indexed_codecs_.find(codec_user_config.codec_type);
if (*p_restart_input || *p_restart_output) *p_config_updated = true;
- LOG_DEBUG(
+ LOG_INFO(
"%s: Configured: restart_input = %d restart_output = %d "
"config_updated = %d",
__func__, *p_restart_input, *p_restart_output, *p_config_updated);
p_feeding_params->bits_per_sample =
a2dp_codec_config->getAudioBitsPerSample();
p_feeding_params->channel_count = A2DP_GetTrackChannelCountSbc(p_codec_info);
- LOG_DEBUG("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
- p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
- p_feeding_params->channel_count);
+ LOG_INFO("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
+ p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
+ p_feeding_params->channel_count);
a2dp_sbc_feeding_reset();
// The codec parameters
// Set the initial target bit rate
p_encoder_params->u16BitRate = a2dp_sbc_source_rate();
- LOG_DEBUG("%s: MTU=%d, peer_mtu=%d min_bitpool=%d max_bitpool=%d", __func__,
- a2dp_sbc_encoder_cb.TxAaMtuSize, peer_mtu, min_bitpool,
- max_bitpool);
- LOG_DEBUG(
+ LOG_INFO("%s: MTU=%d, peer_mtu=%d min_bitpool=%d max_bitpool=%d", __func__,
+ a2dp_sbc_encoder_cb.TxAaMtuSize, peer_mtu, min_bitpool, max_bitpool);
+ LOG_INFO(
"%s: ChannelMode=%d, NumOfSubBands=%d, NumOfBlocks=%d, "
"AllocationMethod=%d, BitRate=%d, SamplingFreq=%d BitPool=%d",
__func__, p_encoder_params->s16ChannelMode,
if (s16BitPool < 0) s16BitPool = 0;
- LOG_DEBUG("%s: bitpool candidate: %d (%d kbps)", __func__, s16BitPool,
- p_encoder_params->u16BitRate);
+ LOG_INFO("%s: bitpool candidate: %d (%d kbps)", __func__, s16BitPool,
+ p_encoder_params->u16BitRate);
if (s16BitPool > max_bitpool) {
- LOG_DEBUG("%s: computed bitpool too large (%d)", __func__, s16BitPool);
+ LOG_INFO("%s: computed bitpool too large (%d)", __func__, s16BitPool);
/* Decrease bitrate */
p_encoder_params->u16BitRate -= A2DP_SBC_BITRATE_STEP;
/* Record that we have decreased the bitrate */
/* Finally update the bitpool in the encoder structure */
p_encoder_params->s16BitPool = s16BitPool;
- LOG_DEBUG("%s: final bit rate %d, final bit pool %d", __func__,
- p_encoder_params->u16BitRate, p_encoder_params->s16BitPool);
+ LOG_INFO("%s: final bit rate %d, final bit pool %d", __func__,
+ p_encoder_params->u16BitRate, p_encoder_params->s16BitPool);
/* Reset the SBC encoder */
SBC_Encoder_Init(&a2dp_sbc_encoder_cb.sbc_encoder_params);
A2DP_SBC_ENCODER_INTERVAL_MS) /
1000;
- LOG_DEBUG("%s: PCM bytes per tick %u", __func__,
- a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick);
+ LOG_INFO("%s: PCM bytes per tick %u", __func__,
+ a2dp_sbc_encoder_cb.feeding_state.bytes_per_tick);
}
void a2dp_sbc_feeding_flush(void) {
uint32_t a2dp_sbc_get_bitrate() {
SBC_ENC_PARAMS* p_encoder_params = &a2dp_sbc_encoder_cb.sbc_encoder_params;
- LOG_DEBUG("%s: bit rate %d ", __func__, p_encoder_params->u16BitRate);
+ LOG_INFO("%s: bit rate %d ", __func__, p_encoder_params->u16BitRate);
return p_encoder_params->u16BitRate * 1000;
}
a2dp_codec_config->getAudioBitsPerSample();
p_feeding_params->channel_count =
A2DP_VendorGetTrackChannelCountAptx(p_codec_info);
- LOG_DEBUG("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
- p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
- p_feeding_params->channel_count);
+ LOG_INFO("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
+ p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
+ p_feeding_params->channel_count);
a2dp_vendor_aptx_feeding_reset();
}
}
}
- LOG_DEBUG("%s: sleep_time_ns = %" PRIu64, __func__,
- framing_params->sleep_time_ns);
+ LOG_INFO("%s: sleep_time_ns = %" PRIu64, __func__,
+ framing_params->sleep_time_ns);
}
//
a2dp_codec_config->getAudioBitsPerSample();
p_feeding_params->channel_count =
A2DP_VendorGetTrackChannelCountAptxHd(p_codec_info);
- LOG_DEBUG("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
- p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
- p_feeding_params->channel_count);
+ LOG_INFO("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
+ p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
+ p_feeding_params->channel_count);
a2dp_vendor_aptx_hd_feeding_reset();
}
framing_params->sleep_time_ns = 9000000;
- LOG_DEBUG("%s: sleep_time_ns = %" PRIu64, __func__,
- framing_params->sleep_time_ns);
+ LOG_INFO("%s: sleep_time_ns = %" PRIu64, __func__,
+ framing_params->sleep_time_ns);
}
//
frame_number = (int)pBuffer[0];
bs_bytes = (int)bytesValid;
bytesValid -= 1;
- LOG_DEBUG("%s:INPUT size : %d, frame : %d", __func__, bs_bytes, frame_number);
+ LOG_INFO("%s:INPUT size : %d, frame : %d", __func__, bs_bytes, frame_number);
if (a2dp_ldac_decoder_cb.has_ldac_handle)
ldac_BCO_decode_packet_func(a2dp_ldac_decoder_cb.ldac_handle_bco, pBuffer,
void a2dp_vendor_ldac_decoder_start(void) {
pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex));
- LOG_DEBUG("%s", __func__);
+ LOG_INFO("%s", __func__);
if (a2dp_ldac_decoder_cb.has_ldac_handle)
ldac_BCO_start_func(a2dp_ldac_decoder_cb.ldac_handle_bco);
pthread_mutex_unlock(&(a2dp_ldac_decoder_cb.mutex));
void a2dp_vendor_ldac_decoder_suspend(void) {
pthread_mutex_lock(&(a2dp_ldac_decoder_cb.mutex));
- LOG_DEBUG("%s", __func__);
+ LOG_INFO("%s", __func__);
if (a2dp_ldac_decoder_cb.has_ldac_handle)
ldac_BCO_suspend_func(a2dp_ldac_decoder_cb.ldac_handle_bco);
pthread_mutex_unlock(&(a2dp_ldac_decoder_cb.mutex));
bits_per_sample = A2DP_VendorGetTrackBitsPerSampleLdac(p_codec_info);
channel_mode = A2DP_VendorGetChannelModeCodeLdac(p_codec_info);
- LOG_DEBUG("%s , sample_rate=%d, bits_per_sample=%d, channel_mode=%d",
- __func__, sample_rate, bits_per_sample, channel_mode);
+ LOG_INFO("%s , sample_rate=%d, bits_per_sample=%d, channel_mode=%d", __func__,
+ sample_rate, bits_per_sample, channel_mode);
if (a2dp_ldac_decoder_cb.has_ldac_handle)
ldac_BCO_configure_func(a2dp_ldac_decoder_cb.ldac_handle_bco, sample_rate,
a2dp_codec_config->getAudioBitsPerSample();
p_feeding_params->channel_count =
A2DP_VendorGetTrackChannelCountLdac(p_codec_info);
- LOG_DEBUG("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
- p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
- p_feeding_params->channel_count);
+ LOG_INFO("%s: sample_rate=%u bits_per_sample=%u channel_count=%u", __func__,
+ p_feeding_params->sample_rate, p_feeding_params->bits_per_sample,
+ p_feeding_params->channel_count);
a2dp_vendor_ldac_feeding_reset();
// The codec parameters
int old_quality_mode_index = p_encoder_params->quality_mode_index;
if (codec_config.codec_specific_1 != 0) {
p_encoder_params->quality_mode_index = codec_config.codec_specific_1 % 10;
- LOG_DEBUG("%s: setting quality mode to %s", __func__,
- quality_mode_index_to_name(p_encoder_params->quality_mode_index)
- .c_str());
+ LOG_INFO("%s: setting quality mode to %s", __func__,
+ quality_mode_index_to_name(p_encoder_params->quality_mode_index)
+ .c_str());
} else {
p_encoder_params->quality_mode_index = A2DP_LDAC_QUALITY_ABR;
- LOG_DEBUG("%s: setting quality mode to default %s", __func__,
- quality_mode_index_to_name(p_encoder_params->quality_mode_index)
- .c_str());
+ LOG_INFO("%s: setting quality mode to default %s", __func__,
+ quality_mode_index_to_name(p_encoder_params->quality_mode_index)
+ .c_str());
}
int ldac_eqmid = LDAC_ABR_MODE_EQMID;
quality_mode_index_to_name(p_encoder_params->quality_mode_index)
.c_str());
} else {
- LOG_DEBUG("%s: changing mode from %s to %s", __func__,
- quality_mode_index_to_name(old_quality_mode_index).c_str(),
- quality_mode_index_to_name(p_encoder_params->quality_mode_index)
- .c_str());
+ LOG_INFO("%s: changing mode from %s to %s", __func__,
+ quality_mode_index_to_name(old_quality_mode_index).c_str(),
+ quality_mode_index_to_name(p_encoder_params->quality_mode_index)
+ .c_str());
if (a2dp_ldac_encoder_cb.ldac_abr_handle != NULL) {
- LOG_DEBUG("%s: already in LDAC ABR mode, do nothing.", __func__);
+ LOG_INFO("%s: already in LDAC ABR mode, do nothing.", __func__);
} else {
- LOG_DEBUG("%s: get and init LDAC ABR handle.", __func__);
+ LOG_INFO("%s: get and init LDAC ABR handle.", __func__);
a2dp_ldac_encoder_cb.ldac_abr_handle = a2dp_ldac_abr_get_handle();
if (a2dp_ldac_encoder_cb.ldac_abr_handle != NULL) {
a2dp_ldac_encoder_cb.has_ldac_abr_handle = true;
A2DP_LDAC_ENCODER_INTERVAL_MS);
} else {
p_encoder_params->quality_mode_index = A2DP_LDAC_QUALITY_MID;
- LOG_DEBUG(
+ LOG_INFO(
"%s: get LDAC ABR handle failed, resetting quality mode to %s.",
__func__,
}
} else {
ldac_eqmid = p_encoder_params->quality_mode_index;
- LOG_DEBUG("%s: in %s mode, free LDAC ABR handle.", __func__,
- quality_mode_index_to_name(ldac_eqmid).c_str());
+ LOG_INFO("%s: in %s mode, free LDAC ABR handle.", __func__,
+ quality_mode_index_to_name(ldac_eqmid).c_str());
if (a2dp_ldac_encoder_cb.has_ldac_abr_handle) {
a2dp_ldac_abr_free_handle(a2dp_ldac_encoder_cb.ldac_abr_handle);
a2dp_ldac_encoder_cb.ldac_abr_handle = NULL;
else if (p_encoder_params->pcm_wlength == 4)
p_encoder_params->pcm_fmt = LDACBT_SMPL_FMT_S32;
- LOG_DEBUG("%s: MTU=%d, peer_mtu=%d", __func__,
- a2dp_ldac_encoder_cb.TxAaMtuSize, peer_mtu);
- LOG_DEBUG(
+ LOG_INFO("%s: MTU=%d, peer_mtu=%d", __func__,
+ a2dp_ldac_encoder_cb.TxAaMtuSize, peer_mtu);
+ LOG_INFO(
"%s: sample_rate: %d channel_mode: %d "
"quality_mode_index: %d pcm_wlength: %d pcm_fmt: %d",
__func__, p_encoder_params->sample_rate, p_encoder_params->channel_mode,
A2DP_LDAC_ENCODER_INTERVAL_MS) /
1000;
- LOG_DEBUG("%s: PCM bytes per tick %u", __func__,
- a2dp_ldac_encoder_cb.ldac_feeding_state.bytes_per_tick);
+ LOG_INFO("%s: PCM bytes per tick %u", __func__,
+ a2dp_ldac_encoder_cb.ldac_feeding_state.bytes_per_tick);
}
void a2dp_vendor_ldac_feeding_flush(void) {
(p_mode->min <= p_cb->interval)) ||
((p_mode->mode & BTM_PM_MD_FORCE) == 0 &&
(p_mode->max >= p_cb->interval))) {
- LOG_DEBUG("already in requested mode %d, interval: %d, max: %d, min: %d",
- p_mode->mode, p_cb->interval, p_mode->max, p_mode->min);
+ LOG_INFO("already in requested mode %d, interval: %d, max: %d, min: %d",
+ p_mode->mode, p_cb->interval, p_mode->max, p_mode->min);
return BTM_SUCCESS;
}
}
/* if mode == hold or pending, return */
if ((p_cb->state == BTM_PM_STS_HOLD) || (p_cb->state == BTM_PM_STS_PENDING) ||
(btm_cb.acl_cb_.pm_pend_link != MAX_L2CAP_LINKS)) {
- LOG_DEBUG("storing pm setup, state: %d, pm_pending_link: %d", p_cb->state,
- btm_cb.acl_cb_.pm_pend_link);
+ LOG_INFO("storing pm setup, state: %d, pm_pending_link: %d", p_cb->state,
+ btm_cb.acl_cb_.pm_pend_link);
/* command pending */
if (acl_ind != btm_cb.acl_cb_.pm_pend_link) {
/* set the stored mask */
p_cb->state |= BTM_PM_STORED_MASK;
- LOG_DEBUG("btm_pm state stored: %d", acl_ind);
+ LOG_INFO("btm_pm state stored: %d", acl_ind);
}
return BTM_CMD_STORED;
}
- LOG_DEBUG("pm_id: %d, bda: %s, mode: %d, state: %d, pending_link: %d", pm_id,
- remote_bda.ToString().c_str(), p_mode->mode, p_cb->state,
- btm_cb.acl_cb_.pm_pend_link);
+ LOG_INFO("pm_id: %d, bda: %s, mode: %d, state: %d, pending_link: %d", pm_id,
+ remote_bda.ToString().c_str(), p_mode->mode, p_cb->state,
+ btm_cb.acl_cb_.pm_pend_link);
return internal_.btm_pm_snd_md_req(pm_id, acl_ind, p_mode);
}
max_lat, min_rmt_to, min_loc_to);
return BTM_SUCCESS;
}
- LOG_DEBUG("pm_mode_db state: %d", btm_cb.acl_cb_.pm_mode_db[acl_ind].state);
+ LOG_INFO("pm_mode_db state: %d", btm_cb.acl_cb_.pm_mode_db[acl_ind].state);
tBTM_PM_MCB* p_cb = &btm_cb.acl_cb_.pm_mode_db[acl_ind];
p_cb->max_lat = max_lat;
p_cb->min_rmt_to = min_rmt_to;
}
/* no command pending */
btm_cb.acl_cb_.pm_pend_link = MAX_L2CAP_LINKS;
- LOG_DEBUG("reset pm");
+ LOG_INFO("reset pm");
}
/*******************************************************************************
mode = btm_pm_get_set_mode(pm_id, p_cb, p_mode, &md_res);
md_res.mode = mode;
- LOG_DEBUG("link_ind: %d, mode: %d", link_ind, mode);
+ LOG_INFO("link_ind: %d, mode: %d", link_ind, mode);
if (p_cb->state == mode) {
/* already in the resulting mode */
/* send the appropriate HCI command */
btm_cb.pm_pend_id = pm_id;
- LOG_DEBUG("switching from %s(0x%x) to %s(0x%x), link_ind: %d",
- mode_to_string(p_cb->state), p_cb->state,
- mode_to_string(md_res.mode), md_res.mode, link_ind);
+ LOG_INFO("switching from %s(0x%x) to %s(0x%x), link_ind: %d",
+ mode_to_string(p_cb->state), p_cb->state,
+ mode_to_string(md_res.mode), md_res.mode, link_ind);
switch (md_res.mode) {
case BTM_PM_MD_ACTIVE:
}
/* no pending cmd now */
- LOG_DEBUG("state: %d, pend_link: %d", p_cb->state,
- btm_cb.acl_cb_.pm_pend_link);
+ LOG_INFO("state: %d, pend_link: %d", p_cb->state,
+ btm_cb.acl_cb_.pm_pend_link);
btm_cb.acl_cb_.pm_pend_link = MAX_L2CAP_LINKS;
/*******************************************************************************
p_cb->state = mode;
p_cb->interval = interval;
- LOG_DEBUG("switched from [%s] to [%s].", mode_to_string(old_state),
- mode_to_string(p_cb->state));
+ LOG_INFO("switched from [%s] to [%s].", mode_to_string(old_state),
+ mode_to_string(p_cb->state));
if ((p_cb->state == BTM_PM_ST_ACTIVE) || (p_cb->state == BTM_PM_ST_SNIFF)) {
l2c_OnHciModeChangeSendPendingPackets(bd_addr);
bool addr_matched) {
tBTM_SEC_DEV_REC* p_dev_rec = btm_find_dev(bda);
if (!p_dev_rec) {
- LOG_DEBUG("Creating new device record for new ble connection");
+ LOG_INFO("Creating new device record for new ble connection");
p_dev_rec = btm_sec_alloc_dev(bda);
if (p_dev_rec == nullptr) {
LOG_WARN("Unable to create device record for new ble connection");
return;
}
} else {
- LOG_DEBUG("Updating device record timestamp for existing ble connection");
+ LOG_INFO("Updating device record timestamp for existing ble connection");
// TODO() Why is timestamp a counter ?
p_dev_rec->timestamp = btm_cb.dev_rec_count++;
}
btm_ble_update_dmt_flag_bits(&flag, connect_mode, disc_mode);
- LOG_DEBUG("disc_mode %04x", disc_mode);
+ LOG_INFO("disc_mode %04x", disc_mode);
/* update discoverable flag */
if (disc_mode & BTM_BLE_LIMITED_DISCOVERABLE) {
flag &= ~BTM_BLE_GEN_DISC_FLAG;
if ((p_cur->flag & BTM_BLE_BREDR_NOT_SPT) == 0 &&
!ble_evt_type_is_directed(evt_type)) {
if (p_cur->ble_addr_type != BLE_ADDR_RANDOM) {
- LOG_DEBUG("NOT_BR_EDR support bit not set, treat device as DUMO");
+ LOG_INFO("NOT_BR_EDR support bit not set, treat device as DUMO");
p_cur->device_type |= BT_DEVICE_TYPE_DUMO;
} else {
- LOG_DEBUG("Random address, treat device as LE only");
+ LOG_INFO("Random address, treat device as LE only");
}
} else {
- LOG_DEBUG("NOT_BR/EDR support bit set, treat device as LE only");
+ LOG_INFO("NOT_BR/EDR support bit set, treat device as LE only");
}
}
uint8_t result = btm_ble_is_discoverable(bda, adv_data);
if (result == 0) {
cache.Clear(addr_type, bda);
- LOG_DEBUG("device no longer discoverable, discarding advertising packet");
+ LOG_INFO("device no longer discoverable, discarding advertising packet");
return;
}
}
void on_connection_complete(const RawAddress& address) {
- LOG_DEBUG("Le connection completed to device:%s", address.ToString().c_str());
+ LOG_INFO("Le connection completed to device:%s", address.ToString().c_str());
remove_all_clients_with_pending_connections(address);
}
void LinkLayerController::IncomingIoCapabilityRequestPacket(
model::packets::LinkLayerPacketView incoming) {
- LOG_DEBUG();
if (!simple_pairing_mode_enabled_) {
LOG_WARN("Only simple pairing mode is implemented");
return;
void LinkLayerController::IncomingIoCapabilityResponsePacket(
model::packets::LinkLayerPacketView incoming) {
- LOG_DEBUG();
-
auto response = model::packets::IoCapabilityResponseView::Create(incoming);
ASSERT(response.IsValid());
void LinkLayerController::IncomingIoCapabilityNegativeResponsePacket(
model::packets::LinkLayerPacketView incoming) {
- LOG_DEBUG();
Address peer = incoming.GetSourceAddress();
ASSERT(security_manager_.GetAuthenticationAddress() == peer);