mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(firmware): Implement USB DFU updates for supported devices (#3901)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
f322eb31a0
commit
499ed58311
13 changed files with 860 additions and 483 deletions
|
|
@ -1459,6 +1459,7 @@ class MeshService : Service() {
|
|||
private fun onConnectionChanged(c: ConnectionState) {
|
||||
if (connectionStateHolder.connectionState.value == c && c !is ConnectionState.Connected) return
|
||||
Timber.d("onConnectionChanged: ${connectionStateHolder.connectionState.value} -> $c")
|
||||
serviceRepository.setConnectionTransport(currentTransport())
|
||||
|
||||
// Cancel any existing timeouts
|
||||
sleepTimeout?.cancel()
|
||||
|
|
@ -2604,6 +2605,10 @@ class MeshService : Service() {
|
|||
)
|
||||
}
|
||||
|
||||
override fun rebootToDfu() {
|
||||
packetHandler.sendToRadio(newMeshPacketTo(myNodeNum).buildAdminPacket { enterDfuModeRequest = true })
|
||||
}
|
||||
|
||||
override fun requestFactoryReset(requestId: Int, destNum: Int) = toRemoteExceptions {
|
||||
packetHandler.sendToRadio(
|
||||
newMeshPacketTo(destNum).buildAdminPacket(id = requestId) { factoryResetDevice = 1 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue