H haesca29 Member Licensed User Longtime User Oct 27, 2012 #1 A greeting to all as I can detect a command sent by a Bluetooth, I need help Headset Button Press => AT+CKPD=200 =>Command issued by HS to indicate that the button has been pressed. TK De Antemano Gracias
A greeting to all as I can detect a command sent by a Bluetooth, I need help Headset Button Press => AT+CKPD=200 =>Command issued by HS to indicate that the button has been pressed. TK De Antemano Gracias
Erel B4X founder Staff member Licensed User Longtime User Oct 27, 2012 #2 Have you tried to intercept the keypress with Activity_KeyPress sub? Upvote 0
H haesca29 Member Licensed User Longtime User Oct 27, 2012 #3 Hello Erel I try, in this way Code: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode=KeyCodes.KEYCODE_HEADSETHOOK Then Label1.Color = Colors.Red End If Label1.Text = KeyCode End Sub KeyCodes.KEYCODE_HEADSETHOOK => works with handsfree cable: KeyCodes.KEYCODE_HEADSETHOOK => No works with handsfree Bluetooth Label1.Text = KeyCode => not generate code by pressing button Bluetooth Handsfree Erel I thank you for the help you can give me Upvote 0
Hello Erel I try, in this way Code: Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event If KeyCode=KeyCodes.KEYCODE_HEADSETHOOK Then Label1.Color = Colors.Red End If Label1.Text = KeyCode End Sub KeyCodes.KEYCODE_HEADSETHOOK => works with handsfree cable: KeyCodes.KEYCODE_HEADSETHOOK => No works with handsfree Bluetooth Label1.Text = KeyCode => not generate code by pressing button Bluetooth Handsfree Erel I thank you for the help you can give me
Erel B4X founder Staff member Licensed User Longtime User Oct 27, 2012 #4 Try to intercept the following intent action: "android.intent.action.MEDIA_BUTTON" Intent Filters - Intercepting SMS messages in the background Upvote 0
Try to intercept the following intent action: "android.intent.action.MEDIA_BUTTON" Intent Filters - Intercepting SMS messages in the background
H haesca29 Member Licensed User Longtime User Oct 27, 2012 #5 Hello Erel I did this, but it only works with handsfree cable Manifest Editor Code: ) AddReceiverText(S1,<intent-filter android:priority="2147483647"> <action android:name="android.intent.action.MEDIA_BUTTON"/> </intent-filter> ) Service Module Code: Sub Service_Start(StartingIntent As Intent) ' If StartingIntent.Action = "android.intent.action.MEDIA_BUTTON" Then Log("se oprimio boton del manos libres") End If End Sub what I have researched, is that when you press the handsfree button it sends an AT command AT+CKPD=200 =>Command issued by HS to indicate that the button has been pressed. Help Me Upvote 0
Hello Erel I did this, but it only works with handsfree cable Manifest Editor Code: ) AddReceiverText(S1,<intent-filter android:priority="2147483647"> <action android:name="android.intent.action.MEDIA_BUTTON"/> </intent-filter> ) Service Module Code: Sub Service_Start(StartingIntent As Intent) ' If StartingIntent.Action = "android.intent.action.MEDIA_BUTTON" Then Log("se oprimio boton del manos libres") End If End Sub what I have researched, is that when you press the handsfree button it sends an AT command AT+CKPD=200 =>Command issued by HS to indicate that the button has been pressed. Help Me
Erel B4X founder Staff member Licensed User Longtime User Oct 28, 2012 #6 The problem is that it is the OS that handles this Bluetooth connection. So you cannot intercept the raw data. Upvote 0
The problem is that it is the OS that handles this Bluetooth connection. So you cannot intercept the raw data.
H haesca29 Member Licensed User Longtime User Oct 29, 2012 #7 and if my program manages the Bluetooth connection, they might do something? Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Oct 29, 2012 #8 Your program can only manage SPP (serial communication protocol) connections. Upvote 0
F fabioferreiracs Member Licensed User Longtime User Dec 18, 2012 #9 haesca29 ,you have sucess to connect a bluetooth headset? Upvote 0