Appearance
当前串口属性
方法名
getSerialProperty
用法
用法示例
js
module.getSerialProperty({
params:{
},
success: (res) => {
console.log(res)
},
fail: () => {
console.log(res)
},
complete: (res) => {
console.log(res)
}
})js
module.getSerialProperty({
params:{
},
success: (res) => {
console.log(res)
},
fail: () => {
console.log(res)
},
complete: (res) => {
console.log(res)
}
})参数说明
| 参数名 | 参数类型 | 是否必填 | 默认值 | 参数描述 |
|---|---|---|---|---|
| params | Object | 是 | 无 | 接口请求参数 |
| params.index | Integer | 否 | 1 | 串口索引,多串口使用,可选值,1~5 |
| success | Function | 否 | 无 | 执行成功的函数 |
| fail | Function | 否 | 无 | 执行失败的函数 |
| complete | Function | 否 | 无 | 执行完成的函数,不管成功还是失败都会执行 |
回调
- 示例json
{ "message": "查询成功", "code": 0, "data": { "delay": 500, "parity": 0, "baudRate": 9600, "port": "/dev/ttyS1", "stopBits": 1, "flowCon": 0, "dataBits": 8 } } - 回调说明:
参数名 参数类型 参数描述 message String 消息提示 data Object 数据对象 data.delay Integer 延迟 data.parity Integer 校验位 data.baudRate Integer 波特率 data.port String 串口号 data.stopBits Integer 停止位 data.flowCon Integer 流控 data.dataBits Integer 数据位 code Integer 返回类型,0.成功,其他:失败
