AWS IoT Device Shadow  v1.0.1
AWS IoT Device Shadow client library

AWS IoT Device Shadow library

A device's shadow is a JSON document that is used to store and retrieve current state information for a device. The Device Shadow service maintains a shadow for each device you connect to AWS IoT. You can use the shadow to get and set the state of a device over MQTT or HTTP, regardless of whether the device is connected to the Internet. Each device's shadow is uniquely identified by the name of the corresponding thing.

Description of Device Shadow from AWS IoT documentation

Device Shadow is the always-available device state in the AWS cloud. A device's shadow is stored as a JSON document, and available via AWS even if the associated device goes offline. Common use cases for Device Shadow include backing up device state, or sending commands to devices.

Embedded devices often use MQTT to interact with Device Shadow. This library provides a convenience API for handling MQTT topics reserved for Device Shadow. This library is independent of the MQTT library. Applications can use the macros and functions of this library to assemble and parse the Device Shadow MQTT topics, then use any MQTT library to publish/subscribe to those topics. Features of this library include:

  • It is stateless. It does not use any global/static memory.
  • It depends on standard C library (string.h and stdint.h) only.

Memory Requirements

Memory requirements of the Shadow library.

Code Size of Device Shadow Library (sizes generated with GCC for ARM Cortex-M toolchain)
File No Optimization (asserts enabled) With -O1 Optimization (asserts disabled) With -Os Optimization (asserts disabled)
shadow.c 2.3K 1.8K 0.9K