AnsweredAssumed Answered

imx6 android4.3 can't connect  bluetooth remotectl

Question asked by jin xin on Mar 10, 2016

Recently I  hava been debuging  the bluetooth remotectl  ^_^

I make  all the  debug log of bluedroid stack show(please refer to the attachment),  but not clearly error info  can help me except that:

The host controller receive disconnected event (0x05) asynchronously  and the reason is  0x16(Connection Terminated By Local Host)
** Function btu_hcif_process_event
** Description      This function is called when an event is received from   the Host Controller.
void btu_hcif_process_event (UINT8 controller_id, BT_HDR *p_msg)

{

case HCI_DISCONNECTION_COMP_EVT:  //value is 0x05 -- Occurs when a connection has been disconnected.
  btu_hcif_disconnection_comp_evt (p, hci_evt_len);
break;

}

reason: HCI_ERR_CONN_CAUSE_LOCAL_HOST

#define HCI_ERR_CONN_CAUSE_LOCAL_HOST 0x16  //  Connection Terminated By Local Host  

 

What does this mean? Can we locate the rootcause with this error?

 

And from the log file, I can find that:   (00025ba100db is mac addr of the bluetooth remotectl)

 

D/bt-att ( 3110): connected is TRUE reason=1                           //connnected

D/bt-att  ( 3110): gatt_get_ch_state: ch_state=4

E/bt-att  ( 3110): connection already up, ignore it

D/bt-att  ( 3110): gatt_update_app_use_link_flag  is_add=1 chk_link=0

D/bt-att  ( 3110): gatt_update_app_hold_link_status found=1[1-found] idx=0 gatt_if=3 is_add=1

D/bt-att  ( 3110): gatt_get_ch_state: ch_state=4

I/bt-att  ( 3110): GATT_GetConnIdIfConnected status=1

D/bt-btif ( 3110): bta_gattc_conn server cache state=0

D/bt-btif ( 3110): bta_gattc_conn conn_id=3

I/bt-att  ( 3110): GATT_GetConnectionInfor conn_id=3

I/bt-l2cap( 3110): L2CA_EnableUpdateBleConnParams - BD_ADDR 00025ba100db enable 0 current upd state 1

D/bt-btif ( 3110): bta_gattc_cache_open conn_id=3

D/bt-btif ( 3110): bta_dm_gattc_callback event = 2

D/bt-btif ( 3110): DM Search state= 3 search_cb.peer_dbaddr: [00025ba100db] connected_bda= [00025ba100db]

D/bt-btif ( 3110): BTA_GATTC_OPEN_EVT conn_id = 3 client_if=3 status = 0

I/bt-btif ( 3110): BTA got event 0x1f12

D/bt-btif ( 3110): bta_gattc_ci_open conn_id=3 server state=1

I/bt-btif ( 3110): BTA got event 0x1f08

I/bt-btif ( 3110): BTA got event 0x1f13

D/bt-btif ( 3110): bta_gattc_ci_load conn_id=3 load status=138

D/bt-btif ( 3110): bta_gattc_start_discover conn_id=3 p_clcb->p_srcb->state = 3

I/bt-l2cap( 3110): L2CA_EnableUpdateBleConnParams - BD_ADDR 00025ba100db enable 0 current upd state 1

I/bt-btm  ( 3110): BTM_InqDbRead: bd addr [00025ba100db]

D/bt-btm  ( 3110): btm_find_dev_type - device_type = 2 addr_type = 0

I/bt-att  ( 3110): GATTC_Discover conn_id=3 disc_type=1

E/bt-att  ( 3110):  ### GATTC_Discover debug 1

I/bt-btif ( 3110): HAL bt_hal_cbacks->bond_state_changed_cb

I/BluetoothBondStateMachine( 3110): bondStateChangeCallback: Status: 0 Address: 00:02:5B:A1:00:DB newState: 2

D/BluetoothAdapterProperties( 3110): Adding bonded device:00:02:5B:A1:00:DB

I/BluetoothBondStateMachine( 3110): Bond State Change Intent:00:02:5B:A1:00:DB OldState: 11 NewState: 12

D/HidService( 3110): getHidService(): returning com.android.bluetooth.hid.HidService@41ce0ed8

