-
public interface IThingBleCommRodCtrl
Due to certain scene conditions, mobile phones and devices cannot connect to the Internet, but some parameters need to be set for the device, so the device needs to be operated offline. Here is a safety guarantee. The backdoor is given to the business layer. The business layer establishes a temporary connection with the device by calling the connect method, which allows simple communication with the device. Communication mainly relies on the Schema information of the device, which is issued through publishDps. The capabilities provided by this interface are mainly divided into the following
connect Connect devicepublishDps publish dpdisconnect Disconnect the deviceregisterDevListener Register device listenerregisterSchemaListener register schema listenerisConnected Determine whether the device is connected successfullydestroy} Destroy device由于某些场景条件下,手机和设备都是无法连网,但是又需要给设备设置一些参数,因此需要离线操作设备,这里提供一个安全保障 的后门给到业务层,业务层通过调用connect 方法跟设备建立临时连接,即可以和设备进行简单的通信。 通信主要依赖设备的Schema信息,通过publishDps下发。该接口提供能力主要分为以下几个
connect 连接设备publishDps 下发dpdisconnect 断开设备registerDevListener 注册设备监听器registerSchemaListener 注册schema监听器isConnected 判断设备是否连接成功destroy} 销毁设备
-
-
Method Summary
Modifier and Type Method Description abstract void
connect(IResultCallback callback)
connect device连接设备 abstract void
reConnect(IResultCallback connectCallback)
reConnect devices重连设备 abstract void
disconnect()
disconnect device断开设备 abstract void
registerDevListener(IDevListener listener)
Register device listener注册设备监听器 abstract void
registerSchemaListener(ICommRodSchemaListener listener)
Register schema listener注册schema监听器 abstract void
publishDps(String dps, IResultCallback callback)
publish dps下发dp abstract boolean
isConnected()
Get the connection status of the current device当前状态是否连接 abstract void
destroy()
destroy controller销毁控制器 -
-
Method Detail
-
connect
abstract void connect(IResultCallback callback)
connect device连接设备
- Parameters:
callback
- 连接是否成功回调
-
reConnect
abstract void reConnect(IResultCallback connectCallback)
reConnect devices重连设备
-
disconnect
abstract void disconnect()
disconnect device断开设备
-
registerDevListener
abstract void registerDevListener(IDevListener listener)
Register device listener注册设备监听器
- Parameters:
listener
- listener/监听器
-
registerSchemaListener
abstract void registerSchemaListener(ICommRodSchemaListener listener)
Register schema listener注册schema监听器
- Parameters:
listener
- listener/监听器
-
publishDps
abstract void publishDps(String dps, IResultCallback callback)
publish dps下发dp
- Parameters:
dps
- dpscallback
- 下发回调/publish dps callback
-
isConnected
abstract boolean isConnected()
Get the connection status of the current device当前状态是否连接
-
destroy
abstract void destroy()
destroy controller销毁控制器
-
-
-
-