mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
work with old devices that still use 8 bit addresses
This commit is contained in:
parent
6a71e6c414
commit
f16d0d8cf5
1 changed files with 5 additions and 1 deletions
|
|
@ -687,11 +687,15 @@ class MeshService : Service(), Logging {
|
|||
|
||||
/// Generate a new mesh packet builder with our node as the sender, and the specified node num
|
||||
private fun newMeshPacketTo(idNum: Int) = MeshPacket.newBuilder().apply {
|
||||
val useShortAddresses = (myNodeInfo?.nodeNumBits ?: 8) != 32
|
||||
|
||||
if (myNodeInfo == null)
|
||||
throw RadioNotConnectedException()
|
||||
|
||||
from = myNodeNum
|
||||
to = idNum
|
||||
|
||||
// We might need to change broadcast addresses to work with old device loads
|
||||
to = if (useShortAddresses && idNum == NODENUM_BROADCAST) 255 else idNum
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue