Android 蓝牙开发——PBAP协议(十)

SDK路径:frameworks/base/core/java/android/bluetooth/

服务路径:packages/apps/Bluetooth/src/com/android/bluetooth/

        在使用协议类的时候无法找到该类,由于安卓源码中关于蓝牙协议的 Client 部分或相关接口都被 @hide 给隐藏掉了,这样 android.jar 满足不了安卓源码 framework 层开发人员的需求,可以使用反射机制或者引用 framework.jar 代替 android.jar。

位置:out\target\common\obj\JAVA_LIBRARIES\framework_intermediates\classes.jar

一、SDK 接口

        BluetoothPbapClient.java:蓝牙apk中的 PBAP 协议的代理类,应用通过此代理类访问 PBAP 协议的方法。

接口名 描述
connect 连接指定设备
disconnect 断开指定设备
getConnectedDevices 获取已连接设备列表
getDevicesMatchingConnectionStates 获取指定状态的设备列表
getConnectionState 获得指定设备的状态
setPriority 设置协议的优先级
getPriority 获取协议的优先级

猜你喜欢

转载自blog.csdn.net/c19344881x/article/details/128733449