format: remove trailing commas
This commit is contained in:
parent
f40450548f
commit
0523f7c17c
|
@ -120,7 +120,7 @@ data class MessagePacket(
|
||||||
ackNumber = ackNumber,
|
ackNumber = ackNumber,
|
||||||
source = Id(payload.copyOfRange(8, 12)),
|
source = Id(payload.copyOfRange(8, 12)),
|
||||||
destination = Id(payload.copyOfRange(12, 16)),
|
destination = Id(payload.copyOfRange(12, 16)),
|
||||||
payload = payload.copyOfRange(16, payloadEnd),
|
payload = payload.copyOfRange(16, payloadEnd)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
totalFragments = 0,
|
totalFragments = 0,
|
||||||
payload = payload.copyOfRange(0, end),
|
payload = payload.copyOfRange(0, end),
|
||||||
size = payload.size.toByte(),
|
size = payload.size.toByte(),
|
||||||
crc32 = crc32,
|
crc32 = crc32
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if (payload.size > FirstBlePacket.CAPACITY_WITHOUT_MIDDLE_PACKETS) {
|
if (payload.size > FirstBlePacket.CAPACITY_WITHOUT_MIDDLE_PACKETS) {
|
||||||
|
@ -28,7 +28,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
LastOptionalPlusOneBlePacket(
|
LastOptionalPlusOneBlePacket(
|
||||||
index = 1,
|
index = 1,
|
||||||
payload = payload.copyOfRange(end, payload.size),
|
payload = payload.copyOfRange(end, payload.size),
|
||||||
size = (payload.size - end).toByte(),
|
size = (payload.size - end).toByte()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
ret.add(
|
ret.add(
|
||||||
FirstBlePacket(
|
FirstBlePacket(
|
||||||
totalFragments = (middleFragments + 1).toByte(),
|
totalFragments = (middleFragments + 1).toByte(),
|
||||||
payload = payload.copyOfRange(0, FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS),
|
payload = payload.copyOfRange(0, FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
for (i in 1..middleFragments) {
|
for (i in 1..middleFragments) {
|
||||||
|
@ -58,7 +58,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
ret.add(
|
ret.add(
|
||||||
MiddleBlePacket(
|
MiddleBlePacket(
|
||||||
index = i.toByte(),
|
index = i.toByte(),
|
||||||
payload = p,
|
payload = p
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS,
|
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS,
|
||||||
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS + end
|
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS + end
|
||||||
),
|
),
|
||||||
crc32 = crc32,
|
crc32 = crc32
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if (rest > LastBlePacket.CAPACITY) {
|
if (rest > LastBlePacket.CAPACITY) {
|
||||||
|
@ -82,7 +82,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
|
||||||
payload = payload.copyOfRange(
|
payload = payload.copyOfRange(
|
||||||
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS + LastBlePacket.CAPACITY,
|
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS + LastBlePacket.CAPACITY,
|
||||||
payload.size
|
payload.size
|
||||||
),
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
|
||||||
private fun sp1sp2(sp1: ByteArray, sp2: ByteArray): PairMessage {
|
private fun sp1sp2(sp1: ByteArray, sp2: ByteArray): PairMessage {
|
||||||
val payload = StringLengthPrefixEncoding.formatKeys(
|
val payload = StringLengthPrefixEncoding.formatKeys(
|
||||||
arrayOf(SP1, SP2),
|
arrayOf(SP1, SP2),
|
||||||
arrayOf(sp1, sp2),
|
arrayOf(sp1, sp2)
|
||||||
)
|
)
|
||||||
return PairMessage(
|
return PairMessage(
|
||||||
sequenceNumber = seq,
|
sequenceNumber = seq,
|
||||||
|
@ -95,7 +95,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
|
||||||
private fun sps1(): PairMessage {
|
private fun sps1(): PairMessage {
|
||||||
val payload = StringLengthPrefixEncoding.formatKeys(
|
val payload = StringLengthPrefixEncoding.formatKeys(
|
||||||
arrayOf("SPS1="),
|
arrayOf("SPS1="),
|
||||||
arrayOf(pdmPublic + pdmNonce),
|
arrayOf(pdmPublic + pdmNonce)
|
||||||
)
|
)
|
||||||
return PairMessage(
|
return PairMessage(
|
||||||
sequenceNumber = seq,
|
sequenceNumber = seq,
|
||||||
|
@ -119,7 +119,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
|
||||||
private fun sps2(): PairMessage {
|
private fun sps2(): PairMessage {
|
||||||
val payload = StringLengthPrefixEncoding.formatKeys(
|
val payload = StringLengthPrefixEncoding.formatKeys(
|
||||||
arrayOf(SPS2),
|
arrayOf(SPS2),
|
||||||
arrayOf(pdmConf),
|
arrayOf(pdmConf)
|
||||||
)
|
)
|
||||||
return PairMessage(
|
return PairMessage(
|
||||||
sequenceNumber = seq,
|
sequenceNumber = seq,
|
||||||
|
|
|
@ -17,7 +17,7 @@ class HistoryMapper {
|
||||||
tempBasalRecord = historyRecord.record as? TempBasalRecord,
|
tempBasalRecord = historyRecord.record as? TempBasalRecord,
|
||||||
bolusRecord = historyRecord.record as? BolusRecord,
|
bolusRecord = historyRecord.record as? BolusRecord,
|
||||||
resolvedResult = historyRecord.resolvedResult,
|
resolvedResult = historyRecord.resolvedResult,
|
||||||
resolvedAt = historyRecord.resolvedAt,
|
resolvedAt = historyRecord.resolvedAt
|
||||||
)
|
)
|
||||||
|
|
||||||
fun entityToDomain(entity: HistoryRecordEntity): HistoryRecord =
|
fun entityToDomain(entity: HistoryRecordEntity): HistoryRecord =
|
||||||
|
|
Loading…
Reference in a new issue