Obtain whether the firmware on the device is available for upgrade

Last Updated on : 2023-07-06 07:35:01download

Obtain whether the firmware on the device is available for upgrade

API address

GET: /v1.0/iot-03/devices/{device_id}/upgrade-infos

Request parameter

Parameter nameTypeINRequiredDescription
device_idStringuritrueDevice ID

Return parameter

Parameter nameTypeDescription
resultList

Description of result

Parameter nameTypeDescription
upgrade_statusIntegerUpgradeStatus=1; otherwise, 0; if the device is being upgraded, corresponding status=2
current_versionStringThe current version number of the channel firmware of the device
upgrade_versionStringThe version number of the OTA for the channel firmware of the device
upgrade_descStringUpgrade description information
upgrade_typeIntegerUpgrade Method
module_typeIntegerThe firmware corresponds to the channel number, and the channel number must be specified when confirming the upgrade
module_descStringModule type description
last_upgrade_timeLongLast upgrade time
control_typeIntegerIs the device controllable
urlStringThe relevant fields of the file, mainly used for Bluetooth and other devices

Request example

GET: /v1.0/iot-03/devices/002000425ccf7fc7342a/upgrade-infos

Return example

[
    {
        "module_type": 0,
        "current_version": "1.1.5",
        "upgrade_status": 0,
        "last_upgrade_time": 0,
        "module_desc ": "{\"code\":\"FIRMWARE_UPGRADE_TYPE_DESC_0\"}",
        "control_type": 0
    },
    {
        "module_type": 9,
        "current_version": "1.0.0",
        "upgrade_status": 0,
        "last_upgrade_time": 0,
        "module_desc ": "{\"code\":\"FIRMWARE_UPGRADE_TYPE_DESC_9\"}",
        "control_type": 0
    }
]

Error code

For more information, see error code.