convert method
Implementation
FirmwareUpgradeState convert() {
switch (this) {
case (ProtoUpdateStateChanges_FirmwareUpgradeState.NONE):
return FirmwareUpgradeState.none;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.VALIDATE):
return FirmwareUpgradeState.validate;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.UPLOAD):
return FirmwareUpgradeState.upload;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.TEST):
return FirmwareUpgradeState.test;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.RESET):
return FirmwareUpgradeState.reset;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.CONFIRM):
return FirmwareUpgradeState.confirm;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.SUCCESS):
return FirmwareUpgradeState.success;
case (ProtoUpdateStateChanges_FirmwareUpgradeState
.REQUEST_MCU_MGR_PARAMETERS):
return FirmwareUpgradeState.requestMcuMgrParameters;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.ERASE_APP_SETTINGS):
return FirmwareUpgradeState.eraseAppSettings;
case (ProtoUpdateStateChanges_FirmwareUpgradeState.BOOTLOADER_INFO):
return FirmwareUpgradeState.bootloaderInfo;
default:
throw "Unsupported state";
}
}