Android的蓝牙:获得设备特定AT命令 [英] Android Bluetooth : get Device Specific AT commands

查看:2199
本文介绍了Android的蓝牙:获得设备特定AT命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT 意图得到具体的AT命令的设备。但是,当我从我的蓝牙套件发送AT命令broadcastreciever不火。

当我送 AT + CHUP \\ r 从我的包在Android上工作,该命令在内部和断开呼叫。
但是,当我发 AT + XEVENT = foo,那么3 \\ r 从工具包,但我没有得到任何东西接收机。

帮我出


解决方案

我也有一个很难得到供应商的特定事件耳机上班,但最后还是想通了。你必须添加要接收到注册广播接收器时指定的IntentFilter的供应商特定事件的类别。

后加入

<$p$p><$c$c>filter.addCategory(BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY+\".\"+BluetoothAssignedNumbers.PLANTRONICS);

我现在接收器会从蓝牙耳机的供应商特定广播。活动如 AT + XEVENT = foo,那么3 \\ r

I am using "android.bluetooth.headset.action.VENDOR_SPECIFIC_HEADSET_EVENT" intent to get device specific AT commands. But the broadcastreciever didn't fire when I send AT command from MY Bluetooth Kit.

When I send AT+CHUP\r from my kit the android work on this command internally and disconnects the call. But when I send AT+XEVENT=foo,3\r from kit but I am not getting any thing in receiver.

Help me out

解决方案

I also had a hard time getting the vendor specific headset event to work, but finally figured it out. You have to add the Category of vendor specific events you want to receive to the IntentFilter specified when registering the Broadcast Receiver.

After adding

filter.addCategory(BluetoothHeadset.VENDOR_SPECIFIC_HEADSET_EVENT_COMPANY_ID_CATEGORY+"."+BluetoothAssignedNumbers.PLANTRONICS);

my receiver now gets the Vendor Specific broadcasts from the bluetooth headset. Events such as AT+XEVENT=foo,3\r

这篇关于Android的蓝牙:获得设备特定AT命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