How tuya/tuya-iot-core-sdk works
Tuya IoT Core SDK is an embedded C client for connecting devices to Tuya IoT Core. The documented workflow configures device credentials, connects and services an MQTT client, then exchanges TuyaLink messages; capabilities also include activation, sub-device management, and OTA. The graph combines those documented capabilities with sampled implementation evidence. Some domain components are represented at their exact enclosing directory because their implementation was not sampled; their internal links are omitted where source evidence is unavailable.
Main entry points: tuyalink_core.c TuyaLink messaging · http_client_wrapper.c HTTP adapter · mqtt_client_wrapper.c MQTT adapter · interface Platform interfaces
Components 19
Device workflow
- Device activation
src/tuya_endpoint.c - TuyaLink messaging
src/tuyalink_core.c - Thing data model
include/tuyalink_core.h - Sub-device operations
src/tuyalink_core.c - OTA updates
src - Device endpoint config
include/tuya_endpoint.h
Protocol clients
- MQTT adapter
middleware/mqtt_client_wrapper.c - MQTT engine
libraries/coreMQTT/source/core_mqtt.c - HTTP adapter
middleware/http_client_wrapper.c - HTTP engine
libraries/coreHTTP/source/core_http_client.c - JSON parser
libraries/coreJSON/source/core_json.c
Platform adapters
- POSIX TLS network
platform/posix/mbedtls_sockets_wrapper.c - POSIX network adapter
platform/posix/network_wrapper.c - Local storage
platform/posix/storage_wrapper.c - Platform interfaces
interface
Security and utilities
- Mbed TLS
libraries/mbedtls/library/ssl_tls.c - Cipher wrapper
src/cipher_wrapper.c
Other components
- Device developer
- Tuya IoT Core
Connections 18
- Device developer → Device endpoint config: provides credentials
README.md - Device developer → TuyaLink messaging: initializes client
README.md - TuyaLink messaging → MQTT adapter: uses MQTT API
src/tuyalink_core.c - MQTT adapter → MQTT engine: initializes client
middleware/mqtt_client_wrapper.c - TuyaLink messaging → JSON parser: parses messages
src/tuyalink_core.c - Thing data model → TuyaLink messaging: defines messages
src/tuyalink_core.c - Sub-device operations → TuyaLink messaging: sends operations
src/tuyalink_core.c - TuyaLink messaging → Tuya IoT Core: exchanges messages
README.md - TuyaLink messaging → Thing data model: reports properties
README.md - Device activation → Local storage: uses local storage
src/tuya_endpoint.c - HTTP adapter → HTTP engine: sends requests
middleware/http_client_wrapper.c - HTTP adapter → POSIX TLS network: connects TLS
middleware/http_client_wrapper.c - MQTT adapter → Platform interfaces: uses system API
middleware/mqtt_client_wrapper.c - HTTP adapter → Platform interfaces: uses system API
middleware/http_client_wrapper.c - POSIX network adapter → Platform interfaces: implements network API
- POSIX TLS network → Mbed TLS: uses TLS
platform/posix/mbedtls_sockets_wrapper.c - Cipher wrapper → Mbed TLS: uses cryptography
- OTA updates → Tuya IoT Core: supports OTA
README.md