mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
improve firmware update
This commit is contained in:
parent
718e284743
commit
b8b2a8a86c
3 changed files with 50 additions and 29 deletions
|
|
@ -1304,13 +1304,14 @@ class MeshService : Service(), Logging {
|
|||
myInfo.myNodeNum // Note: can't use the normal property because myNodeInfo not yet setup
|
||||
val ni = nodeDBbyNodeNum[nodeNum] // can't use toNodeInfo because too early
|
||||
val hwModelStr = ni?.user?.hwModelString
|
||||
setFirmwareUpdateFilename(hwModelStr)
|
||||
val mi = with(myInfo) {
|
||||
MyNodeInfo(
|
||||
myNodeNum,
|
||||
hasGps,
|
||||
hwModelStr,
|
||||
firmwareVersion,
|
||||
firmwareUpdateFilename != null,
|
||||
firmwareUpdateFilename?.appLoad != null && firmwareUpdateFilename?.littlefs != null,
|
||||
isBluetoothInterface && SoftwareUpdateService.shouldUpdate(
|
||||
this@MeshService,
|
||||
DeviceVersion(firmwareVersion)
|
||||
|
|
@ -1323,9 +1324,7 @@ class MeshService : Service(), Logging {
|
|||
airUtilTx
|
||||
)
|
||||
}
|
||||
|
||||
newMyNodeInfo = mi
|
||||
setFirmwareUpdateFilename(mi)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1641,12 +1640,12 @@ class MeshService : Service(), Logging {
|
|||
/***
|
||||
* Return the filename we will install on the device
|
||||
*/
|
||||
private fun setFirmwareUpdateFilename(info: MyNodeInfo) {
|
||||
private fun setFirmwareUpdateFilename(model: String?) {
|
||||
firmwareUpdateFilename = try {
|
||||
if (info.firmwareVersion != null && info.model != null)
|
||||
if (model != null)
|
||||
SoftwareUpdateService.getUpdateFilename(
|
||||
this,
|
||||
info.model
|
||||
model
|
||||
)
|
||||
else
|
||||
null
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue