This is not really something I'm developing, more like something I'm trying to debug. For some reason my HTC Desire HD keeps disconnecting from my car's bluetooth. It worked fine on phone's original rom, then I upgraded to Gingerbread (HTC rom) and it started to disconnect. I'm not sure what happened next (possibly I've installed something? mb the car's computer was reset as I had a service?) but it actually started to work after a few months and all was good until I upgraded again to 2.3.5 (HTC official upgrade). The phone connects to my car without any issues, then looses the connection within a minute and will not reconnect until the phone or the car's restarted. Here's some log data that I was able to collect in case someone might be familiar with how the bluetooth works on android:
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Sleep, USERIAL_IO_BT_WAKE_DEASSERT ####
W/ (23507): bta_dm_pm_timer_cback 0x255fa4
W/ (23507): dm_pm_timer expires 0
W/ (23507): proc dm_pm_timer expires
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Wake, USERIAL_IO_BT_WAKE_ASSERT ####
I/PTIM (23507): Call GKI_add_to_timer_list in ptim_start_timer
W/ (23507): start dm_pm_timer:0, 5000
D/dalvikvm(23586): GC_CONCURRENT freed 381K, 48% free 3295K/6279K, external 0K/0K, paused 2ms+3ms
I/keystore( 1264): uid: 1000 action: e -> 7 state: 1 -> 1 retry: 4
I/BtAtPhonebook( 1631): Refreshed phonebook ME with 255 results
I/keystore( 1264): uid: 1000 action: e -> 7 state: 1 -> 1 retry: 4
I/BtAtPhonebook( 1631): Refreshed phonebook ME with 255 results
D/dalvikvm(15887): GC_EXPLICIT freed 124K, 44% free 4129K/7303K, external 0K/512K, paused 79ms
I//system/bin/btld(23506): ##### USERIAL_Ioctl: BT_Sleep, USERIAL_IO_BT_WAKE_DEASSERT ####
W/ (23507): stop dm_pm_timer:0
W/HeadsetBase.cpp( 1631): RFCOMM poll() returned success (1), but with an unexpected revents bitmask: 0x11
I/HeadsetBase( 1631): headset read error 5
I//system/bin/btld(23506): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DISCONNECT_IND (AG) 8 pbytes (hdl 18)
I//system/bin/btld(23506): BTL_IF_DisconnectDatapath: Disconnect datapath on handle 21
I//system/bin/btld(23506): wrp_setup_rxflow: wrp_setup_rxflow : 0 (fd 21)
I//system/bin/btld(23506): wsactive_del: delete wsock 21 from active list [212ef8]
I//system/bin/btld(23506): wrp_close_data: wrp_close 21 [brcm.bt.btlif]
I//system/bin/btld(23506): wsactive_del: delete wsock 21 from active list [212ef8]
I/BTL_IFC ( 1631): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_DISCONNECT_IND (AG) 10 pbytes (hdl 92)
D/BLZ_WRAPPER( 1631): blz_ctrl_msg: [blz ctrl] received message [BTLIF_DISCONNECT_IND]
D/BLZ_WRAPPER( 1631): blz_ctrl_msg: Channel disconnected remotely, rf_ch 65535
I/BTL_IFC_WRP( 1631): wrp_find_wsock_by_rfhdl: wrp_find_wsock_by_rfhdl : no entry found, lst 0, rfchan 65535
I/BLZ_WRAPPER( 1631): btl_if_close: btl_if_close (105)
D/BLZ_WRAPPER( 1631): btl_if_close: [btl_if_close] : (105:100), disc_pending 0, asnc 0, selct 0, flags 2
I/BTL_IFC ( 1631): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_DISCONNECT_REQ (AG) 8 pbytes (hdl 92)
W/ (23507): Could not find conn_info for chdl=0x3
D/BluetoothHeadsetService( 1631): Device: 00:13:A9:A1:19:1E Headset state 2 -> 0, result = 0
W/ (23507): BTA_DM_LINK_DOWN_EVT::bdaddr 00:13:a9:a1:19:1e reason x15
D/DTUN_HCID4(23540): dtun_dm_sig_link_down()
I/DTUN_HCID4(23540): dtun_dm_sig_link_down device = 0xf750 handle = 256 reason = 0x15
I//system/bin/btld(23506): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 11 pbytes (hdl 17)
D/BTL_IFC_WRP( 1631): wrp_close_s_only: wrp_close_s_only [105] (105:100) [brcm.bt.btlif]
D/BTL_IFC_WRP( 1631): wrp_close_s_only: data socket closed
D/BTL_IFC_WRP( 1631): wsactive_del: delete wsock 105 from active list [ad3ca3c0]
I/DTUN_HCID4(23540): [embedded]LINK_DOWN name = UHP, address = 00:13:A9:A1:19:1E, reason = 0x15
D/BluetoothService( 1379): Device property changed:00:13:A9:A1:19:1E property:Connected
I/BluetoothHeadsetService( 1631): [embedded] HSP/HFP state : address: 00:13:A9:A1:19:1E name: UHP State:2->0
I/BTL_IFC ( 1631): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_DISCONNECT_REQ (SCO) 0 pbytes (hdl 102)
W/ (23507): Could not find conn_info with active SCO
I/BluetoothA2dpService( 1379): BluetoothHeadset disconnected, remove AV CONNECT_TO msg
I/StatusBarPolicy( 1577): updateBluetooth bt icon:true,HS:0,A2DP:false
D/AudioPolicyManagerBase( 1260): setDeviceConnectionState() device: 40, state 0, address 00:13:A9:A1:19:1E
I/AudioPolicyManagerBase( 1260): setOutputDevice() output 4 device 0 delayMs 0
I/AudioPolicyManagerBase( 1260): setOutputDevice() setting same device 0 or null device for output 4
I/BluetoothDeviceProfileState( 1379): Entering IncomingHandsfree state with: 6
I/BluetoothDeviceProfileState( 1379): Processing command:6
I/BluetoothDeviceProfileState( 1379): Entering ACL Connected state with: 102
I/NaviReceiver(23556): Got BluetoothHeadset.ACTION_STATE_CHANGED
I/NaviReceiver(23556): conn state = 0
Related
For a BLE project I have been working on, I have created a smartphone application which serves as central, and a program in Linux, that serves as peripheral. After manually disconnecting via the phone, the program works as intended. But after disconnecting via the peripheral, the connection gets stuck in connect/disconnect loop.
I'm using "JustWorks" in bluetooth, which doesn't require any bonding/pairing.
The smartphone application is made in Flutter, and uses the flutter_reactive_ble library from Hue. The Linux program is written in Python, and uses the Bluezero package, but for disconnecting, I'm using:
subprocess.run("bluetoothctl -- disconnect", shell=True)
The terminal that is running the peripheral looks like this:
Attempting to disconnect from 58:93:C0:B5:9B:D7
Successful disconnected
[CHG] Device 58:93:C0:B5:9B:D7 Connected: no
Attempting to disconnect from 58:93:C0:B5:9B:D7
Successful disconnected
Attempting to disconnect from 58:93:C0:B5:9B:D7
Successful disconnected
The bluetoothctl terminal looks like this:
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: no
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: yes
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: no
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: yes
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: no
[CHG] Device 6E:4C:38:CB:4D:A9 Connected: yes
This is the btmon output: From start to end: Received data -> disconnected from peripheral -> stuck in connect/disconnect loop.
> HCI Event: LE Meta Event (0x3e) plen 10 #72 [hci0] 4.765604
LE Connection Update Complete (0x03)
Status: Success (0x00)
Handle: 24
Connection interval: 45.00 msec (0x0024)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
> ACL Data RX: Handle 24 flags 0x02 dlen 27 #73 [hci0] 4.855361
> ACL Data RX: Handle 24 flags 0x01 dlen 27 #74 [hci0] 4.856590
> ACL Data RX: Handle 24 flags 0x01 dlen 81 #75 [hci0] 4.857340
ATT: Write Command (0x52) len 130
Handle: 0x0026
Data: 6c69664638704647574134704656625275514a6d727053547062486a754d4c527758674f545733496d4e566630506d385542776c7a446155482b774f506f6a6330335345796c69695438494477554e477664617431424a3373496b352f58476d507a5937676a42707462436e4574392f5858702b79426b4e77796e43694c7242
> HCI Event: LE Meta Event (0x3e) plen 11 #76 [hci0] 4.857646
LE Data Length Change (0x07)
Handle: 24
Max TX octets: 251
Max TX time: 2120
Max RX octets: 250
Max RX time: 2120
# MGMT Command: Disconnect (0x0014) plen 7 {0x0001} [hci0] 6.819215
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
< HCI Command: Disconnect (0x01|0x0006) plen 3 #77 [hci0] 6.819411
Handle: 24
Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4 #78 [hci0] 6.823217
Disconnect (0x01|0x0006) ncmd 2
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4 #79 [hci0] 6.881799
Status: Success (0x00)
Handle: 24
Reason: Connection Terminated By Local Host (0x16)
# MGMT Event: Command Complete (0x0001) plen 10 {0x0001} [hci0] 6.882315
Disconnect (0x0014) plen 7
Status: Success (0x00)
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
< HCI Command: LE Set Extended Adve.. (0x08|0x0039) plen 6 #80 [hci0] 6.907442
Extended advertising: Disabled (0x00)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x01
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4 #81 [hci0] 6.911608
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
Status: Success (0x00)
< HCI Command: LE Set Extended Adv.. (0x08|0x0036) plen 25 #82 [hci0] 6.911986
Handle: 0x01
Properties: 0x0013
Connectable
Scannable
Use legacy advertising PDUs: ADV_IND
Min advertising interval: 37.500 msec (0x003c)
Max advertising interval: 37.500 msec (0x003c)
Channel map: 37, 38, 39 (0x07)
Own address type: Public (0x00)
Peer address type: Public (0x00)
Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
TX power: 0 dbm (0x00)
Primary PHY: LE 1M (0x01)
Secondary max skip: 0x00
Secondary PHY: LE 1M (0x01)
SID: 0x00
Scan request notifications: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 5 #83 [hci0] 6.913620
LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 2
Status: Success (0x00)
TX power (selected): 0 dbm (0x00)
< HCI Command: LE Set Extended Adve.. (0x08|0x0039) plen 6 #84 [hci0] 6.913983
Extended advertising: Enabled (0x01)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x01
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4 #85 [hci0] 6.918517
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19 #86 [hci0] 7.793289
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 24
Role: Peripheral (0x01)
Peer address type: Random (0x01)
Peer address: 48:AD:99:8B:C5:3D (Resolvable)
Connection interval: 45.00 msec (0x0024)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
Central clock accuracy: 0x01
# MGMT Event: Device Connected (0x000b) plen 13 {0x0001} [hci0] 7.793976
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
Flags: 0x00000000
Data length: 0
< HCI Command: LE Read Remote Used... (0x08|0x0016) plen 2 #87 [hci0] 7.794074
Handle: 24
> HCI Event: LE Meta Event (0x3e) plen 6 #88 [hci0] 7.795376
LE Advertising Set Terminated (0x12)
Status: Success (0x00)
Handle: 1
Connection handle: 24
Number of completed extended advertising events: 20
> HCI Event: Command Status (0x0f) plen 4 #89 [hci0] 7.797118
LE Read Remote Used Features (0x08|0x0016) ncmd 2
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 4 #90 [hci0] 7.827428
LE Channel Selection Algorithm (0x14)
Handle: 24
Algorithm: #2 (0x01)
> HCI Event: LE Meta Event (0x3e) plen 12 #91 [hci0] 7.873271
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 24
Features: 0xbd 0x7f 0x00 0x37 0x01 0x00 0x00 0x00
LE Encryption
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
Extended Scanner Filter Policies
LE 2M PHY
Stable Modulation Index - Transmitter
Stable Modulation Index - Receiver
LE Coded PHY
LE Extended Advertising
LE Periodic Advertising
Channel Selection Algorithm #2
Periodic Advertising Sync Transfer - Sender
Periodic Advertising Sync Transfer - Recipient
Sleep Clock Accuracy Updates
Connected Isochronous Stream - Central
Connected Isochronous Stream - Peripheral
Isochronous Channels (Host Support)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #92 [hci0] 8.006833
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 3 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #93 [hci0] 8.011070
LE L2CAP: Command Reject (0x01) ident 3 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #94 [hci0] 8.011537
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 4 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #95 [hci0] 8.011863
LE L2CAP: Command Reject (0x01) ident 4 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #96 [hci0] 8.013806
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 5 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #97 [hci0] 8.014120
LE L2CAP: Command Reject (0x01) ident 5 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #98 [hci0] 8.015700
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 6 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #99 [hci0] 8.016011
LE L2CAP: Command Reject (0x01) ident 6 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #100 [hci0] 8.017572
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 7 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #101 [hci0] 8.017884
LE L2CAP: Command Reject (0x01) ident 7 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #102 [hci0] 8.019854
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 8 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 67
Source CID: 80
Source CID: 72
Source CID: 73
Source CID: 74
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #103 [hci0] 8.020183
LE L2CAP: Command Reject (0x01) ident 8 len 2
Reason: Command not understood (0x0000)
> HCI Event: Number of Completed Packets (0x13) plen 5 #104 [hci0] 8.055702
Num handles: 1
Handle: 24
Count: 1
> HCI Event: LE Meta Event (0x3e) plen 11 #105 [hci0] 8.059275
LE Data Length Change (0x07)
Handle: 24
Max TX octets: 251
Max TX time: 2120
Max RX octets: 27
Max RX time: 328
> HCI Event: Number of Completed Packets (0x13) plen 5 #106 [hci0] 8.063411
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #107 [hci0] 8.067380
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #108 [hci0] 8.070316
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #109 [hci0] 8.072300
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #110 [hci0] 8.099836
Num handles: 1
Handle: 24
Count: 1
# MGMT Command: Disconnect (0x0014) plen 7 {0x0001} [hci0] 10.834677
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
< HCI Command: Disconnect (0x01|0x0006) plen 3 #111 [hci0] 10.836267
Handle: 24
Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4 #112 [hci0] 10.840869
Disconnect (0x01|0x0006) ncmd 2
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4 #113 [hci0] 10.889096
Status: Success (0x00)
Handle: 24
Reason: Connection Terminated By Local Host (0x16)
# MGMT Event: Command Complete (0x0001) plen 10 {0x0001} [hci0] 10.889891
Disconnect (0x0014) plen 7
Status: Success (0x00)
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
< HCI Command: LE Set Extended Ad.. (0x08|0x0039) plen 6 #114 [hci0] 10.919524
Extended advertising: Disabled (0x00)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x01
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4 #115 [hci0] 10.923760
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
Status: Success (0x00)
< HCI Command: LE Set Extended A.. (0x08|0x0036) plen 25 #116 [hci0] 10.924022
Handle: 0x01
Properties: 0x0013
Connectable
Scannable
Use legacy advertising PDUs: ADV_IND
Min advertising interval: 37.500 msec (0x003c)
Max advertising interval: 37.500 msec (0x003c)
Channel map: 37, 38, 39 (0x07)
Own address type: Public (0x00)
Peer address type: Public (0x00)
Peer address: 00:00:00:00:00:00 (OUI 00-00-00)
Filter policy: Allow Scan Request from Any, Allow Connect Request from Any (0x00)
TX power: 0 dbm (0x00)
Primary PHY: LE 1M (0x01)
Secondary max skip: 0x00
Secondary PHY: LE 1M (0x01)
SID: 0x00
Scan request notifications: Disabled (0x00)
> HCI Event: Command Complete (0x0e) plen 5 #117 [hci0] 10.927608
LE Set Extended Advertising Parameters (0x08|0x0036) ncmd 2
Status: Success (0x00)
TX power (selected): 0 dbm (0x00)
< HCI Command: LE Set Extended Ad.. (0x08|0x0039) plen 6 #118 [hci0] 10.928040
Extended advertising: Enabled (0x01)
Number of sets: 1 (0x01)
Entry 0
Handle: 0x01
Duration: 0 ms (0x00)
Max ext adv events: 0
> HCI Event: Command Complete (0x0e) plen 4 #119 [hci0] 10.933897
LE Set Extended Advertising Enable (0x08|0x0039) ncmd 2
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 19 #120 [hci0] 10.942881
LE Connection Complete (0x01)
Status: Success (0x00)
Handle: 24
Role: Peripheral (0x01)
Peer address type: Random (0x01)
Peer address: 48:AD:99:8B:C5:3D (Resolvable)
Connection interval: 45.00 msec (0x0024)
Connection latency: 0 (0x0000)
Supervision timeout: 5000 msec (0x01f4)
Central clock accuracy: 0x01
# MGMT Event: Device Connected (0x000b) plen 13 {0x0001} [hci0] 10.943295
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
Flags: 0x00000000
Data length: 0
< HCI Command: LE Read Remote Use.. (0x08|0x0016) plen 2 #121 [hci0] 10.943372
Handle: 24
> HCI Event: LE Meta Event (0x3e) plen 6 #122 [hci0] 10.944681
LE Advertising Set Terminated (0x12)
Status: Success (0x00)
Handle: 1
Connection handle: 24
Number of completed extended advertising events: 0
> HCI Event: Command Status (0x0f) plen 4 #123 [hci0] 10.946984
LE Read Remote Used Features (0x08|0x0016) ncmd 2
Status: Success (0x00)
> HCI Event: LE Meta Event (0x3e) plen 4 #124 [hci0] 10.979349
LE Channel Selection Algorithm (0x14)
Handle: 24
Algorithm: #2 (0x01)
> HCI Event: LE Meta Event (0x3e) plen 12 #125 [hci0] 11.024865
LE Read Remote Used Features (0x04)
Status: Success (0x00)
Handle: 24
Features: 0xbd 0x7f 0x00 0x37 0x01 0x00 0x00 0x00
LE Encryption
Extended Reject Indication
Peripheral-initiated Features Exchange
LE Ping
LE Data Packet Length Extension
Extended Scanner Filter Policies
LE 2M PHY
Stable Modulation Index - Transmitter
Stable Modulation Index - Receiver
LE Coded PHY
LE Extended Advertising
LE Periodic Advertising
Channel Selection Algorithm #2
Periodic Advertising Sync Transfer - Sender
Periodic Advertising Sync Transfer - Recipient
Sleep Clock Accuracy Updates
Connected Isochronous Stream - Central
Connected Isochronous Stream - Peripheral
Isochronous Channels (Host Support)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #126 [hci0] 11.158694
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 9 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #127 [hci0] 11.159017
LE L2CAP: Command Reject (0x01) ident 9 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #128 [hci0] 11.160874
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 10 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #129 [hci0] 11.161137
LE L2CAP: Command Reject (0x01) ident 10 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #130 [hci0] 11.162536
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 11 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #131 [hci0] 11.162874
LE L2CAP: Command Reject (0x01) ident 11 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #132 [hci0] 11.164513
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 12 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #133 [hci0] 11.164839
LE L2CAP: Command Reject (0x01) ident 12 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #134 [hci0] 11.166441
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 13 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #135 [hci0] 11.166739
LE L2CAP: Command Reject (0x01) ident 13 len 2
Reason: Command not understood (0x0000)
> ACL Data RX: Handle 24 flags 0x02 dlen 26 #136 [hci0] 11.168433
LE L2CAP: Enhanced Credit Connection Request (0x17) ident 14 len 18
PSM: 39 (0x0027)
MTU: 256
MPS: 251
Credits: 65535
Source CID: 75
Source CID: 82
Source CID: 64
Source CID: 65
Source CID: 66
< ACL Data TX: Handle 24 flags 0x00 dlen 10 #137 [hci0] 11.168788
LE L2CAP: Command Reject (0x01) ident 14 len 2
Reason: Command not understood (0x0000)
> HCI Event: Number of Completed Packets (0x13) plen 5 #138 [hci0] 11.207392
Num handles: 1
Handle: 24
Count: 1
> HCI Event: LE Meta Event (0x3e) plen 11 #139 [hci0] 11.211700
LE Data Length Change (0x07)
Handle: 24
Max TX octets: 251
Max TX time: 2120
Max RX octets: 27
Max RX time: 328
> HCI Event: Number of Completed Packets (0x13) plen 5 #140 [hci0] 11.213812
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #141 [hci0] 11.217827
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #142 [hci0] 11.221915
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #143 [hci0] 11.225994
Num handles: 1
Handle: 24
Count: 1
> HCI Event: Number of Completed Packets (0x13) plen 5 #144 [hci0] 11.251600
Num handles: 1
Handle: 24
Count: 1
# MGMT Command: Disconnect (0x0014) plen 7 {0x0001} [hci0] 14.821568
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
< HCI Command: Disconnect (0x01|0x0006) plen 3 #145 [hci0] 14.821608
Handle: 24
Reason: Remote User Terminated Connection (0x13)
> HCI Event: Command Status (0x0f) plen 4 #146 [hci0] 14.830653
Disconnect (0x01|0x0006) ncmd 2
Status: Success (0x00)
> HCI Event: Disconnect Complete (0x05) plen 4 #147 [hci0] 14.896228
Status: Success (0x00)
Handle: 24
Reason: Connection Terminated By Local Host (0x16)
# MGMT Event: Command Complete (0x0001) plen 10 {0x0001} [hci0] 14.896709
Disconnect (0x0014) plen 7
Status: Success (0x00)
LE Address: 48:AD:99:8B:C5:3D (Resolvable)
For this project, I would like the peripheral to be able to disconnect, without getting stuck in the connect/disconnect loop.
Attempting to manually disconnect via the console in the bluetoothctl menu returns the same results.
It doesn't seem that the error is in my application. Debug statements proof that the connect method doesn't get called.
Does anyone have any suggestions/solutions for this problem?
There are a few questions out there that have similar issues but none of the solutions help. I'm trying to connect an Android Things Raspberry Pi to Wifi. My 2.4 GHz wifi ssid is 'cake' and I even removed the passphrase to see if that would help. Here is what comes out in the logcat:
09-20 01:37:00.340 1233 1233 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) })
09-20 01:37:00.341 1233 1233 I WifiConfigurator: Connecting to network with SSID "cake"
09-20 01:37:00.345 1233 1251 W WifiManager: com.google.wifisetup attempted call to setWifiApEnabled: enabled = false
09-20 01:37:00.346 311 546 D WifiService: setWifiEnabled: true pid=1233, uid=1000, package=com.google.wifisetup
09-20 01:37:00.349 1233 1233 V WifiWatcher: Network state changed to DISCONNECTED
09-20 01:37:01.258 1233 1251 D WifiConfigurator: Adding new network
09-20 01:37:01.873 311 380 E WifiConfigManager: Cannot find network with networkId -1 or configKey "cake"NONE
09-20 01:37:01.874 311 380 E WifiConfigManager: Cannot find network with configKey "cake"NONE
09-20 01:37:02.648 311 323 D WificondControl: Scan result ready event
09-20 01:37:03.423 311 380 D WifiConfigStore: Writing to stores completed in 1304 ms.
09-20 01:37:03.430 311 380 D WifiStateMachine: connectToUserSelectNetwork netId 0, uid 1000, forceReconnect = false
09-20 01:37:04.261 311 380 D WifiConfigStore: Writing to stores completed in 823 ms.
09-20 01:37:34.306 1233 1251 E WifiConfigurator: Wifi failed to connect in 30000 ms
09-20 01:39:49.672 1233 1233 D WifiSetupService: onStartCommand(Intent { act=WifiSetupService.Connect cmp=com.google.wifisetup/.WifiSetupService (has extras) })
09-20 01:39:49.673 1233 1233 I WifiConfigurator: Connecting to network with SSID "cake"
09-20 01:39:49.675 1233 1279 W WifiManager: com.google.wifisetup attempted call to setWifiApEnabled: enabled = false
09-20 01:39:49.676 311 322 D WifiService: setWifiEnabled: true pid=1233, uid=1000, package=com.google.wifisetup
09-20 01:39:49.681 1233 1279 D WifiConfigurator: Updating existing network 0
09-20 01:39:49.906 311 380 D WifiConfigStore: Writing to stores completed in 219 ms.
09-20 01:39:49.909 311 380 D WifiStateMachine: connectToUserSelectNetwork netId 0, uid 1000, forceReconnect = false
09-20 01:39:49.945 311 380 D WifiConfigStore: Writing to stores completed in 32 ms.
09-20 01:39:50.195 311 920 D WificondControl: Scan result ready event
09-20 01:40:19.980 1233 1279 E WifiConfigurator: Wifi failed to connect in 30000 ms
Here is what I'm typing in the adb shell
rpi3:/ $ am startservice -n com.google.wifisetup/.WifiSetupService -a WifiSetupService.Connect -e ssid cake
I had also some issues setting up the Wifi.
Blundell's answer to my question solved the issues
Network: Wi-Fi cannot connect to the internet if Ethernet is also
connected to a network without internet access.
https://developer.android.com/things/preview/releases.html
I had to remove the Ethernet cable from the Pi-3 and then it connected to my WiFi
If you have no application installed on the Pi you can observce your connectivity state by attaching an external display using the HDMI port (a monitor would do the job).
You should see a screen like this:
I'm using the Facebook SDK on Android to post an update to the user's feed. I was able to get it to work when I did not have the Facebook client installed. Now, even after removing the Facebook app, when I try to authorize or open the feed dialog the activity is abrupty killed.
I don't get any message telling me that the app has crashed or anything. It's just destroyed. The only message is Mono telling me that the thread 0x0 has been prematurely finalized, which is odd. Also, there's this odd "Not supported in this case." message from webcore.
I'm using the NativeActivity class. I don't use it directly but I extend it in my activity. Here's the logcat from around where things go wrong:
I/PixelWorldEngine( 6796): Authorizing for Facebook...
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webview.db, flag = 6, cannot stat file, error message: No such file or directory
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webview.db, mode: delete, disk free size: 35 M, handle: 0x801450
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webviewCache.db, flag = 6, cannot stat file, error message: No such file or directory
D/Database( 6796): dbopen(): path = /data/data/com.ri.BubblingUpLite/databases/webviewCache.db, mode: delete, disk free size: 35 M, handle: 0x7ff128
D/skia ( 6796): htcFlashPlugin::htcFlashPlugin
W/webcore ( 6796): Not supported in this case.
I/PixelWorld-glue( 6796): WindowFocusChanged: 0x333288 -- 0
D/SensorService( 120): disable: connection.get() = 0x9f5c20
D/SensorService( 120): disable: get sensor name = BMA150 3-axis Accelerometer
D/SensorService( 120): SensorDevice::activate: handle = 0x0, enabled = 0x0
D/Sensors ( 120): Enable akm: en = 0
D/SensorService( 120): noteStopSensor: uid = 0x274d, handle = 0x0
D/SensorService( 120): pid=6796, uid=10061
D/SensorService( 120): Active sensors:
D/SensorService( 120): CM3602 Light sensor (handle=0x00000004, connections=1)
W/webcore ( 6796): Not supported in this case.
W/mono ( 6796): Thread 0x0 may have been prematurely finalized
D/SensorGUI( 120): ~SensorChannel: mSendFd = 255, mReceiveFd = -1
D/AudioPolicyService( 72): stopOutput() tid 2223
D/AudioPolicyService( 72): releaseOutput() tid 2223
D/AudioPolicyService( 72): releaseOutput() tid 2223
I/ActivityManager( 120): Process com.ri.BubblingUpLite (pid 6796) has died.
I/WindowManager( 120): WIN DEATH: Window{407e9548 com.ri.BubblingUpLite/com.ri.PixelWorldEngine.GameActivity paused=false}
I think it's an Android bug which seems to manifest on HTC devices.
See http://code.google.com/p/android/issues/detail?id=33612
My application connects to Bluetooth SPP modules by making and handling connections pretty much as described in the Android Bluetooth documentation. That is, in my connection thread, I have been used to making a connection simply using:
socket = device.createRfcommSocketToServiceRecord(MY_UUID)
where the UUID is the 'well known' SPP UUID, 00001101-0000-1000-8000-00805F9B34FB.
The Bluetooth devices I am connecting to are little Bluetooth / serial adapters. I have three that I've been using for test. Two of them are the "Linvor" Bluetooth to TTL-level serial PCBs that are all over eBay at the moment, which are identical; and the third is a completely enclosed adapter of manufacturer unknown.
Over the time I have been developing this application, I have routinely tested on various devices that range from Android version 2.2.1 (my old Archos 101) through to an Archos Honeycomb device. The device I have been testing on mostly is my Desire HD, which presently has Android version 2.3.5. Over the year or so I have been working on this, I can confidently say that I've never had any connection problems.
Yesterday during testing with my Desire HD (2.3.5) I found that the application would no longer connect to my Linvor Bluetooth PCB I have been working with mostly lately. After obtaining the socket using the line of code quoted above, when attempting socket.connect(), I would immediately get an IOException of Unable to start discovery.
The next thing I did was to swap over to my other spare Linvor module and attempt to pair and connect. The application connected just fine. I also then swapped in my third packaged Bluetooth adapter, and the application connected to that just fine, too. Going back to my first Linvor module, the application still refuses to connect. I ensure that I unpair the 'faulty' Linvor device on my Desire HD, turn off Bluetooth, power down the phone, remove and re-insert battery, power-up, re-pair etc. and then try once again. The application still refuses to connect to that first Linvor module, but connects fine to the second Linvor module and other adapter module.
I then grab my Archos 101 (2.2.1) and fire up a somewhat older build of my application that is still installed on it. The Archos 101 immediately connects to the 'faulty' Linvor module just fine.
At this point I am starting to wonder if either device - i.e. my Desire HD, or perhaps more likely the Linvor module - could have some corrupt entry in its flash memory table for paired devices. In other words, something within that first Linvor module that means it no longer accepts a connection (although it does accept a pairing) from my Desire HD, and yet it will still accept connections from other devices; and also at the same time my Desire HD can happily connect to other devices just as it always has done, including the other spare Linvor module.
After hours of head-scratching and desperation, I decided to try out the reflection connection method as described in Michael's answer here. This is something I have heard about quite a lot and I was under the impression that it's applicable to Android 2.2 and below. However, for the entire year that I have been working with Bluetooth SPP from my various Android devices, I have never needed to use it as .createRfcommSocketToServiceRecord() has always worked for me. So I use the code as given in Michael's answer to that question to create my socket, and to my amazement, my Desire HD connects to the 'faulty' Linvor module.
So to recap, the situation seems to be like this:
For the past year, I have been able to use .createRfcommSocketToServiceRecord() routinely on my 2.2.1 and 2.3.5 devices to connect to my three Bluetooth SPP adapters.
Then, one particular day, without any change to software on phones or on my Bluetooth adapters, the first of the adapters suddenly requires the reflection method for a connection to work; the other two adapters (one of which is the same type as the first) continue to connect with my application just fine using .createRfcommSocketToServiceRecord(). Note that there had been absolutely no changes made to my Bluetooth code immediately prior to this sudden changes in behaviour.
What on earth is going on here?
Can anyone advise me on what Android version level the reflection 'hack' should not be required? I was under the impression that it should not longer be necessary on, say, 2.3.5 (my Desire HD). Is that correct?
Is / was the nature of the bug with .createRfcommSocketToServiceRecord() such that connections would usually work, but sometimes not work depending on the phase of the moon?
Here is a Logcat output from when a connection fails with that particular Linvor module when using .createRfcommSocketToServiceRecord():
01-29 10:22:00.004: D/View(8165): onTouchEvent: viewFlags: 0x18005001
01-29 10:22:00.014: D/View(8165): onTouchEvent: isFocusable: true, isFocusableInTouchMode: false, isFocused: false; focusTaken: false
01-29 10:22:00.034: D/WindowManagerImpl(8165): finishRemoveViewLocked, mViews2: com.android.internal.policy.impl.PhoneWindow$DecorView#406215d8
01-29 10:22:00.074: I/BLZ20_WRAPPER(8165): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
01-29 10:22:00.084: D/BLZ20_WRAPPER(8165): blz20_init: initializing...
01-29 10:22:00.084: D/BTL_IFC_WRP(8165): wsactive_init: init active list
01-29 10:22:00.084: I/BTL_IFC(8165): main_client_thread: Client main thread starting
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_init: success
01-29 10:22:00.194: I/BTL_IFC(8165): BTL_IFC_RegisterSubSystem: Register subsystem [BTS]
01-29 10:22:00.194: I/BTL_IFC(8165): btl_ifc_ctrl_connect: Connect control channel for subsystem [BTS]
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_sock_create: CTRL
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_sock_create: 66
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_sock_connect: wrp_sock_connect brcm.bt.btlif:9000 (66)
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_sock_connect: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9000
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_sock_connect: wrp_sock_connect ret:0 server name:brcm.bt.btlif.9000
01-29 10:22:00.194: I/BTL_IFC_WRP(8165): wrp_sock_connect: Connected. (66)
01-29 10:22:00.194: I/BTL_IFC(8165): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ (BTS) 0 pbytes (hdl 66)
01-29 10:22:00.194: D/BTL_IFC(8165): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_wsock_create: BTS
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_alloc_new_sock: wrp_alloc_new_sock sub 16
01-29 10:22:00.194: D/BTL_IFC_WRP(8165): wrp_wsock_create: 67
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): btsk_alloc_add: success
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): btsk_dump_list: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_socket: return 67
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: success
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_setsockopt: success
01-29 10:22:00.194: D/BLZ20_ASOCKWRP(8165): asocket_init
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: s 67, cmd 3
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: s 67, cmd 4
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.194: D/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: transparant fcntl
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: s 69, cmd 3
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: wsock not found, pass through transparantly
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: s 69, cmd 4
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_wrp_fcntl: wsock not found, pass through transparantly
01-29 10:22:00.194: I/BLZ20_WRAPPER(8165): blz20_set_asocket: success (67,68,69)
01-29 10:22:00.214: I/BluetoothIF(8165): BEGIN mConnectThread
01-29 10:22:00.234: E/BluetoothIF(8165): TP: IOException error: java.io.IOException: Unable to start Service Discovery
01-29 10:22:00.234: E/BluetoothIF(8165): Unable to start Service Discovery
01-29 10:22:00.234: E/BluetoothIF(8165): Unable to start Service Discovery
01-29 10:22:00.234: D/BluetoothSocket(8165): close(): android.bluetooth.BluetoothSocket#405c8f78
01-29 10:22:00.234: D/BLZ20_ASOCKWRP(8165): asocket_abort [67,68,69]
01-29 10:22:00.234: I/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: s 67, how 2
01-29 10:22:00.234: D/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.234: I/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: shutdown socket
01-29 10:22:00.234: D/BLZ20_WRAPPER(8165): blz20_wrp_write: wrote 1 bytes out of 1 on fd 69
01-29 10:22:00.234: D/BLZ20_ASOCKWRP(8165): asocket_destroy
01-29 10:22:00.234: D/BLZ20_ASOCKWRP(8165): asocket_abort [67,68,69]
01-29 10:22:00.234: I/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: s 67, how 2
01-29 10:22:00.234: D/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.234: I/BLZ20_WRAPPER(8165): blz20_wrp_shutdown: shutdown socket
01-29 10:22:00.234: D/BLZ20_WRAPPER(8165): blz20_wrp_write: wrote 1 bytes out of 1 on fd 69
01-29 10:22:00.234: I/BLZ20_WRAPPER(8165): blz20_wrp_close: s 69
01-29 10:22:00.234: D/BLZ20_WRAPPER(8165): blz20_wrp_close: std close (69)
01-29 10:22:00.244: I/BLZ20_WRAPPER(8165): blz20_wrp_close: s 68
01-29 10:22:00.244: D/BLZ20_WRAPPER(8165): blz20_wrp_close: std close (68)
01-29 10:22:00.244: I/BLZ20_WRAPPER(8165): blz20_wrp_close: s 67
01-29 10:22:00.244: D/BLZ20_WRAPPER(8165): blz20_wrp_close: fd (-1:67), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
01-29 10:22:00.244: I/BLZ20_WRAPPER(8165): __close_prot_rfcomm: fd 67
01-29 10:22:00.244: I/BTL_IFC(8165): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_CLOSE (BTS) 8 pbytes (hdl 66)
01-29 10:22:00.244: D/BTL_IFC_WRP(8165): wrp_close_s_only: wrp_close_s_only [67] (67:-1) []
01-29 10:22:00.244: D/BTL_IFC_WRP(8165): wrp_close_s_only: data socket closed
01-29 10:22:00.244: D/BTL_IFC_WRP(8165): wsactive_del: delete wsock 67 from active list [ad40f904]
01-29 10:22:00.244: D/BTL_IFC_WRP(8165): wrp_close_s_only: wsock fully closed, return to pool
01-29 10:22:00.244: D/BLZ20_WRAPPER(8165): btsk_free: success
At present, the best course of action that I see is to design my code so that if the .createRfcommSocketToServiceRecord() method immediately fails with the "unable to start discovery" exception then to fall back to the relection method which, until today, I have never needed to use.
Additional information: My application targets API level 8. Suspecting that the RFCOMM connect bug affects Android 2.2 and below, I tried switching to API level 10 just to see if it would have any effect on the behaviour of .createRfcommSocketToServiceRecord(), but the problem persisted: attempts to connect to the one Linvor module resulted in immediate IOException as described above.
Thanks - Trev
Struggling the same problem. Using API 10 on 2 phones. Both with Android 4.0.4.
One phone constantly failing with "Unable to start discovery" but works with reflection.
Second phone giving "Permission denied" with reflection but works with createRfcommSocketToServiceRecord().
And for research I checked android sources.
So it fails here in BluetoothSocket.java:
boolean inProgress = false;
try {
inProgress = service.fetchRemoteUuids(device.getAddress(), uuid, this);
} catch (RemoteException e) {Log.e(TAG, "", e);}
if (!inProgress) throw new IOException("Unable to start Service Discovery");
But fetchRemoteUuids() has many fail points and no, they don't throw exceptions just return false.
BluetoothService.java:
public synchronized boolean fetchRemoteUuids(String address, ParcelUuid uuid,
IBluetoothCallback callback) {
mContext.enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
if (!BluetoothAdapter.checkBluetoothAddress(address)) {
return false;
}
RemoteService service = new RemoteService(address, uuid);
if (uuid != null && mUuidCallbackTracker.get(service) != null) {
// An SDP query for this address & uuid is already in progress
// Do not add this callback for the uuid
return false;
}
if (mUuidIntentTracker.contains(address)) {
// An SDP query for this address is already in progress
// Add this uuid onto the in-progress SDP query
if (uuid != null) {
mUuidCallbackTracker.put(new RemoteService(address, uuid), callback);
}
return true;
}
boolean ret;
if (getBondState(address) == BluetoothDevice.BOND_BONDED) {
String path = getObjectPathFromAddress(address);
if (path == null) return false;
// Use an empty string for the UUID pattern
ret = discoverServicesNative(path, "");
} else {
ret = createDeviceNative(address);
}
mUuidIntentTracker.add(address);
if (uuid != null) {
mUuidCallbackTracker.put(new RemoteService(address, uuid), callback);
}
Message message = mHandler.obtainMessage(MESSAGE_UUID_INTENT);
message.obj = address;
mHandler.sendMessageDelayed(message, UUID_INTENT_DELAY);
return ret;
}
Either native methods fail which leads us to drivers? Or "uuid is already in progress" part fails, because I don't see even a try to connect/scan uuid, just instantly getting exception.
Linvor 1.8 here.
I struggle with this device a lot. Your particular problem is one of the issues I encountered.
It can be resolved by pulling the reset pin down (jump the pin to GND with jumper wire) when the device is fully powered.
The reset pin is the 3rd pin from the bottom left of the device.
For me this will allow me to connect to the device once without reflection, but it can go back to the bad behavior again.
My suggestion is that you implement watchdog ping from android to the device and trigger reset command with the remaining GPIO pin when the timer reached.
As for why and what triggered the behavior. I still don't know, but hopefully someone will figure it out.
My suspect is that the device got stuck in an unknown state.
I have a Samsung Spica i5700 which I already have updated to Android 2.1. I am using the phone with an application called Run.GPS (http://www.rungps.net). This application logs data such as GPS position, route, speed, bearing etc. It can also log heartrate provided the user has a Zephyr HxM bluetooth heart rate monitor ("HxM"), which I do have.
I can pair the HxM to the phone through the standard bluetooth utility. I'm prompted for the PIN, which I enter and the device is shown as 'Paired but not connected'.
In the Run.GPS application itself, I click on 'Connect Heartrate Monitor'. This times out after about 30 seconds and the error message is 'Could not connect to heartrate monitor. Please try other settings'.
I used a friend's HTC Windows Mobile as a control device to see if the HxM works there. It does. The Run.GPS application automatically sets the baud rate (initially to 9600 IIRC, though the connection also worked with higher baud rates) and it is possible to choose between various COM ports as well as a .Net COM port.
I did some testing on my Spica Android, to try to find out why the bluetooth connection doesn't work. Below are some log files that I connected over adb when I clicked on 'Connect to Heartrate Monitor' in the Run.GPS application.
I would be interested in any tips (including if I'm posting to the wrong forum here ;-)) - whether or not it's possible to experiment with the baud rate in Android etc. I still don't know if the problem is with the Run.GPS application (I've posted already on the development forum there) or with Android 2.1. I checked out another application - Endomondo - which is also a sport tracking application which supports heartrate monitor only with the HxM. There, what looked like exactly the same error occurred - I clicked on 'Connect Zephyr HxM'. For a few seconds I was shown the 'Connecting...' status, but then it timed out into 'Not Connected'. I'm thus tending towards looking at Android for the problem.
Here's the output of adb logcat while trying to connect
./adb logcat | grep Run.GPS
D/WYNEX> (11551): Excute :: Run.GPS Trainer UV, (null)
E/Run.GPS (11997): Cannot connect to BT device
E/Run.GPS (11997): java.io.IOException: Service discovery failed
E/Run.GPS (11997): at android.bluetooth.BluetoothSocket$SdpHelper.doSdp(BluetoothSocket.java:374)
E/Run.GPS (11997): at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:184)
E/Run.GPS (11997): at ju.a(Unknown Source)
E/Run.GPS (11997): at qk.j(Unknown Source)
E/Run.GPS (11997): at fs.c(Unknown Source)
E/Run.GPS (11997): at le.a(Unknown Source)
E/Run.GPS (11997): at s.b(Unknown Source)
E/Run.GPS (11997): at pb.a(Unknown Source)
E/Run.GPS (11997): at as.a(Unknown Source)
E/Run.GPS (11997): at am.b(Unknown Source)
E/Run.GPS (11997): at gf.onTouchEvent(Unknown Source)
E/Run.GPS (11997): at android.view.View.dispatchTouchEvent(View.java:3709)
E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/Run.GPS (11997): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1665)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1107)
E/Run.GPS (11997): at android.app.Activity.dispatchTouchEvent(Activity.java:2061)
E/Run.GPS (11997): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1649)
E/Run.GPS (11997): at android.view.ViewRoot.handleMessage(ViewRoot.java:1694)
E/Run.GPS (11997): at android.os.Handler.dispatchMessage(Handler.java:99)
E/Run.GPS (11997): at android.os.Looper.loop(Looper.java:123)
E/Run.GPS (11997): at android.app.ActivityThread.main(ActivityThread.java:4363)
E/Run.GPS (11997): at java.lang.reflect.Method.invokeNative(Native Method)
E/Run.GPS (11997): at java.lang.reflect.Method.invoke(Method.java:521)
E/Run.GPS (11997): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
E/Run.GPS (11997): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
E/Run.GPS (11997): at dalvik.system.NativeStart.main(Native Method)
E/Run.GPS (11997): Cannot connect to BT device
E/Run.GPS (11997): java.io.IOException: Service discovery failed
Here's the output of dmesg while trying to connect the heartrate monitor
<4>[74726.239833] select 11691 (.serviceModeApp), adj 15, size 3205, to kill
<4>[74726.240741] select 11739 (com.wssnps), adj 15, size 3207, to kill
<4>[74726.246870] select 11750 (id.partnersetup), adj 15, size 3219, to kill
<4>[74726.253390] select 11857 (p.bluetoothicon), adj 15, size 3299, to kill
<4>[74726.259879] select 13131 (ndroid.settings), adj 15, size 4586, to kill
<4>[74726.266372] send sigkill to 13131 (ndroid.settings), adj 15, size 4586
<7>[74733.945097] [BT] GPIO_BT_WAKE = 1
<7>[74733.945121] [BT] wake_lock(bt_wake_lock)
<7>[74733.951799] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74733.951822] [BT] wake_lock timeout = 5 sec
<7>[74735.890196] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74736.150987] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74736.151009] [BT] wake_lock timeout = 5 sec
<7>[74737.490185] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74740.073913] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74740.073948] [BT] wake_lock timeout = 5 sec
<7>[74741.315336] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74743.249747] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74743.249768] [BT] wake_lock timeout = 5 sec
<7>[74744.865099] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74745.154487] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74745.154509] [BT] wake_lock timeout = 5 sec
<7>[74748.852534] [BT] GPIO_BT_HOST_WAKE = 0
<7>[74749.156256] [BT] GPIO_BT_HOST_WAKE = 1
<7>[74749.156278] [BT] wake_lock timeout = 5 sec
<7>[74750.490018] [BT] GPIO_BT_HOST_WAKE = 0
<4>[74754.230424] select 11691 (.serviceModeApp), adj 15, size 3191, to kill
<4>[74754.231326] select 11739 (com.wssnps), adj 15, size 3193, to kill
<4>[74754.237473] select 11750 (id.partnersetup), adj 15, size 3205, to kill
<4>[74754.243950] select 11857 (p.bluetoothicon), adj 15, size 3283, to kill
<4>[74754.250452] select 13140 (com.svox.pico), adj 15, size 3465, to kill
<4>[74754.256787] send sigkill to 13140 (com.svox.pico), adj 15, size 3465
Here's the logcat output when I click 'connect zephyr' in Endomondo
I/PUSH Event(19147): MotionEvent : QueuedEvent{43d7d480 MotionEvent{440b5680 action=1 x=228.28438 y=212.55624 pressure=0.0 size=0.0}}
D/BluetoothZephyrService(23605): connect to: 00:07:80:88:F5:AD
D/BluetoothSocket(23605): BluetoothSocket created fd: -1uuid00001101-0000-1000-8000-00805f9b34fbport -1
D/BluetoothSocket.cpp(23605): initSocketNative
I/BLZ20_WRAPPER(23605): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
D/BLZ20_WRAPPER(23605): blz20_init: initializing...
D/BTL_IFC_WRP(23605): wsactive_init: init active list
I/BTL_IFC (23605): main_client_thread: Client main thread starting
D/BLZ20_WRAPPER(23605): blz20_init: success
I/BTL_IFC (23605): BTL_IFC_RegisterSubSystem: Register subsystem [(null)]
I/BTL_IFC (23605): btl_ifc_ctrl_connect: Connect control channel for subsystem [(null)]
D/BTL_IFC_WRP(23605): wrp_sock_create: CTRL
D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1
D/BTL_IFC_WRP(23605): wrp_sock_create: 28
D/BTL_IFC_WRP(23605): wrp_sock_connect: wrp_sock_connect 127.0.0.1:9000 (28)
I/BTL-IFS (21889): main_server_thread: [CTRL] Client connected (14)
I/BTL_IFC_WRP(23605): wrp_sock_connect: Connected. (28)
I/BTL_IFC (23605): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ ((null)) 0 pbytes (hdl 28)
I/BTL-IFS (21889): attach_client: multiclient index 1
I/BTL-IFS (21889): attach_client: ######## Attached client subsystem (14) ########
I/BTL-IFS (21889): btl_if_notify_local_event: Notify local event BTLIF_SUBSYSTEM_ATTACHED
D/ (21889): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_SUBSYSTEM_ATTACHED (4112) on hdl 14
I/ (21889): btlif_rfc_ctrl_chan_attached: client attached ctrl handle 14
D/BTL-IFS (21889): send_registration_rsp: send_registration_rsp [0]
I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_REGISTER_SUBSYS_RSP (CTRL) 2 pbytes (hdl 14)
D/BTL_IFC (23605): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set
D/BTL_IFC_WRP(23605): wrp_wsock_create: (null)
D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 15
D/BTL_IFC_WRP(23605): wrp_wsock_create: 32
D/BLZ20_WRAPPER(23605): btsk_alloc_add: success
I/BLZ20_WRAPPER(23605): blz20_wrp_socket: return 32
D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: fd (-1:32), bta -1, rc 0, wflags 0x0
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success
D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: fd (-1:32), bta -1, rc 0, wflags 0x0
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success
D/BluetoothSocket.cpp(23605): ...fd 32 created (RFCOMM, lm = 26)
D/BluetoothSocket.cpp(23605): initSocketFromFdNative
D/BluetoothZephyrService(23605): setState() 0 -> 2
I/BluetoothZephyrService(23605): BEGIN mConnectThread
E/BluetoothService.cpp(19147): stopDiscoveryNative: D-Bus error in StopDiscovery: org.bluez.Error.Failed (Invalid discovery session)
D/BluetoothSocket(23605): connect
D/BluetoothSocket(23605): doSdp
I/BluetoothService.cpp(19147): ... Object Path = /org/bluez/21902/hci0/dev_00_07_80_88_F5_AD
I/BluetoothService.cpp(19147): ... Pattern = 00001101-0000-1000-8000-00805f9b34fb, strlen = 36
I/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 2
D/DEVICE (21902): *************DiscoverServices********
I/DTUN_HCID(21902): dtun_client_get_remote_svc_channel: starting discovery on (uuid16=0x0011)
I/DTUN_HCID(21902): bdaddr=00:07:80:88:F5:AD
I/DTUN_CLNT(21902): Client calling DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4)
I/ (21889): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 4354
I/ (21889): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_GET_REMOTE_SERVICE_CHANNEL (id 4), len 134
E/BTLD (21889): ****************search UUID = 1101***********
I//system/bin/btld(21888): btapp_dm_GetRemoteServiceChannel()
W/BTLD (21889): SDP - Rcvd conn cnf with error: 0x4 CID 0x42
I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 13 pbytes (hdl 10)
I/DTUN_CLNT(21902): dtun-rx signal [DTUN_SIG_DM_RMT_SERVICE_CHANNEL] (id 42) len 15
I/DTUN_HCID(21902): dtun_dm_sig_rmt_service_channel: success=1, service=00000000
E/DTUN_HCID(21902): discovery unsuccessful!
V/BluetoothEventRedirector(21741): Received android.bleutooth.device.action.UUID
E/CachedBluetoothDevice(21741): onUuidChanged: Time since last connect9266997
D/BluetoothService(19147): Cleaning up failed UUID channel lookup: 00:07:80:88:F5:AD 00001101-0000-1000-8000-00805f9b34fb
D/BluetoothSocket(23605): onRfcommChannelFound -1
D/BluetoothZephyrService(23605): setState() 2 -> 1
D/BluetoothSocket(23605): close
D/BluetoothSocket(23605): cancel
D/BluetoothSocket.cpp(23605): abortNative
D/BluetoothSocket.cpp(23605): ...asocket_abort(32) complete
D/BluetoothSocket.cpp(23605): destroyNative
D/BluetoothSocket.cpp(23605): ...asocket_destroy(32) complete
D/BluetoothZephyrService(23605): start
D/BluetoothSocket(23605): close
D/BluetoothSocket(23605): BluetoothSocket created fd: -1uuidnullport 1
D/BluetoothSocket.cpp(23605): initSocketNative
I/BLZ20_WRAPPER(23605): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
D/BTL_IFC_WRP(23605): wrp_wsock_create: (null)
D/BTL_IFC_WRP(23605): wrp_alloc_new_sock: wrp_alloc_new_sock sub 15
D/BTL_IFC_WRP(23605): wrp_wsock_create: 32
D/BLZ20_WRAPPER(23605): btsk_alloc_add: success
D/BLZ20_WRAPPER(23605): btsk_dump_list: fd (-1:32), bta -1, rc 0, wflags 0x0
I/BLZ20_WRAPPER(23605): blz20_wrp_socket: return 32
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########
D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: fd (-1:32), bta -1, rc 0, wflags 0x0
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########
D/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: fd (-1:32), bta -1, rc 0, wflags 0x0
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
I/BLZ20_WRAPPER(23605): blz20_wrp_setsockopt: success
D/BluetoothSocket.cpp(23605): ...fd 32 created (RFCOMM, lm = 26)
D/BluetoothSocket.cpp(23605): initSocketFromFdNative
D/BluetoothSocket(23605): bindListen
D/BluetoothSocket.cpp(23605): bindListenNative
I/BLZ20_WRAPPER(23605): blz20_wrp_bind: s 32
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########
D/BLZ20_WRAPPER(23605): blz20_wrp_bind: bind socket fd (-1:32), bta -1, rc 0, wflags 0x0
D/BLZ20_WRAPPER(23605): __bind_prot_rfcomm: rc_chan 1
D/BTL_IFC_WRP(23605): wrp_sock_bind: wrp_sock_bind on port 9050
I/BLZ20_WRAPPER(23605): blz20_wrp_listen: s 32, backlog 1
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 1, wflags 0x0
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########
D/BLZ20_WRAPPER(23605): blz20_wrp_listen: fd (-1:32), bta -1, rc 1, wflags 0x0
D/BLZ20_WRAPPER(23605): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_LISTEN_REQ, wait for |BTLIF_BTS_RFC_LISTEN_RSP|
D/BTL_IFC (23605): BTL_IFC_CtrlSend: BTL_IFC_CtrlSend
I/BTL_IFC (23605): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_LISTEN_REQ ((null)) 20 pbytes (hdl 28)
D/ (21889): btlif_bts_api_ctrl_cb: btlif_bts_api_ctrl_cb : id BTLIF_BTS_RFC_LISTEN_REQ (4433) on hdl 14
I/ (21889): btlif_rfc_listen_req: Allocated dynamic server channel 4
D/ (21889): bts_chan_alloc_add: bts_chan_alloc_add : success (tot 1)
D/ (21889): bts_chan_dump_all: ### channel list ###
D/ (21889): bts_chan_dump_all: type 3, dhdl -1, bta_hdl -1, scn -1, phdl 65535, lstpnd 0, -1:-1 (L:D)
I/ (21889): btlif_rfc_listen_req: start rfcomm server on scn 4, role 1, sec_mask 0x30
D/ (21889): jw_if_rfcomm_srv_cback: event=BTA_JV_RFCOMM_START_EVT
I/ (21889): jw_if_rfcomm_srv_cback: [BTA_JV_RFCOMM_START_EVT] start status: 0, handle:0, security id: 47
I/ (21889): jv_rfc_srv_listen_started: jv_rfc_srv_listen_started
I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_BTS_RFC_LISTEN_RSP () 17 pbytes (hdl 14)
I/BTL_IFC (23605): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_LISTEN_RSP ((null)) 19 pbytes (hdl 28)
I/BLZ20_WRAPPER(23605): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_LISTEN_RSP
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: WARNING : duplicate entries found for key 4, val 32#####
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 1, wflags 0x2
D/BLZ20_WRAPPER(23605): btsk_check_duplicates: fd (-1:32), bta -1, rc 0, wflags 0x0
E/BLZ20_WRAPPER(23605): ##### ERROR : btsk_check_duplicates: ### ASSERT : frameworks/base/core/jni/../../../../vendor/brcm/adaptation/btl-if/client/blz20_wrapper.c line 534 duplicates found (2) ########
I/BLZ20_WRAPPER(23605): btlif_process_listen_rsp: listen response for bta hdl 0
D/BLZ20_WRAPPER(23605): btlif_signal_event: fd (-1:32), bta 0, rc 1, wflags 0x2
D/BLZ20_WRAPPER(23605): btlif_signal_event: event BTLIF_BTS_RFC_LISTEN_RSP matched
D/BLZ20_WRAPPER(23605): btlif_send_msg_wait_response: unblocked fd (-1:32), bta 0, rc 1, wflags 0x0
I/BLZ20_WRAPPER(23605): __listen_prot_rfcomm: success, scn 4
D/BTL_IFC_WRP(23605): wrp_sock_listen_bl: wrp_sock_listen_bl : fd 32 127.0.0.1:9050 backlog 1
I/BLZ20_WRAPPER(23605): __listen_prot_rfcomm: success
D/BluetoothSocket.cpp(23605): ...bindListenNative(32) success
I/DTUN_CLNT(21902): Client calling DTUN_METHOD_DM_ADD_SDP_REC (id 17)
I/ (21889): DTUN_ReceiveCtrlMsg: [DTUN] Received message [BTLIF_DTUN_METHOD_CALL] 4354
I/ (21889): handle_method_call: handle_method_call :: received DTUN_METHOD_DM_ADD_SDP_REC (id 17), len 270
I/ (21889): btapp_bts_convert_rc_chan_to_scn: found scn 4
I/BTL-IFS (21889): send_ctrl_msg: [BTL_IFS CTRL] send BTLIF_DTUN_SIGNAL_EVT (CTRL) 12 pbytes (hdl 10)
I/DTUN_CLNT(21902): dtun-rx signal [DTUN_SIG_DM_SDP_REC_HANDLE] (id 50) len 14
I/DTUN_HCID(21902): dtun_dm_sig_sdp_rec_handle: handle = 0x10006
D/BluetoothService(19147): new handle 0
I/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 1
I/BluetoothZephyr(23605): Unable to connect device
D/BluetoothZephyrService(23605): setState() 1 -> 1
D/BluetoothZephyrService(23605): BEGIN mAcceptThreadThread[Thread-9,5,main]
D/BluetoothSocket(23605): accept
D/BluetoothSocket.cpp(23605): acceptNative
I/BluetoothZephyr(23605): MESSAGE_STATE_CHANGE: 1
D/WynexActivity(19215): <><><>ACTION ::android.intent.action.TIME_TICK
D/LocationMasfClient(19147): getNetworkLocation(): Location not found in cache, making network request
D/ProtoRequestListener(19147): requestFailed()
I/power (19147): *** set_screen_state 0
I got this information from the gps-sport forum. Not sure what to do with it though...
See also http://www.gps-sport.net/forums/thread/1532-0/Keine-Sprachausgabe-auf-HTC-Desire
Cross posting this entry from the software category. The thread over there deals with the Zephyr HxM as a secondary issue - meaning it mightn't be easy to find...
24.04.2010 16:47:05 UTC geändert am 24.04.2010 17:03:03 UTC
A fix to the bluetooth connection problem
Hi
If this problem still is not resolved, the code below describes how to make the connection work with Android 2.1 (Tested on HTC Desire). Just replace "00:07:80:89:EE:EB" with the MAC of your HXM to make it connect. After the connection is successful, a regular method with input = socket.getInputStream() can be used.
BluetoothDevice hxm = BluetoothAdapter.getDefaultAdapter().getRemoteDevice("00:07:80:89:EE:EB");
Method m = hxm.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
socket = (BluetoothSocket)m.invoke(hxm, Integer.valueOf(1));
socket.connect();
Hope the fix will be out very soon =)
Best regards
Espen S. Nygaard
Ok, solved it.
The solution is to update the firmware on the phone. I now have:
PDA: I570EXXJE1
PHONE: i570EXXJD1
CSC: I570EOXEJE1
and bluetooth spp worked 'out of the box'.
Look at http://samsung-firmwares.com for both the latest firmware as well as programs to flash the phone (odin) and details/tutorials.
This thread over at Google Groups (android-developers) is also interesting:
'
Is Google working on the Bluetooth bug? Any estimated date of completion? '
------ VERSION INFO ------
currenttime=Sat May 1 21:31:48 CEST 2010
kernel.version=Linux version 2.6.29 (root#SE-S611) (gcc version 4.3.1
(for S3C64XX Samsung Electronics AP Development Team) ) #2 Sat Mar 13
02:28:48 KST 2010
kernel.cmdline=# begin build properties
autogenerated by buildinfo.sh
ro.build.id=ECLAIR
ro.build.display.id=ECLAIR.XXJCB
ro.build.version.incremental=XXJCB
ro.build.version.sdk=7
ro.build.version.codename=REL
ro.build.version.release=2.1-update1
ro.build.date=2010. 03. 13. (토) 02:07:55 KST
ro.build.date.utc=1268413675
ro.build.type=user
ro.build.user=root
ro.build.host=SE-S611
ro.build.tags=ota-rel-keys,release-keys
ro.product.model=GT-I5700
ro.product.brand=Samsung
ro.product.name=GT-I5700
ro.product.device=GT-I5700
ro.product.board=GT-I5700
ro.product.cpu.abi=armeabi
ro.product.manufacturer=Samsung
ro.product.locale.language=en
ro.product.locale.region=GB
ro.wifi.channels=
ro.board.platform=s3c6410
ro.build.product is obsolete; use ro.product.device
ro.build.product=GT-I5700
Do not try to parse ro.build.description or .fingerprint
ro.build.description=GT-I5700-user 2.1-update1 ECLAIR XXJCB ota-rel-
keys,release-keys
ro.build.fingerprint=Samsung/GT-I5700/GT-I5700/GT-I5700:2.1-update1/
ECLAIR/XXJCB:user/ota-rel-keys,release-keys
Samsung Specific Properties
ro.build.PDA=I570EXXJCB
ro.build.Phone=I570EXXJCB
ro.build.HW=REV 0.1
ro.build.RFCallDate=2009.02.25
ro.build.hidden_ver=I570EXXJCB
ro.build.changelist=193516
ro.build.FUSDLMode=Change
ro.build.SupportFUS=TRUE
ro.build.CGMM=GT-I5700
ro.build.GMM=GT-I5700
end build properties
#
system.prop for spica
I found this exact problem happens when one of the devices has the Bluetooth turned off.
https://android.git.kernel.org/?p=platform/system/wlan/broadcom.git;a=commit;h=e10efcc0c020caa486fa9d8cd05c986fd86f7c44
may solve this. The commit log is:
"Add firmware for BCM4325"
If there was no firmware in the kernel to support this before, then it obviously would cause problems.
I guess I'll have to see if I can build android from source and install it on my phone :-(