format: remove trailing commas

This commit is contained in:
Andrei Vereha 2021-03-01 15:20:02 +01:00
parent f40450548f
commit 0523f7c17c
4 changed files with 11 additions and 11 deletions

View file

@ -120,7 +120,7 @@ data class MessagePacket(
ackNumber = ackNumber,
source = Id(payload.copyOfRange(8, 12)),
destination = Id(payload.copyOfRange(12, 16)),
payload = payload.copyOfRange(16, payloadEnd),
payload = payload.copyOfRange(16, payloadEnd)
)
}
}

View file

@ -20,7 +20,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
totalFragments = 0,
payload = payload.copyOfRange(0, end),
size = payload.size.toByte(),
crc32 = crc32,
crc32 = crc32
)
)
if (payload.size > FirstBlePacket.CAPACITY_WITHOUT_MIDDLE_PACKETS) {
@ -28,7 +28,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
LastOptionalPlusOneBlePacket(
index = 1,
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(
FirstBlePacket(
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) {
@ -58,7 +58,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
ret.add(
MiddleBlePacket(
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 + end
),
crc32 = crc32,
crc32 = crc32
)
)
if (rest > LastBlePacket.CAPACITY) {
@ -82,7 +82,7 @@ internal class PayloadSplitter(private val payload: ByteArray) {
payload = payload.copyOfRange(
middleFragments * MiddleBlePacket.CAPACITY + FirstBlePacket.CAPACITY_WITH_MIDDLE_PACKETS + LastBlePacket.CAPACITY,
payload.size
),
)
)
)
}

View file

@ -82,7 +82,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
private fun sp1sp2(sp1: ByteArray, sp2: ByteArray): PairMessage {
val payload = StringLengthPrefixEncoding.formatKeys(
arrayOf(SP1, SP2),
arrayOf(sp1, sp2),
arrayOf(sp1, sp2)
)
return PairMessage(
sequenceNumber = seq,
@ -95,7 +95,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
private fun sps1(): PairMessage {
val payload = StringLengthPrefixEncoding.formatKeys(
arrayOf("SPS1="),
arrayOf(pdmPublic + pdmNonce),
arrayOf(pdmPublic + pdmNonce)
)
return PairMessage(
sequenceNumber = seq,
@ -119,7 +119,7 @@ internal class LTKExchanger(private val aapsLogger: AAPSLogger, private val msgI
private fun sps2(): PairMessage {
val payload = StringLengthPrefixEncoding.formatKeys(
arrayOf(SPS2),
arrayOf(pdmConf),
arrayOf(pdmConf)
)
return PairMessage(
sequenceNumber = seq,

View file

@ -17,7 +17,7 @@ class HistoryMapper {
tempBasalRecord = historyRecord.record as? TempBasalRecord,
bolusRecord = historyRecord.record as? BolusRecord,
resolvedResult = historyRecord.resolvedResult,
resolvedAt = historyRecord.resolvedAt,
resolvedAt = historyRecord.resolvedAt
)
fun entityToDomain(entity: HistoryRecordEntity): HistoryRecord =