Updated on 2022-02-24 GMT+08:00

Configuring Service Parameters

API Function

This API is used to set the parameters required for login.

API Description

1
2
HW_INT IOTA_ConfigSetStr(HW_INT iItem, HW_CHAR *pValue) 
HW_INT IOTA_ConfigSetUint(HW_INT iItem, HW_UINT uiValue)

Parameter Description

Parameter

Mandatory or Optional

Type

Description

key

Mandatory

int

Specifies the configuration item for logging in to the device.

  • Device ID: EN_IOTA_CFG_DEVICEID.
  • App ID: EN_IOTA_CFG_APPID.
  • Secret: EN_IOTA_CFG_DEVICESECRET.
  • HTTP address: LEN_IOTA_CFG_IOCM_ADDR.
  • HTTP port: EN_IOTA_CFG_IOCM_PORT.
  • MQTT address: EN_IOTA_CFG_MQTT_ADDR.
  • MQTT port: EN_IOTA_CFG_MQTT_PORT.

value

Mandatory

String

Specifies the value of the configuration item.

  • Device ID: obtain the value from the callback that is bound.
  • App ID: obtain the value from the callback that is bound.
  • Secret: obtain the value from the callback that is bound.
  • HTTP address: southbound access address for the AgentLite to connect to the IoT platform.
  • HTTP port: 8943.
  • MQTT address: southbound access address for the AgentLite to connect to the IoT platform.
  • MQTT port: 8883.

Return Value

For details, see 4.2 Function Return Values.

Example

1
2
3
//Developers call this API to configure parameters.
IOTA_ConfigSetStr (EN_IOTA_CONFIG_IOCM_ADDR, "10.0.0.1");
IOTA_ConfigSetUint(EN_IOTA_CFG_IOCM_PORT, 8943);