Class Storage#upgradeFirmware
storage
- Defined in: storage.js
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Storage#upgradeFirmware(successCallback, errorCallback)
Upgrades firmware using stored file which was downloaded by calling Storage.downloadFirmware(). |
Class Detail
Storage#upgradeFirmware(successCallback, errorCallback)
Upgrades firmware using stored file which was downloaded by calling Storage.downloadFirmware(). If upgrade is successful, the monitor will restart automatically.
function upgradeFirmware() {
var successCb = function () {
console.log("firmware upgrade is successful");
};
var failureCb = function(cbObject) {
var errorCode = cbObject.errorCode;
var errorText = cbObject.errorText;
console.log( " Error Code [" + errorCode + "]: " + errorText);
};
var storage = new Storage();
storage.upgradeFirmware(successCb, failureCb);
}
- Parameters:
- {Function} successCallback
- success callback function.
- {Function} errorCallback
- failure callback function.
- Since:
- 1.2
- Returns:
After the method is successfully executed, successCallback is called without any parameter. If an error occurs, errorCallback is called with errorCode and errorText as parameters.
- See:
- Storage.downloadFirmware(), Storage.getFirmwareUpgradeStatus()