Configuring Login Parameters

API Function

This API is used to set the parameters required for device connection.

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

Configuration items used for device connection.

  • 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

Value of each configuration item.

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

EN_IOTA_CFG_TYPE:

Enumerated Item

Value

Type

Description

EN_IOTA_CFG_DEVICEID

0

String

Logical device ID assigned by the platform.

EN_IOTA_CFG_DEVICESECRET

1

String

Authentication secret for a device to access the platform.

EN_IOTA_CFG_APPID

2

String

Identifier of an application.

EN_IOTA_CFG_IOCM_ADDR

3

String

Server IP address.

EN_IOTA_CFG_IOCM_PORT

4

unsigned int

Server port.

EN_IOTA_CFG_MQTT_ADDR

5

String

IP address of the MQTT server.

EN_IOTA_CFG_MQTT_PORT

6

unsigned int

Port number of the MQTT server.

Return Value

For details, see Function Return Values.

Example

1
2
3
// 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);