update protos

This commit is contained in:
geeksville 2020-04-19 09:23:57 -07:00
parent 5036cb906b
commit f13c05862d
2 changed files with 7 additions and 10 deletions

View file

@ -647,17 +647,14 @@ class MeshService : Service(), Logging {
it.position = it.position?.copy(time = currentSecond())
}
when (p.variantCase.number) {
MeshProtos.SubPacket.POSITION_FIELD_NUMBER ->
handleReceivedPosition(fromNum, p.position)
if (p.hasPosition())
handleReceivedPosition(fromNum, p.position)
MeshProtos.SubPacket.DATA_FIELD_NUMBER ->
handleReceivedData(fromNum, p.data)
if (p.hasData())
handleReceivedData(fromNum, p.data)
MeshProtos.SubPacket.USER_FIELD_NUMBER ->
handleReceivedUser(fromNum, p.user)
else -> TODO("Unexpected SubPacket variant")
}
if (p.hasUser())
handleReceivedUser(fromNum, p.user)
}
private fun currentSecond() = (System.currentTimeMillis() / 1000).toInt()