How googlecloudplatform/iot-device-sdk-embedded-c works
This is an embedded C device SDK for connecting low-end IoT devices to Google Cloud IoT Core. An application initializes the SDK, configures credentials and connection data, then uses its MQTT API to connect and exchange publish/subscribe traffic over a non-blocking network connection; TLS and platform services make the transport portable. The graph preserves documented control-topic, filesystem, JWT, event-processing, and BSP capabilities. Most implementation files are unsampled, so edges beyond the excerpted references and README descriptions are omitted or marked unverified.
Main entry points: iotc_mqtt_logic_layer.c MQTT logic · iotc.h SDK API · iotc_io_net_layer.c Network layer · iotc_tls_layer.c TLS layer
Components 20
Application API
- SDK API
include/iotc.h - Connection data
src/libiotc/iotc_connection_data.c
Connection and MQTT
- Control topics
src/libiotc/control_topic/iotc_control_topic_layer.c - MQTT logic
src/libiotc/mqtt/logic/iotc_mqtt_logic_layer.c - MQTT codec
src/libiotc/mqtt/codec/iotc_mqtt_codec_layer.c - Network layer
src/libiotc/io/net/iotc_io_net_layer.c
Async Runtime
- Event dispatcher
src/libiotc/event_dispatcher/iotc_event_dispatcher.c - Event loop
src/libiotc/event_loop/iotc_event_loop.c - Resource manager
src/libiotc/io/fs/iotc_resource_manager.c
Platform Services
- Filesystem API
src/libiotc/io/fs/iotc_fs_api.h - Network BSP
include/bsp/iotc_bsp_io_net.h - TLS BSP
include/bsp/iotc_bsp_tls.h - Crypto BSP
include/bsp/iotc_bsp_crypto.h - Platform BSP
include/bsp/iotc_bsp_mem.h
Security
- JWT credentials
src/libiotc/iotc_jwt.c - TLS layer
src/libiotc/tls/iotc_tls_layer.c - TLS implementations
src/bsp/tls/mbedtls/iotc_bsp_tls_mbedtls.c - Crypto implementations
src/bsp/crypto/mbedtls/iotc_bsp_crypto_mbedtls.c
Other components
- Device application
- Cloud IoT Core
Connections 21
- Device application → SDK API: calls
include/iotc.h - SDK API → Connection data: configures
- SDK API → MQTT logic: starts MQTT
- SDK API → Event loop: processes events
include/iotc.h - MQTT logic → MQTT codec: encodes MQTT
- MQTT codec → Network layer: transfers packets
- Network layer → TLS layer: secures transport
- TLS layer → Cloud IoT Core: connects securely
README.md - MQTT logic → Cloud IoT Core: publishes and subscribes
README.md - MQTT logic → Control topics: handles control topics
- MQTT logic → Event dispatcher: schedules keepalive
- Event loop → Event dispatcher: runs events
- Resource manager → Event dispatcher: registers file events
src/libiotc/io/fs/iotc_resource_manager.c - Resource manager → Filesystem API: calls filesystem
src/libiotc/io/fs/iotc_resource_manager.c - Filesystem API → Platform BSP: uses platform files
- Network layer → Network BSP: uses socket BSP
README.md - TLS layer → TLS BSP: uses TLS BSP
README.md - TLS BSP → TLS implementations: implemented by
README.md - JWT credentials → Crypto BSP: signs credentials
- Crypto BSP → Crypto implementations: implemented by
README.md - Connection data → JWT credentials: supplies credentials