我正在BLE 4.2设备上运行具有自定义特征的自定义服务。我正在研究一个android应用程序来读取/写入特征等。我尝试的第一件事是读取特征。Android BLE服务缺失特征
我定义了一个UUID列表: List chars = new ArrayList <>();
我使用我知道的服务创建服务UUID: mCustomService = mBluetoothGatt.getService(MY_SERVICE_UUID);
我加载列表与4知道,从我服务的UUID:
chars.clear();
chars.add(UUID1);
chars.add(UUID2);
chars.add(UUID3);
chars.add(UUID4);
I read the first characteristic from the end of my list:
BluetoothGattCharacteristic mReadCharacteristic = mCustomService.getCharacteristic(chars.get(chars.size() - 1));
if(mReadCharacteristic != null)
mBluetoothGatt.readCharacteristic(mReadCharacteristic);
mReadCharacteristic始终返回null,该服务不包含我的特点。
如果我使用BLE“嗅探器”应用程序,那么我会看到所有的特征。
感谢
丰富
PS我不能在这里找出格式!