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的自定义

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值