D/bt-btif ( 3110): cmd.id:4

D/btif_config_util( 3110): btif_config_save_file(L153): in file name:/data/misc/bluedroid/bt_config.new

W/BluetoothEventManager( 3038): CachedBluetoothDevice for device 00:02:5B:A1:00:DB not found, calling readPairedDevices().

D/BluetoothAdapterService(1103915440)( 3110): Get Bonded Devices being called

D/BluetoothAdapterProperties( 3110): getBondedDevices: length=1

D/BluetoothAdapterService(1103915440)( 3110): Get Bonded Devices being called

D/BluetoothAdapterProperties( 3110): getBondedDevices: length=1

D/BluetoothDiscoverableEnabler( 3038): handleModeChanged(): mode = 21

D/HidService( 3110): Saved priority 00:02:5B:A1:00:DB = 100

W/BackupManagerService( 2513): dataChanged but no participant pkg='com.android.providers.settings' uid=1002

W/BackupManagerService( 2513): dataChanged but no participant pkg='com.android.providers.settings' uid=1002

I/BluetoothBondStateMachine( 3110): StableState(): Entering Off State

W/BackupManagerService( 2513): dataChanged but no participant pkg='com.android.providers.settings' uid=1002

E/bt-att  ( 3110): ### gatt_act_discovery debug  1

E/bt-att  ( 3110): ### gatt_act_discovery debug  2

D/bt-att  ( 3110):  ### attp_send_cl_msg op_code = 16

I/bt-l2cap( 3110): L2CA_SendFixedChnlData()  CID: 0x0004  BDA: 00025ba100db

D/bt-btif ( 3110): HC lib lpm deassertion return 0

D/bt-btif ( 3110): HC lib lpm deassertion return 0

D/bt-l2cap( 3110): ###  receive reason 16 //disconnected

W/bt-l2cap( 3110): ### l2cu_release_lcb debug 1

D/bt-l2cap( 3110): l2cu_release_ccb: cid 0x0004  in_use: 1

D/bt-att  ( 3110): GATT   ATT protocol channel with BDA: 00025ba100db is disconnected

D/bt-att  ( 3110): gatt_is_bda_in_the_srv_chg_clt_list :00-02-5b-a1-00-db

D/bt-att  ( 3110): bda is in the srv chg clt list

D/bt-att  ( 3110): gatt_cleanup_upon_disc

D/bt-att  ( 3110): found p_tcb

D/bt-att  ( 3110): found p_clcb conn_id=3 clcb_idx=0

D/bt-att  ( 3110): gatt_end_operation status=133 op=1 subtype=1

D/bt-btif ( 3110): bta_gattc_disc_cmpl conn_id=3

W/bt-l2cap( 3110): L2CA_EnableUpdateBleConnParams - unknown BD_ADDR 00025ba100db

D/bt-btif ( 3110): bta_gattc_search conn_id=3

D/bt-btif ( 3110): bta_dm_gattc_callback event = 6

D/bt-btif ( 3110): bta_dm_gatt_disc_complete conn_id = 3

D/bt-att  ( 3110): gatt_free_pending_ind

D/bt-att  ( 3110): gatt_free_pending_enc_queue

D/bt-att  ( 3110): found p_reg tcb_idx=0 gatt_if=1  conn_id=0x1

I/bt-att  ( 3110): gatt_profile_connect_cback: from 00025ba100db connected:0 conn_id=1 reason = 0x0016

D/bt-att  ( 3110): found p_reg tcb_idx=0 gatt_if=2  conn_id=0x2

D/bt-att  ( 3110): found p_reg tcb_idx=0 gatt_if=3  conn_id=0x3

D/bt-btif ( 3110): bta_gattc_conn_cback: cif = 3 connected = 0 conn_id = 3 reaosn = 0x0016

D/bt-att  ( 3110): exit gatt_cleanup_upon_disc

D/bt-att  ( 3110): ATT disconnected

I/bt-smp  ( 3110): SMDBG l2c smp_connect_cback

D/bt-btm  ( 3110): btm_acl_removed

D/bt-btm  ( 3110): btm_bda_to_acl found

D/bt-btm  ( 3110): btm_acl_report_role_change

D/bt-btm  ( 3110): btm_acl_update_busy_level

