设备管理 IOTDM(联通用户专用)-登录参数配置:示例

时间:2024-07-03 16:54:08

示例

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
//设置登录配置(deviceId,secret,appid是bind返回的参数)
private void configLoginPara() {
    LoginConfig.setConfig(LoginConfig. LOG IN_CONFIG_DEVICEID, GatewayInfo.getDeviceID());
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_APPID, GatewayInfo.getAppID());
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_SECRET, GatewayInfo.getSecret());
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_IOCM_ADDR, GatewayInfo.getHaAddress());
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_IOCM_PORT, "8943");
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_MQTT_ADDR, GatewayInfo.getHaAddress());
    LoginConfig.setConfig(LoginConfig.LOGIN_CONFIG_MQTT_PORT, "8883");
}
support.huaweicloud.com/sdkreference-iot/iot_06_1210.html