BLE 4.2 장치에서 사용자 지정 특성을 사용하여 사용자 지정 서비스를 실행하고 있습니다. 나는 특성을 읽고 쓰기 위해 안드로이드 애플 리케이션에서 일하고있다. 내가 먼저 시도하는 것은 특성을 읽는 것이다.Android BLE Service 누락 된 특성
나는 UUID 목록을 정의합니다 : List chars = new ArrayList <>();
내가 아는 서비스 UUID를 사용하여 서비스를 만듭니다. mCustomService = mBluetoothGatt.getService (MY_SERVICE_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을 반환
서비스 내 특성을 포함하지 않는 : 4 내 서비스에서 UUID를 알고 함께나는 목록을로드합니다.
BLE "스니퍼"앱을 사용하면 모든 특성을 볼 수 있습니다.
감사
리치
PS 내가 여기에 서식을 알아낼 수 없습니다!