固件升级

2025-01-16
暂无评分

Event

固件升级进度

Topic: thing/product/{gateway_sn}/events

Direction: up

Method: ota_progress

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
output输出struct
»status任务状态enum_string{"canceled":"取消或终止","failed":"失败","in_progress":"执行中","ok":"执行成功","paused":"暂停","rejected":"拒绝","sent":"已下发","timeout":"超时"}
»progress进度struct
»»percent进度百分比int{"max":"100","min":"0","step":"1","unit_name":"百分比 / %"}
»»current_step当前步骤enum_string{"download_firmware":"下载固件","upgrade_firmware":"更新固件"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"progress": {
				"percent": 10,
				"current_step": "download_firmware"
			},
			"status": "in_progress"
		},
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "ota_progress"
}

Service

固件升级

Topic: thing/product/{gateway_sn}/services

Direction: down

Method: ota_create

Data:

ColumnNameTypeconstraintDescription
devices固件升级设备集合array{"size": 2, "item_type": struct}
»sn设备序列号(SN)text{"length":"10240"}
»product_version固件版本text{"length":"10240"}
»file_url固件文件下载地址text{"length":"10240"}
»md5固件文件 MD5text{"length":"10240"}
»file_size固件文件大小int
»file_name固件文件名称text
»firmware_upgrade_type固件升级类型enum_int{"2":"一致性升级","3":"普通升级"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"devices": [
			{
				"file_name": "wm245_1.00.223.zip",
				"file_size": 653467234,
				"file_url": "https://s3.com/xxx.zip",
				"firmware_upgrade_type": 2,
				"md5": "abcdefabcdefabcdef",
				"product_version": "1.00.223",
				"sn": "drone_sn"
			},
			{
				"firmware_upgrade_type": 3,
				"product_version": "1.00.223",
				"sn": "dock_sn"
			}
		]
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "ota_create"
}

Topic: thing/product/{gateway_sn}/services_reply

Direction: up

Method: ota_create

Data:

ColumnNameTypeconstraintDescription
result返回码int非 0 代表错误
output输出struct
»status任务状态enum_string{"canceled":"取消或终止","failed":"失败","in_progress":"执行中","ok":"执行成功","paused":"暂停","rejected":"拒绝","sent":"已下发","timeout":"超时"}

Example:

{
	"bid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"data": {
		"output": {
			"status": "in_progress"
		},
		"result": 0
	},
	"tid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx",
	"timestamp": 1654070968655,
	"method": "ota_create"
}
若您对文档有意见或疑惑,点击可快速反馈,我们会与您联系。