200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > NB-IOT电信云北向开发 电信天翼物联网平台对接应用服务

NB-IOT电信云北向开发 电信天翼物联网平台对接应用服务

时间:2019-08-19 19:09:16

相关推荐

NB-IOT电信云北向开发 电信天翼物联网平台对接应用服务

创建账号

中国电信天翼物联网CTWing门户网站

注册好之后在个人中心进行认证,否则无法进行设备相关的操作

进入控制台

认证通过后的账号,左侧菜单比较丰富,因此可以对产品设备操作了

输入验证码 点击开通

之后就可以创建产品,添加设备了

先看效果

控制台添加成功

再在物联网ctw平台 也可以看到记录

下面开始直接附上主要代码

public static void main(String[] args) {String appKey ="***";String appSecret = "****";String masterKey = "****";String productId = "****";CreateDevice createDevice = new CreateDevice();createDevice.setDeviceName("设备1");createDevice.setImei("****");createDevice.setDeviceSn("***");createDevice.setOperator("admin");CreateDeviceOther createDeviceOther = new CreateDeviceOther();createDeviceOther.setImsi("****");createDeviceOther.setPskValue("****");createDeviceOther.setAutoObserver(0);createDevice.setProductId(Integer.valueOf(productId));createDevice.setOther(createDeviceOther);AepDeviceManagementClient client = AepDeviceManagementClient.newClient().appKey(appKey).appSecret(appSecret).build();CreateDeviceRequest request = new CreateDeviceRequest();request.setParamMasterKey(masterKey);request.setBody(JSONObject.toJSONBytes(createDevice));CreateDeviceResponse response = null;try {response = client.CreateDevice(request);System.out.println("response = " + response);} catch (Exception e) {e.printStackTrace();} finally {client.shutdown();}}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。