Skip to content

Commit b29a806

Browse files
authored
Merge pull request #535 from PlayerData/add-upgrade-only
feat: Add upload only mode
2 parents 01acf79 + ac60f88 commit b29a806

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

react-native-mcu-manager/android/src/main/java/uk/co/playerdata/reactnativemcumanager/DeviceUpgrade.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ import java.io.IOException
1818

1919
val UpgradeModes =
2020
mapOf(
21-
1 to FirmwareUpgradeManager.Mode.TEST_AND_CONFIRM,
22-
2 to FirmwareUpgradeManager.Mode.CONFIRM_ONLY,
23-
3 to FirmwareUpgradeManager.Mode.TEST_ONLY
21+
1 to FirmwareUpgradeManager.Mode.TEST_AND_CONFIRM,
22+
2 to FirmwareUpgradeManager.Mode.CONFIRM_ONLY,
23+
3 to FirmwareUpgradeManager.Mode.TEST_ONLY,
24+
4 to FirmwareUpgradeManager.Mode.NONE,
2425
)
2526

2627
enum class UpgradeFileType {

react-native-mcu-manager/ios/DeviceUpgrade.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ enum JSUpgradeMode: Int {
55
case TEST_AND_CONFIRM = 1
66
case CONFIRM_ONLY = 2
77
case TEST_ONLY = 3
8+
case UPLOAD_ONLY = 4
89
}
910

1011
enum UpgradeFileType: Int {
@@ -158,6 +159,8 @@ class DeviceUpgrade {
158159
return FirmwareUpgradeMode.testOnly
159160
case .CONFIRM_ONLY:
160161
return FirmwareUpgradeMode.confirmOnly
162+
case .UPLOAD_ONLY:
163+
return FirmwareUpgradeMode.uploadOnly
161164
}
162165
}
163166
}

react-native-mcu-manager/src/Upgrade.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ export enum UpgradeFileType {
1313
}
1414

1515
export enum UpgradeMode {
16-
/**
17-
* When this flag is set, the manager will immediately send the reset command after
18-
* the upload is complete. The device will reboot and will run the new image on its next
19-
* boot.
20-
*/
21-
NONE = 0,
22-
2316
/**
2417
* This mode is the default and recommended mode for performing upgrades due to it's ability to
2518
* recover from a bad firmware upgrade. The process for this mode is upload, test, reset, confirm.
@@ -37,6 +30,13 @@ export enum UpgradeMode {
3730
* manually as the primary boot image. The process for this mode is upload, test, reset.
3831
*/
3932
TEST_ONLY = 3,
33+
34+
/**
35+
* When this flag is set, the manager will immediately send the reset command after
36+
* the upload is complete. The device will reboot and will run the new image on its next
37+
* boot.
38+
*/
39+
UPLOAD_ONLY = 4,
4040
}
4141

4242
export interface UpgradeOptions {

0 commit comments

Comments
 (0)