@Override public void onServicesDiscovered(BluetoothGatt gatt, int status) { if (gatt != null && status == BluetoothGatt.GATT_SUCCESS) { bluetoothGattService = gatt.getService(bleGattService.getServiceUUID()); if (bluetoothGattService != null && bleGattService.initializeCharacteristics(bluetoothGattService, gatt)) { callBack.onConnected(); return; } } close(); }
@Override public void onCharacteristicRead( BluetoothGatt gatt, BluetoothGattCharacteristic characteristic, int status) { if (bleGattService.containsCharacteristic(characteristic.getUuid())) { callBack.onCharacteristicRead(characteristic.getUuid(), characteristic.getValue()); } }