dash ble: check for RTS
This commit is contained in:
parent
9597922058
commit
547454de6c
|
@ -84,7 +84,11 @@ class MessageIO(
|
|||
}
|
||||
|
||||
fun receiveMessage(): MessagePacket? {
|
||||
cmdBleIO.expectCommandType(BleCommandRTS, MESSAGE_READ_TIMEOUT_MS)
|
||||
val expectRTS = cmdBleIO.expectCommandType(BleCommandRTS, MESSAGE_READ_TIMEOUT_MS)
|
||||
if (expectRTS !is BleConfirmSuccess) {
|
||||
aapsLogger.warn(LTag.PUMPBTCOMM, "Error reading RTS: $expectRTS")
|
||||
return null
|
||||
}
|
||||
|
||||
val sendResult = cmdBleIO.sendAndConfirmPacket(BleCommandCTS.data)
|
||||
if (sendResult !is BleSendSuccess) {
|
||||
|
|
|
@ -91,7 +91,6 @@ class Connection(val podDevice: BluetoothDevice, private val aapsLogger: AAPSLog
|
|||
val discovered = discoverer.discoverServices()
|
||||
dataBleIO.characteristic = discovered[CharacteristicType.DATA]!!
|
||||
cmdBleIO.characteristic = discovered[CharacteristicType.CMD]!!
|
||||
|
||||
cmdBleIO.hello()
|
||||
cmdBleIO.readyToRead()
|
||||
dataBleIO.readyToRead()
|
||||
|
|
Loading…
Reference in a new issue