像这样连接到特定的 ScanResult 后
bluetoothGatt = scanResult.getDevice().connectGatt(getActivity(), false, new MyBluetoothGattCallback());
我调用 AndroidsBluetoothGatt.discoverServices()
方法并在BluetoothGattCallback.onServicesDiscovered()
我调用getServices()
.BluetoothGatt
当我列出服务和相关特征时,我得到了更多我所期望的。在 iPad 上用 LightBlue 模拟的这个 Peripheral 上应该是 1 个具有 1 个特性的服务,但是还有更多的服务.. 看看我的日志:
MyBluetoothGattCallback﹕ service: 00001800-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a00-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a01-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ service: 00001801-0000-1000-8000 -00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a05-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ service: d0611e78-bbb4-4591-a5f8-487910ae4366 MyBluetoothGattCallback﹕ characteristic: 8667556c-9a37-4c91-84ed-54ee27d90049 MyBluetoothGattCallback﹕ service: 7905f431-b5ce-4e99 -a40f-4b1e122d00d0 MyBluetoothGattCallback﹕特征:69d1d8f3-45e1-49a8-9821-9bbdfdaad9d9 MyBluetoothGattCallback﹕特征:9fbf120d-6301-42d9-8c58-25e699a21dbd MyBluetoothGattCallback﹕特征:22eac6e9-24d6-4bb5-be44-b36ace7c7bfb MyBluetoothGattCallback﹕ service: 0000180f-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a19-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ service: 00001805-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a2b-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ characteristic: 00002a0f-0000-1000-8000-00805f9b34fb MyBluetoothGattCallback﹕ service: 89d3502b-0f36-433a-8ef4-c502ad55f8dc MyBluetoothGattCallback﹕ characteristic: 9b3c81d8-57b1-4a8a-b8df-0e56f7ca51c2 MyBluetoothGattCallback:特征:2f7cabce-808d-411f-9a0c-bb92ba96c102 MyBluetoothGattCallback:特征:c6b2f38c-23ab-46d8-a6ab-a3a870bbd5d7 MyBluetoothGattCallback:服务:00001111-0000-1000-8000b:MyBluetoothGattfCallback934:-008000002222-0000-1000-8000-00805f9b34fb
有人能解释一下为什么我在那里得到这么多服务吗?有缓存吗?