in rx-central-ble/src/main/java/com/uber/rxcentralble/core/CorePeripheral.java [243:264]
private void processRead(SingleSubject<Pair<UUID, byte[]>> scopedSubject, UUID svc, UUID chr) {
synchronized (syncRoot) {
PeripheralError error = subscribeChecks();
if (error != null) {
scopedSubject.onError(error);
return;
}
BluetoothGattCharacteristic characteristic = getCharacteristic(svc, chr);
if (characteristic == null) {
scopedSubject.onError(new PeripheralError(MISSING_CHARACTERISTIC));
return;
}
readSubject = scopedSubject;
currentOperation = readSubject;
if (bluetoothGatt != null && !bluetoothGatt.readCharacteristic(characteristic)) {
readSubject.onError(new PeripheralError(READ_CHARACTERISTIC_FAILED, ERROR_STATUS_CALL_FAILED));
}
}
}