Before You Start

Non-China Unicom users can view the IoT Device Access (IoTDA) Developer Guide.

Overview

The IoT platform provides the AgentLite SDK for fast device access. After being integrated with the AgentLite SDK, devices that support the TCP/IP protocol stack can directly communicate with the platform. Devices that do not support the TCP/IP protocol stack, such as Bluetooth and Zigbee devices, can forward device data to the platform through gateways integrated with the AgentLite SDK.

Broadcasting

The local broadcast of the Android system is used to receive messages reported by the AgentLite SDK.

Broadcasts can be registered only in dynamic registration mode.

APIs

The following table describes the main functions provided by the AgentLite SDK.

  • Directly connected devices refer to devices that are directly connected to the platform by using device binding and connection.
  • Indirectly connected devices refer to devices that are connected to the platform through gateways.

Function

API

Description

Connecting directly connected devices

BaseService.init

Initializing AgentLite Resources

BaseService.destroy

Releasing AgentLite Resources

BindConfig.setConfig

Configuring the Binding Relationship

BindService.bind

Binding a Device

HubService.TOPIC_UNBINDDEVICE

Unbinding a Device

LoginConfig.setConfig

Configuring Login Parameters

BaseService.setAlgType

(Optional) Configuring the Login Information Encryption Algorithm

LoginService.login

Connecting a Device

LoginService.logout

Disconnecting a Device

Managing indirectly connected devices on a gateway

HubService.addDevice

Adding a Device

HubService.deviceStatusUpdate

Updating the Device Status

HubService.rmvDevice

Deleting a Device

Reporting device data

DataTransService.reportData

Reporting Device Data

Receiving a command

DataTransService.TOPIC_COMMAND_RECEIVE

Receiving a Command

Releasing data

DataTransService.mqttDataPub

Releasing Data