通过WiFi配网
通过扫鸦智能APP扫描生成的二维码添加设备。
1. 获取 INetConfigManager
IPCServiceManager.getInstance()
.getService(IPCServiceManager.IPCService.NET_CONFIG_SERVICE);
2. 设置配网回调初始化SDK
仅配网接入:
iNetConfigManager.configNetInfo(new INetConfigManager.NetConfigCallback() {
@Override
public void configOver(boolean first, String token) {
IMediaTransManager transManager = IPCServiceManager.getInstance().getService(IPCServiceManager.IPCService.MEDIA_TRANS_SERVICE);
transManager.initIoTSDK(token, productId, uuid, authorKey);
}
});
接入IPC:
iNetConfigManager.configNetInfo(new INetConfigManager.NetConfigCallback() {
@Override
public void configOver(boolean first, String token) {
IMediaTransManager transManager = IPCServiceManager.getInstance().getService(IPCServiceManager.IPCService.MEDIA_TRANS_SERVICE);
transManager.initTransSDK(token, "/sdcard/", "/sdcard/", "", "", "");
}
});
Last updated