update
There are two ways to perform the firmware update:
- Manual update: upload the specified firmware file using upload-update-file before update.
- Online update: use online-update-check to detect if there is a new version available.
In order to perform the firmware update:
- USB format can not be in progress.
- Firmware detect can not be in progress.
You can obtain current device running status mask using get-status.
"cur-status": 65552 // device running status mask
The output of cur-status
& Device Status Mask is as follows:
Device status | Condition |
---|---|
USB format is not in progress | cur-status & statusFormatDisk != statusFormatDisk |
Firmware update is not in progress | cur-status & statusCheckUpgrade != statusCheckUpgrade |
HTTP Request
GET http://ip/usapi?method=update&mode=xxx
Parameter | Description |
---|---|
method | update |
mode | Firmware update type. upload indicates manual update. online indicates online update. |
Response Body
{
"result": 0
}
Item | Description |
---|---|
result | Returned status. 0 indicates the streamer begins to update. Refer to API Status Codes to find specific description for other values. |
Update Status
Obtain upgrade-status using get-status.
"upgrade-status": {
"result": 27,
"step": 0,
"percent": 0,
"mode": "none",
"client-id": ""
}
Item | Description |
---|---|
result | Indicates returned operation status. 27 indicates initial status. 2 indicates updating status. 0 indicates that the request was accepted successfully. Refer to API Status Codes to find specific description for other values. |
step | Indicates update steps. |
percent | Indicates the percentage of the update step. |
mode | Indicates firmware update type. none: initial status. upload: manual update online: online update |
client-id | Reserved. |
Call clear-upgrade to reset the status to 27 (Initial status) after update failed.