服务地址:http://obos.hopechart.com/api/v1.0
头部信息:发起API调用时需在Http请求头填写如下参数
- Content-Type application/x-www-form-urlencoded; charset=UTF-8
- systemCode 系统编码 - 联系管理员申请
- x-auth-token 授权码 - 联系管理员申请
示例代码如下:
headers.put("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
headers.put("systemCode", "系统编码");
headers.put("x-auth-token", "授权码");
1
2
3
2
3
# 1.固件包上传
# 1.1. 接口功能
通过远程接口调用,实现在OBOS平台上传固件包。
# 1.2. URL
/upgrade/saveFirmware
# 1.3. 请求方式
POST
# 1.4. 请求参数
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
file | File | Y | 文件流 |
firmwareName | String | Y | 固件名称 |
productName | String | Y | 产品型号名称【和OBOS平台的产品型号名保持一致】 |
upgradeModel | Integer | Y | 升级模式【1-ABOS,2-GBOS,3-HTTP,4-FTP】 |
version | String | Y | 固件包版本号 |
remark | String | N | 发布说明 |
# 1.5. 接口返回
参数名称 | 参数类型 | 参数说明 |
---|---|---|
code | Integer | 接口状态码(成功:200;失败:非200) |
data | String | 固件包Id |
message | String | 消息 |
# 1.6. 请求示例
http://obosapi.hopechart.com/api/v1.0/upgrade/saveFirmware
注:参数格式Form-data
file: "UpdateFile_aaa.zip",
firmwareName: "wxc170",
productName: "HQ-R-10002",
upgradeModel: "4",
version: "3.0.0.0.12",
remark: "3.0.0.0.12版本"
1
2
3
4
5
6
2
3
4
5
6
# 2.升级任务下发
# 2.1. 接口功能
通过远程接口调用,实现在OBOS平台下发升级任务。
# 2.2. URL
/upgrade/saveUpgradeTask
# 2.3. 请求方式
POST
# 2.4. 请求参数
通用参数:
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
firmwareId | Integer | Y | 固件包ID |
terminalList | String[] | Y | 待升级的终端【10位终端号集合】 |
upgradeModel | Integer | Y | 升级模式【1-ABOS,2-GBOS,3-HTTP,4-FTP】 |
特有参数如下:
- 当upgradeModel==1时:
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
action | Integer | Y | 终端下载文件后的动作(0-无动作,1-立即复位 ) |
- 当upgradeModel==2时:
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
termPath | String | Y | 带文件名的终端存储路径(长度不超过64个字符) |
- 当upgradeModel==3时:
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
type | Integer | Y | 升级类型(0 - 终端) |
action | Integer | Y | 升级方式(0-开机升级,1-立即升级 2-静默升级) |
isCancel | Integer | Y | 是否取消(1-取消任务, 0-无效) |
- 当upgradeModel==4时:
参数名称 | 参数类型 | 是否必选 | 参数说明 |
---|---|---|---|
type | Integer | Y | 升级类型(0:T-box 等自身升级设备;1:MCU;2:仪表, 3:BMS) |
action | Integer | Y | 升级后的动作(0-无动作,1-立即复位) |
# 2.5. 接口返回
参数名称 | 参数类型 | 参数说明 |
---|---|---|
code | Integer | 接口状态码(成功:200;失败:非200) |
message | String | 消息 |
# 2.6. 请求示例
http://obosapi.hopechart.com/api/v1.0/upgrade/saveUpgradeTask
{
"firmwareId": 114,
"terminalList": ["1111111123"],
"upgradeModel": 1,
"action": "0"
}
1
2
3
4
5
6
2
3
4
5
6