getMqttConnectState
获取 mqtt 连接状态 回调返回当前连接情况
引入
import { getMqttConnectState } from '@ray-js/ray';
需引入
DeviceKit,且在>=2.5.1版本才可使用
参数
Object object
| 属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| complete | function |
否 | 接口调用结束的回调函数(调用成功、失败都会执行) | |
| success | function |
否 | 接口调用成功的回调函数 | |
| fail | function |
否 | 接口调用失败的回调函数 |
object.success 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| connectState | number |
mqtt 连接状态 0 连接失败 1 连接成功 |
object.fail 回调参数
参数
Object res
| 属性 | 类型 | 说明 |
|---|---|---|
| errorMsg | string |
插件错误信息 |
| errorCode | string |
错误码 |
| innerError | object |
插件外部依赖错误信息 {errorMsg: string, errorCode: string } |
👉 立即

最低0.47元/天 解锁文章
3533

被折叠的 条评论
为什么被折叠?



