Android Question HFP AT commands

Philip Prins

Active Member
Licensed User
Longtime User
Hello

I want to receive the AT commands from my Bluetooth headset thru the HFP link.

I found this: https://developer.android.com/reference/android/bluetooth/BluetoothHeadset

In the unfiltered logs i see this command when pressing the button:
processVendorSpecificAt: unsupported command: +PTT=101,0

In the description :

VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY

The intent category to be used with ACTION_VENDOR_SPECIFIC_HEADSET_EVENT for the companyId

How to implement this in B4A?

Thanks in advance
Philip
 

Philip Prins

Active Member
Licensed User
Longtime User
Hello Erel,

This is what the manufacturer says:
Mic / Headset will send the PTT commands via HFP link as follows:



PTT press down send out: "AT+XEVENT=TALK,1\r"



PTT release send out: "AT+XEVENT=TALK,0\r"



Again, the PTT command is issued via HFP to connect.
 
Upvote 0

Philip Prins

Active Member
Licensed User
Longtime User
Hello Erel,

This is what the manufacturer says:
Mic / Headset will send the PTT commands via HFP link as follows:



PTT press down send out: "AT+XEVENT=TALK,1\r"



PTT release send out: "AT+XEVENT=TALK,0\r"



Again, the PTT command is issued via HFP to connect.
I also found this on the internet :
filter.addCategory(BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY+"."+BluetoothAssignedNumbers.PLANTRONICS);

https://stackoverflow.com/questions/25198100/android-bluetooth-get-device-specific-at-commands
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Setup a intent-filter in your manifest and parse the intents coming in.

Based on the Googledocumentation you posted it is all based on Intents which you should listen for.
 
Upvote 0

Philip Prins

Active Member
Licensed User
Longtime User
Setup a intent-filter in your manifest and parse the intents coming in.

Based on the Googledocumentation you posted it is all based on Intents which you should listen for.
Thanks , but i am not quite sure the definition of the intent .

Should it be this : BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY+"."+BluetoothAssignedNumbers.PLANTRONICS
 
Upvote 0

Philip Prins

Active Member
Licensed User
Longtime User
1. Search the forum about INTENT FILTERS
2. Read google documentation what intent you should listen to and which extras the Intent have. It is all described in the documentation.
3. Setup a intent filter and parse the incoming intent(s).
Tried the different intents mentioned to start a service.
Added Bluetooth permissions.
No luck

Do not know why they make it so complicated .
Will use another device that supports SPP.
 
Upvote 0
Top