URL: http://ota.heclouds.com/ota/south/device/download/{token}/progress
I only want to see examples!!!
Name | Format | Required or not | Description |
---|---|---|---|
Content-Type | string | Yes | Must be application/json. |
Authorization | string | Yes | Security authentication information |
Name | Format | Required or not | Description |
---|---|---|---|
dev_id | long | Yes | Device id |
Name | Format | Required or not | Description |
---|---|---|---|
step | int | Yes | The value taken is [0, 100], download progress ratio |
Name | Format | Description |
---|---|---|
errno | int | Call error code, where 0 means success. |
error | string | Error description, where “succ” means success. |
When the device is downloading the upgrade package (fragmented download), download progress can be reported if necessary (step=[0,100] can only be reported when the device is “downloading”);
If the download progress reported by the device is 100 (i.e. step: 100), the platform will change the upgrade status of the device from “downloading” to “upgrading”;
Only when the device is in the “downloading” state, the device can report download progress using the interface, and an error of “invalid state” will be returned in other states;
If step is above 100, it will be used as reporting states (When the device is in following three states, i.e.: to be upgraded, downloading and upgrading, the upgrade process can be completed by reporting following codes. Following states cannot be reported when it is in other states such as canceled, upgrade failed, upgrade successful, suspended):
Status code | Description |
---|---|
101 | Upgrade package download successful (the device status changes to be “upgrading”). |
102 | Download failed, space not enough (the device status changes to be “upgrade failed”). |
103 | Download failed, memory overflow (the device status changes to be “upgrade failed”). |
104 | Download failed, download request timed out (the device status changes to be “upgrade failed”). |
105 | Download failed, low battery (the device status changes to be “upgrade failed”). |
106 | Download failed, weak signal (the device status changes to be “upgrade failed”). |
107 | Download failed, unknown exception (the device status changes to be “upgrade failed”). |
201 | Upgrade successful, at the time the version number of the device will be changed to be the target version of the task. (The device status changes to be “upgrade completed”). |
202 | Upgrade failed, battery low (the device status changes to be “upgrade failed”) |
203 | Upgrade failed, memory overflow (the device status changes to be “upgrade failed”). |
204 | Upgrade failed, upgrade package is inconsistent with the target version of current task (the device status changes to be “upgrade failed”) |
205 | Upgrade failed, MD5 verification failed (the device status changes to be “upgrade failed”) |
206 | Upgrade failed, unknown exception (the device status changes to be “upgrade failed”) |
207 | Maximum number of times of retry reached (the device status changes to be “upgrade failed”) |
208 | Device upgrade expired (the device status changes to be “upgrade failed”) |
The status code for downloading or upgrading can be reported when in downloading status; when it is upgrading, only upgrading status code can be reported.
POST http:///ota/south/device/download/ota_MP9qVOT0AtsHhUSNYMy7/progress?dev_id=32981907
Content-Type:application/json
Host: api.heclouds.com
{
"step":50 // [1, 100] download progress is 50%.
}
{
"errno": 0,
"error":“succ”
}