public class SafeUpdate extends Object
For more information about the use of this API, you can refer to GINA safe update documentation. GINA equivalent method is referenced in each of the SafeUpdate methods.
Modifier and Type | Field and Description |
---|---|
static int |
GINA_ERROR_UPDATE_FLASH_FAIL
FAIL to FOTA.
|
static int |
GINA_ERROR_UPDATE_FLASH_FULL
FOTA partition is full.
|
static int |
GINA_ERROR_UPDATE_FLASH_NOERROR
Operation passed.
|
static int |
GINA_ERROR_UPDATE_FLASH_SCRUB_ERROR
SCRUB ERROR.
|
static int |
GINA_ERROR_UPDATE_FLASH_SCRUB_PENDING
SCRUB is running, need to wait until scrub is finished.
|
static int |
GINA_ERROR_UPDATE_FLASH_WRONG_PARA
Wrong parameter passed.
|
static int |
GINA_ERROR_UPDATE_RESULT_CRC_ERROR
CRC check failed.
|
static int |
GINA_ERROR_UPDATE_RESULT_FATAL
Fatal internal errot.
|
static int |
GINA_ERROR_UPDATE_RESULT_FW_MISMATCH
Firmware mismatch.
|
static int |
GINA_ERROR_UPDATE_RESULT_NO_DAM
No DAM.
|
static int |
GINA_ERROR_UPDATE_RESULT_NO_FOTA
No firmware.
|
static int |
GINA_ERROR_UPDATE_RESULT_OFFSET
Update result offset.
|
static int |
GINA_ERROR_UPDATE_RESULT_SAME_FW
Failed updating the same version FW.
|
static int |
GINA_NOERROR
Success status.
|
static int |
GINA_STATUS_FOTA
FOTA
|
Constructor and Description |
---|
SafeUpdate() |
Modifier and Type | Method and Description |
---|---|
static int |
appUpdateFlash(byte[] buffer,
int length,
boolean endFlag)
Flash the DAM to the update partition, see gina_app_update_flash() in GINA
Service API.
|
static int |
appUpdateStart(byte[] appName)
Trigger the upgrade process, see gina_app_update_start() in GINA Service API.
|
static int |
getPartitionSize()
Get the current GINA update Partition size, see
gina_update_get_partition_size() in GINA Service API.
|
static void |
updateInit()
Reset the update partition, see gina_update_init() in GINA Service API.
|
static int |
updateInstall()
Trigger the upgrade process, see gina_update_install() in GINA Service API.
|
static int |
updateRelease()
Release the data stored in the partition and return the upgrade result, see
gina_update_release() in GINA Service API.
|
static int |
updateStore(byte[] buffer,
int length,
boolean endFlag)
Flash the Firmware to the update partition, see gina_update_store() in GINA
Service API.
|
public static final int GINA_ERROR_UPDATE_FLASH_FAIL
public static final int GINA_ERROR_UPDATE_FLASH_FULL
public static final int GINA_ERROR_UPDATE_FLASH_NOERROR
public static final int GINA_ERROR_UPDATE_FLASH_SCRUB_ERROR
public static final int GINA_ERROR_UPDATE_FLASH_SCRUB_PENDING
public static final int GINA_ERROR_UPDATE_FLASH_WRONG_PARA
public static final int GINA_ERROR_UPDATE_RESULT_CRC_ERROR
public static final int GINA_ERROR_UPDATE_RESULT_FATAL
public static final int GINA_ERROR_UPDATE_RESULT_FW_MISMATCH
public static final int GINA_ERROR_UPDATE_RESULT_NO_DAM
public static final int GINA_ERROR_UPDATE_RESULT_NO_FOTA
public static final int GINA_ERROR_UPDATE_RESULT_OFFSET
public static final int GINA_ERROR_UPDATE_RESULT_SAME_FW
public static final int GINA_NOERROR
public static final int GINA_STATUS_FOTA
public static int appUpdateFlash(byte[] buffer, int length, boolean endFlag)
buffer
- to be flashed into the file partition.length
- of the flashed buffer.endFlag
- , true
if this buffer is the last one to the flashed,
false otherwise
.GINA_ERROR_UPDATE_FLASH_NOERROR
on success.public static int appUpdateStart(byte[] appName)
appName
- name of the application to upgrade.GINA_NOERROR
on success.public static int getPartitionSize()
public static void updateInit()
public static int updateInstall()
GINA_NOERROR
on success.public static int updateRelease()
GINA_NOERROR
on success.public static int updateStore(byte[] buffer, int length, boolean endFlag)
buffer
- to be flashed into the file partition.length
- of the flashed buffer.endFlag
- , true
if this buffer is the last one to the flashed,
false otherwise
.GINA_ERROR_UPDATE_FLASH_NOERROR
on success.