Merge remote-tracking branch 'root/master' into dev

This commit is contained in:
Kevin Hester 2021-02-08 11:30:42 +08:00
commit ffca8e5f47
3 changed files with 42 additions and 40 deletions

View file

@ -629,9 +629,14 @@ class MeshService : Service(), Logging {
if (dataPacket != null) {
if (myInfo.myNodeNum == packet.from)
debug("Ignoring packet sent from our node")
else {
if (myInfo.myNodeNum == packet.from) {
// Handle position updates from the device
if (data.portnumValue == Portnums.PortNum.POSITION_APP_VALUE) {
val rxTime = if (packet.rxTime != 0) packet.rxTime else currentSecond()
handleReceivedPosition(packet.from, MeshProtos.Position.parseFrom(data.payload), rxTime)
} else
debug("Ignoring packet sent from our node, portnum=${data.portnumValue} ${bytes.size} bytes")
} else {
debug("Received data from $fromId, portnum=${data.portnumValue} ${bytes.size} bytes")
dataPacket.status = MessageStatus.RECEIVED