private boolean hasProperty(BluetoothGattCharacteristic characteristic, int property) {
        return characteristic != null && (characteristic.getProperties() & property) > 0;
    }
This method updates the UI to a proper state.

@param characteristic a nullable {@link BluetoothGattCharacteristic}. If it is null then UI is assuming a disconnected state.
sample/src/main/java/com/polidea/rxandroidble2/sample/example4_characteristic/CharacteristicOperationExampleActivity.java