Appearance
获取所有设备列表
方法名
getAllDevices
用法
用法示例
js
module.getAllDevices({
success: (res) => {
console.log(res)
},
fail: () => {
console.log(res)
},
complete: (res) => {
console.log(res)
}
})js
module.getAllDevices({
success: (res) => {
console.log(res)
},
fail: () => {
console.log(res)
},
complete: (res) => {
console.log(res)
}
})参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 参数描述 |
|---|---|---|---|---|
| params | Object | 是 | 无 | 接口请求参数 |
| success | Function | 否 | 无 | 执行成功的函数 |
| fail | Function | 否 | 无 | 执行失败的函数 |
| complete | Function | 否 | 无 | 执行完成的函数,不管成功还是失败都会执行 |
回调
- 示例json
{ "message": "", "code": 0, "data": { "devices": [ "ttyGS3 (g_serial)", "ttyGS2 (g_serial)", "ttyGS1 (g_serial)", "ttyGS0 (g_serial)", "ttysWK3 (ttySWK)", "ttysWK2 (ttySWK)", "ttysWK1 (ttySWK)", "ttysWK0 (ttySWK)", "ttyS3 (rk_serial)", "ttyS0 (rk_serial)", "ttyS4 (rk_serial)", "ttyS1 (rk_serial)", "ttyFIQ0 (fiq-debugger)" ] } } - 回调说明:
参数名 参数类型 参数描述 message String 消息提示 data Object 数据对象 data.devices String[] 设备列表 code Integer 返回类型,0.成功,其他:失败
