Android Question Bluetooth Button (need tutorial)

appie21

Active Member
Licensed User
Longtime User
Hi thanks via usb I get more info indeed

the log says

bta_dm_acl_change info: 0x0
remote version info [00:0b:d5:61:78:16]: 0, 0, 0
state12newState0
[BluetoothConnectionTracker] Bluetooth connect broadast for Jabra SP200 00:0B:D5:61:78:16
btm_sec_disconnected clearing pending flag handle:12 reason:19
state12newState1
[BluetoothConnectionTracker] Bluetooth disconnect broadast for Jabra SP200 00:0B:D5:61:78:16


What to dow now

I have add

AddReceiverText(S1,
<intent-filter android:priority="2147483647">
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
)
 
Upvote 0

stari

Active Member
Licensed User
Longtime User
Hi thanks via usb I get more info indeed

the log says

bta_dm_acl_change info: 0x0
remote version info [00:0b:d5:61:78:16]: 0, 0, 0
state12newState0
[BluetoothConnectionTracker] Bluetooth connect broadast for Jabra SP200 00:0B:D5:61:78:16
btm_sec_disconnected clearing pending flag handle:12 reason:19
state12newState1
[BluetoothConnectionTracker] Bluetooth disconnect broadast for Jabra SP200 00:0B:D5:61:78:16


What to dow now

I have add

AddReceiverText(S1,
<intent-filter android:priority="2147483647">
<action android:name="android.intent.action.MEDIA_BUTTON"/>
</intent-filter>
)
Search community for "headset" and you will find some solutions. For me, for example, work very well.
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
I have try hard to get this fixed.

How can I work with the data of the log file?

I not need to connect the bluetooth device with a function it is already connected to the device!
 
Upvote 0

Troberg

Well-Known Member
Licensed User
Longtime User
I have a similar problem. Got a bunch of bluetooth earpieces, which I want to use as push-to-talk walkie talkies. Basically, push the button in your ear, and everything you say will be sent by your phone to the other users.

I get no keypress, but the music player on the phon toggles play/pause. Is there a way to get that click?

If anyone is interested, it's this one (very nice, recommended): http://www.aliexpress.com/item/Smal...th-Mini-Earphone-Headset-YKS/32318905350.html
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
The unfiltered logs show all the output of all programs. It is hard to say what is the meaning of this message.
Hi i ave connected a another headset who give these info when i press the home button

btm_pm_proc_mode_change switched from ACTIVE to SNIFF.
PORT_DataInd, p_port:0xf408b964, p_data_co_callback is null
btm_pm_snd_md_req switching from SNIFF to ACTIVE.
btm_pm_proc_mode_change switched from UNKNOWN to ACTIVE.
NeighborEvent{elapsedMs=85691795, 192.168.0.1, [CC3540EA3115], RTM_NEWNEIGH, NUD_STALE}


and

PORT_DataInd, p_port:0xf408b964, p_data_co_callback is null

Can I do something with this?
 
Last edited:
Upvote 0

appie21

Active Member
Licensed User
Longtime User
I don't think so.


now i get this


bta_dm_acl_change info: 0x0
remote version info [00:1a:45:54:2d:77]: 0, 0, 0
state12newState0
[BluetoothConnectionTracker] Bluetooth connect broadast for Bluetooth headset 00:1A:45:54:2D:77
new conn_srvc id:5, app_id:0
bta_sys_stop_timer expected alarm was not in bta alarm hash map.
connection_state_callback
connection_state_callback
processConnectionEvent state = 2, device = 00:1A:45:54:2D:77
HFP Connected from Disconnected state
getAdapterService() - returning com.android.bluetooth.btservice.AdapterService@220460d
Incoming Hf rejected. priority=0 bondState=12
getAdapterService() - returning com.android.bluetooth.btservice.AdapterService@220460d
processConnectionEvent state = 3, device = 00:1A:45:54:2D:77
Incorrect state: 3
port_rfc_closed RFCOMM connection in state 3 closed: Closed (res: 19)
bta_sys_stop_timer expected alarm was not in bta alarm hash map.
BTA_AG_SCO_SHUTDOWN_ST: Ignoring event 4
connection_state_callback
processConnectionEvent state = 0, device = 00:1A:45:54:2D:77
Ignore HF DISCONNECTED event, device: 00:1A:45:54:2D:77
btm_sec_disconnected clearing pending flag handle:12 reason:22
state12newState1
[BluetoothConnectionTracker] Bluetooth disconnect broadast for Bluetooth headset 00:1A:45:54:2D:77

hope this will bring me luck
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
by the way

if i run the tutorial

https://www.b4x.com/android/forum/threads/android-serial-tutorial.6908/#post-39900

or
i get this

[BluetoothConnectionTracker] Bluetooth connect broadast for Bluetooth headset 00:1A:45:54:2D:77
process_service_search_attr_rsp
find_rfc_slot_by_id unable to find RFCOMM slot id: 18
java.io.IOException: read failed, socket might closed or timeout, read ret: -1
at android.bluetooth.BluetoothSocket.readAll(BluetoothSocket.java:684)
at android.bluetooth.BluetoothSocket.readInt(BluetoothSocket.java:696)
at android.bluetooth.BluetoothSocket.connect(BluetoothSocket.java:373)
at anywheresoftware.b4a.objects.Serial$1.run(Serial.java:157)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
btm_sec_disconnected clearing pending flag handle:11 reason:22
state12newState1
[BluetoothConnectionTracker] Bluetooth disconnect broadast for Bluetooth headset 00:1A:45:54:2D:77
 
Upvote 0

appie21

Active Member
Licensed User
Longtime User
It will not work. You cannot connect to a headset with SPP (serial profile). The connection is handled by the OS.
this morning I buy a Jabra headset Bluetooth 4.0

i get

NeighborEvent{elapsedMs=158253241, 192.168.0.1, [CC3540EA3115], RTM_NEWNEIGH, NUD_REACHABLE}
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
writeEvent level_changed STREAM_BLUETOOTH_SCO 10
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
processVendorSpecificAt: unsupported command: +IPHONEACCEV=2,1,4,2,0
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
processVendorSpecificAt: unsupported command: +IPHONEACCEV=2,1,4,2,0
starting scan for "Cisco boven"WPA_PSK with 2437
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
writeEvent level_changed STREAM_BLUETOOTH_SCO 9
processVendorSpecificAt: unsupported command: +IPHONEACCEV=2,1,4,2,0
PORT_DataInd, p_port:0xf408c3f0, p_data_co_callback is null
processVendorSpecificAt: unsupported command: +IPHONEACCEV=2,1,4,2,0


i get these actions when i pres the up and down volume

Can I do something with this?
i found STREAM_BLUETOOTH_SCO 9
 
Upvote 0

Similar Threads

Top