bluetooth记录

1. 网址

 Client Characteristic Configuration

https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml

2.  try to reset the bluetooth cache first via Settings -> Apps -> All -> Bluetooth Share -> Clear Data 

3. android端的BLE central apk连接BLE peripheral device时,始终失败,显示如下信息

04-27 02:53:44.069: D/BluetoothGatt(3563): onClientConnectionState() - status=133 clientIf=5 device=00:02:72:00:00:01

之前的广播包为0x04, 0xff, 0xc0, 0xff, 0x01
解决方法:android peripheral device 广播包前面添加0x02 0x01 0x06

如果peripheral广播的是非连接的广播数据,则android端作为central,尝试调用

mBluetoothGatt = device.connectGatt(this, false, mGattCallback);连接remote peripheral device就会出现onClientConnectionState() - status=133错误。

4. android似乎将gatt的角色进行了绑定

android作为peripheral,则它上层应用的角色就是gatt server

android作为central,则它上层应用的角色就是gatt clent

因此这种绑定,限制了某些应用场景。

5. 在自定义服务和特性时,注意SampleGattAttributes.java中uuid的自定义

原文地址:https://www.cnblogs.com/wi100sh/p/4459743.html