D/bt-btm  ( 3110): BTM_BLI_ACL_DOWN_EVT

D/bt-btm  ( 3110): acl hci_handle=128 is_le_link=1 connectable_mode=0x0 link_role=0

D/bt-btm  ( 3110): before update p_dev_rec->sec_flags=0x9e

D/bt-btm  ( 3110): LE link down

D/bt-btm  ( 3110): Bonded

D/bt-btm  ( 3110): after update p_dev_rec->sec_flags=0x9a

D/bt-btm  ( 3110): btm_acl_resubmit_page

E/bt-btm  ( 3110): btm_sec_disconnected - Clearing Pending flag

I/bt-btm  ( 3110): btm_sec_disconnected() sec_req:x0  State: 0   reason:22 bda:00025ba100db RName:ANYCON 4.0

I/bt-btm  ( 3110): before Update sec_flags=0x9a

D/bt-btm  ( 3110): btm_ble_update_mode_operation adv_mode = 0

I/bt-btm  ( 3110): after Update sec_flags=0x98

D/bt-btif ( 3110): HC lib lpm deassertion return 0

I/bt-btif ( 3110): BTA got event 0x207

I/bt-btif ( 3110): bta_dm_search_sm_execute state:3, event:0x207

D/bt-btif ( 3110): bta_dm_disc_result

I/bt-btif ( 3110): BTA got event 0x1f07

D/bt-btif ( 3110): bta_gattc_close conn_id=3

I/bt-att  ( 3110): GATT_Disconnect conn_id=3

D/bt-btif ( 3110): bta_dm_gattc_callback event = 5

I/bt-btif ( 3110): bta_dm_gattc_callback event = 5

D/bt-btif ( 3110): BTA_GATTC_CLOSE_EVT reason = 22

D/bt-btif ( 3110): btif_dm_search_services_evt:(result=0x1, services 0x0)

D/bt-btif ( 3110): bta_dm_gatt_disc_complete conn_id = 65535

D/bt-btif ( 3110): BTA got event 0x1f10

I/bt-btif ( 3110): BTA got event 0x1f10

E/bt-btif ( 3110): Unknown conn ID: 3

E/bt-btif ( 3110): Unknown conn ID: 3

I/bt-btif ( 3110): BTA got event 0x108

E/ ( 3110): ### ASSERT : external/bluetooth/bluedroid/main/../btif/src/btif_dm.c line 1125 storing remote services failed (1) ###

I/bt-btif ( 3110): bta_dm_sm_execute event:0x8

I/bt-btif ( 3110): btm_get_acl_disc_reason_code

D/bt-btm  ( 3110): btm_get_acl_disc_reason_code

I/bt-l2cap( 3110): L2CA_SetDesireRole() new:x1, disallow_switch:0

I/bt-btif ( 3110): BTA got event 0x108

I/bt-btif ( 3110): bta_dm_sm_execute event:0x8

I/bt-btif ( 3110): BTA got event 0x206

I/bt-btif ( 3110): bta_dm_search_sm_execute state:3, event:0x206

D/bt-btif ( 3110): bta_dm_search_cmpl

I/bt-btif ( 3110): BTA got event 0x207

I/bt-btif ( 3110): bta_dm_search_sm_execute state:0, event:0x207

E/BluetoothRemoteDevices( 3110): devicePropertyChangedCallback: bdDevice: 00:02:5B:A1:00:DB, value is empty for type: 3

I/bt-btif ( 3110): btif_dm_upstreams_cback  ev: BTA_DM_LINK_DOWN_EVT

D/bt-btif ( 3110): BTA_DM_LINK_DOWN_EVT. Sending BT_ACL_STATE_DISCONNECTED

I/bt-btif ( 3110): HAL bt_hal_cbacks->acl_state_changed_cb

D/BluetoothRemoteDevices( 3110): aclStateChangeCallback: State:DisConnected to Device:00:02:5B:A1:00:DB

I/bt-btif ( 3110): btif_dm_upstreams_cback  ev: BTA_DM_BUSY_LEVEL_EVT

I/bt-btif ( 3110): btif_dm_search_services_evt:  event = 4

 

 

Wish your constructive suggestions. Thank you!

Original Attachment has been moved to: bluetooth.log.zip

Outcomes