The data compression feature of IoT Platform allows you to transmit compressed data between IoT Platform and devices. You can compress the messages that you want to transmit to reduce device traffic and accelerate transmission speed. This topic describes how to use the data compression feature.
Prerequisites
Device verification information is obtained. For more information, see Obtain device verification information.
Link SDK for C is obtained. For more information, see Obtain Link SDK for C.
When you customize an SDK on the SDK customization page, set the Advanced Capabilities parameter to Data Compression.
A development environment is prepared. For more information, see Prepare an environment.
Limits
The data compression feature is available only for Exclusive Enterprise Edition instances and Standard Enterprise Edition instances. For more information, see Purchase Enterprise Edition instances.
Background information
Some IoT devices use cellular networks. This causes high traffic costs. You can use the data compression feature to compress data that you want to transmit. This helps reduce traffic.
How the feature works
A program submits information about the topics whose data needs to be compressed or decompressed to IoT Platform over Message Queuing Telemetry Transport (MQTT) by calling the required API operations of Link SDK for C. After IoT Platform returns a response to the application, the system compresses the messages of the topics, and then transmits the compressed messages. If you use Link SDK for C to connect a device, the SDK performs data compression and data decompression. The related device-side program sends or receives uncompressed data.
The following figure shows the process. In this example, the ./demos/compress_basic_demo.c
program is used.
Examples
For more information about how to use the data compression feature, see Examples.
For more information about the error codes that can be returned when you use the data compression feature, see aiot_compress_api.h.