Skip to content

Commit

Permalink
Get rid of some !!
Browse files Browse the repository at this point in the history
  • Loading branch information
weliem committed Jan 29, 2022
1 parent eeb6bc3 commit dcb0243
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ class BluetoothPeripheral internal constructor(
state = BluetoothProfile.STATE_DISCONNECTING
scope.launch {
if (state == BluetoothProfile.STATE_DISCONNECTING && bluetoothGatt != null) {
bluetoothGatt!!.disconnect()
bluetoothGatt?.disconnect()
}
}
} else {
Expand Down Expand Up @@ -810,7 +810,7 @@ class BluetoothPeripheral internal constructor(
return enqueue {
if (isConnected) {
currentResultCallback = resultCallback
if (bluetoothGatt!!.readCharacteristic(characteristic)) {
if (bluetoothGatt?.readCharacteristic(characteristic) == true) {
Logger.d(TAG, "reading characteristic <%s>", characteristic.uuid)
nrTries++
} else {
Expand Down Expand Up @@ -911,7 +911,7 @@ class BluetoothPeripheral internal constructor(
Logger.w(TAG, "value byte array is longer than allowed by MTU, write will fail if peripheral does not support long writes")
}
characteristic.value = bytesToWrite
if (bluetoothGatt?.writeCharacteristic(characteristic) ?: false) {
if (bluetoothGatt?.writeCharacteristic(characteristic) == true) {
Logger.d(TAG, "writing <%s> to characteristic <%s>", BluetoothBytesParser.bytes2String(bytesToWrite), characteristic.uuid)
nrTries++
} else {
Expand Down

0 comments on commit dcb0243

Please sign in to comment.