public class DeviceManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
destroy()
反初始化
|
java.lang.String |
generateBindToken(java.lang.String ds)
生成合法有效的token
|
IDeviceCOTA |
getDeviceCOTA()
获取 CoTA 请求实例
|
IDeviceLabel |
getDeviceLabel()
获取标签请求实例
|
IDeviceShadow |
getDeviceShadow()
获取设备影子请求实例
|
IThing |
getDeviceThing()
获取物模型实例
|
IGateway |
getGateway()
获取网关操作实例
|
static DeviceManager |
getInstance() |
IApiClient |
getIoTApiClient()
获取与云端 HTTP/S 请求实例
|
IOta |
getOta()
获取OTA实例
|
java.lang.String |
getSdkVersion()
获取当前 sdk 版本
|
void |
init(Context context,
DMConfigParams params,
IDMCallback<InitResult> listener)
DM 层初始化,包含 Mqtt 初始化、物模型建立、ApiClient 初始化
|
void |
postLog(LogManager.RecLog recLog,
IConnectSendListener iConnectSendListener) |
void |
registerOnPushListener(IConnectNotifyListener listener)
register mqtt downstream message listener
|
void |
resetDevice(IConnectSendListener callback)
重置设备
1.调用云端接口重置设备状态、绑定关系等;
2.如果成功,则调用deinit接口销毁 linkkit;
3.如果失败则在本地记录一个标记位,然后销毁 linkkit,下次应用重新初始化成功之后再调用云端重置设备状态接口;
4.设备重置期间token不允许发出来;
|
void |
setLevel(int level) |
void |
unRegisterOnPushListener(IConnectNotifyListener listener)
register mqtt downstream message listener
|
public static DeviceManager getInstance()
public void init(Context context, DMConfigParams params, IDMCallback<InitResult> listener)
context
- 上下文params
- DM初始化参数listener
- 监听器public void registerOnPushListener(IConnectNotifyListener listener)
listener
- listenerpublic void unRegisterOnPushListener(IConnectNotifyListener listener)
listener
- listenerpublic java.lang.String getSdkVersion()
public IOta getOta()
public IDeviceLabel getDeviceLabel()
public IDeviceShadow getDeviceShadow()
public IGateway getGateway()
public IDeviceCOTA getDeviceCOTA()
public IThing getDeviceThing()
public IApiClient getIoTApiClient()
public java.lang.String generateBindToken(java.lang.String ds)
ds
- 设备唯一dspublic void resetDevice(IConnectSendListener callback)
public void destroy()
public void postLog(LogManager.RecLog recLog, IConnectSendListener iConnectSendListener)
public void setLevel(int level)