Report upgrade status

Request format: POST

URL: http://ota.heclouds.com/ota/south/device/download/{token}/progress

I only want to see examples!!!

http header

NameFormatRequired or notDescription
Content-TypestringYesMust be application/json.
AuthorizationstringYesSecurity authentication information

http request parameter

NameFormatRequired or notDescription
dev_idlongYesDevice id

http request contents

NameFormatRequired or notDescription
stepintYesThe value taken is [0, 100], download progress ratio

Return parameter

NameFormatDescription
errnointCall error code, where 0 means success.
error stringError description, where “succ” means success.

Description

  1. 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”);

  2. 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”;

  3. 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;

  4. 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 codeDescription
101Upgrade package download successful (the device status changes to be “upgrading”).
102Download failed, space not enough (the device status changes to be “upgrade failed”).
103Download failed, memory overflow (the device status changes to be “upgrade failed”).
104Download failed, download request timed out (the device status changes to be “upgrade failed”).
105Download failed, low battery (the device status changes to be “upgrade failed”).
106Download failed, weak signal (the device status changes to be “upgrade failed”).
107Download failed, unknown exception (the device status changes to be “upgrade failed”).
201Upgrade 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”).
202Upgrade failed, battery low (the device status changes to be “upgrade failed”)
203Upgrade failed, memory overflow (the device status changes to be “upgrade failed”).
204Upgrade failed, upgrade package is inconsistent with the target version of current task (the device status changes to be “upgrade failed”)
205Upgrade failed, MD5 verification failed (the device status changes to be “upgrade failed”)
206Upgrade failed, unknown exception (the device status changes to be “upgrade failed”)
207Maximum number of times of retry reached (the device status changes to be “upgrade failed”)
208Device upgrade expired (the device status changes to be “upgrade failed”)

Special notes

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.

Request Example

POST http:///ota/south/device/download/ota_MP9qVOT0AtsHhUSNYMy7/progress?dev_id=32981907
Content-Type:application/json
Host: api.heclouds.com

http request parameter example

{

  "step":50 // [1, 100] download progress is 50%.

}

Return Example

{

    "errno": 0,

    "error":“succ”

}

个搜索结果,搜索内容 “

    0 个搜索结果,搜索内容 “