Setting Service Parameters
API Function
This API is used to set the parameters required for device login.
API Description
1 |
public static boolean setConfig(int key, String value);
|
Class
LoginConfig
Parameter Description
Parameter |
Mandatory or Optional |
Type |
Description |
---|---|---|---|
key |
Mandatory |
int |
Specifies the configuration items for device login.
|
value |
Mandatory |
String |
Specifies the values of the configuration items.
|
Return Value
Return Value |
Description |
---|---|
true |
Success |
false |
Failure |
Example
1 2 3 4 5 6 7 8 9 10 |
//Configure device login. (deviceID, secret, appID are the parameters returned after the device is bound successfully.)
private void configLoginPara() {
LoginConfig.setConfig(LoginConfig.LOGIN_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");
}
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot