fixes after testing on real hardware

pull/28/head
geeksville 2020-04-09 12:22:41 -07:00
rodzic de713bafda
commit 468e43afc4
3 zmienionych plików z 17 dodań i 12 usunięć

Wyświetl plik

@ -387,17 +387,22 @@ class MainActivity : AppCompatActivity(), Logging,
// everytime the radio reconnects, we slam in our current owner data, the radio is smart enough to only broadcast if needed
model.setOwner(this)
val m = model.meshService!!
// Pull down our real node ID
model.nodeDB.myId.value = m.myId
model.meshService?.let { service ->
debug("Getting latest radioconfig from service")
model.radioConfig.value =
MeshProtos.RadioConfig.parseFrom(model.meshService!!.radioConfig)
// Pull down our real node ID
model.nodeDB.myId.value = service.myId
// Update our nodeinfos based on data from the device
val nodes = m.nodes.map {
it.user?.id!! to it
}.toMap()
// Update our nodeinfos based on data from the device
val nodes = service.nodes.map {
it.user?.id!! to it
}.toMap()
model.nodeDB.nodes.value = nodes
model.nodeDB.nodes.value = nodes
}
}
}
@ -478,9 +483,6 @@ class MainActivity : AppCompatActivity(), Logging,
override fun onConnected(service: com.geeksville.mesh.IMeshService) = exceptionReporter {
model.meshService = service
debug("Getting latest radioconfig from service")
model.radioConfig.value = MeshProtos.RadioConfig.parseFrom(service.radioConfig)
// We don't start listening for packets until after we are connected to the service
registerMeshReceiver()

Wyświetl plik

@ -92,7 +92,7 @@ class MapFragment : ScreenFragment("Map"), Logging {
val bounds = LatLngBounds.Builder()
// Add all positions
bounds.includes(nodes.map { it.position!! }
bounds.includes(nodesWithPosition.map { it.position!! }
.map { LatLng(it.latitude, it.longitude) })
CameraUpdateFactory.newLatLngBounds(bounds.build(), 150)

Wyświetl plik

@ -193,6 +193,9 @@ class BTScanModel(app: Application) : AndroidViewModel(app), Logging {
context,
it.macAddress
)
// Force the GUI to redraw
devices.value = devices.value
}
}
}