in rx-central-ble/src/main/java/com/uber/rxcentralble/core/CorePeripheral.java [345:370]
private void processUnregisterNotification(
SingleSubject<UUID> 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;
}
registerNotificationSubject = scopedSubject;
currentOperation = registerNotificationSubject;
if (bluetoothGatt != null) {
error = setCharacteristicNotification(bluetoothGatt, characteristic, false);
if (error != null) {
registerNotificationSubject.onError(new PeripheralError(UNREGISTER_NOTIFICATION_FAILED, error));
}
}
}
}