文档中心
灵隼物联网云平台
API 参考
灵隼客户端 Android API
◆ connect()
int io.agora.iotlink.IRtmMgr.connect |
( |
final IotDevice |
iotDevice | ) |
|
◆ disconnect()
int io.agora.iotlink.IRtmMgr.disconnect |
( |
| ) |
|
断开设备连接。
断开连接后,你不能通过 RTM 控制该设备。
- 返回
-
◆ getStateMachine()
int io.agora.iotlink.IRtmMgr.getStateMachine |
( |
| ) |
|
获取当前 RtmMgr
的状态。
- 返回
- 当前
RtmMgr
的状态:
RTMMGR_STATE_DISCONNECTED(0x0001)
: 与 RTM 系统未连接。
RTMMGR_STATE_CONNECTING(0x0002)
: 正在连接 RTM 系统。
RTMMGR_STATE_CONNECTED(0x0003)
: 已连接 RTM 系统。
RTMMGR_STATE_RECONNECTING(0x0004)
: 正在重新连接 RTM 系统。可能原因是网络有问题。
RTMMGR_STATE_ABORTED(0x0005)
: 一般性错误。
◆ registerListener()
int io.agora.iotlink.IRtmMgr.registerListener |
( |
IRtmMgr.ICallback |
callback | ) |
|
◆ sendMessage()
int io.agora.iotlink.IRtmMgr.sendMessage |
( |
byte[] |
messageData, |
|
|
final ISendCallback |
sendCallback |
|
) |
| |
向设备发送控制消息。
发送完成后,SDK 会触发 onSendDone 回调。
- 参数
-
messageData | 待发送的 RTM 消息数据。声网推荐发送小于 4 KB 的数据。 |
sendCallback | RTM 消息发送完成回调。详见 ISendCallback。 |
- 返回
-
◆ unregisterListener()
int io.agora.iotlink.IRtmMgr.unregisterListener |
( |
IRtmMgr.ICallback |
callback | ) |
|
◆ RTMMGR_STATE_ABORTED
final int io.agora.iotlink.IRtmMgr.RTMMGR_STATE_ABORTED = 0x0005 |
|
static |
◆ RTMMGR_STATE_CONNECTED
final int io.agora.iotlink.IRtmMgr.RTMMGR_STATE_CONNECTED = 0x0003 |
|
static |
◆ RTMMGR_STATE_CONNECTING
final int io.agora.iotlink.IRtmMgr.RTMMGR_STATE_CONNECTING = 0x0002 |
|
static |
◆ RTMMGR_STATE_DISCONNECTED
final int io.agora.iotlink.IRtmMgr.RTMMGR_STATE_DISCONNECTED = 0x0001 |
|
static |
◆ RTMMGR_STATE_RECONNECTING
final int io.agora.iotlink.IRtmMgr.RTMMGR_STATE_RECONNECTING = 0x0004 |
|
static |
0x0004:正在重新连接 RTM 系统。可能原因是网络有问题。
该接口的文档由以下文件生成: