This package outlines in detail how to install and run an IoTConnect generic C SDK.
Date | Name | Download |
---|---|---|
02 January 2023 |
|
Download |
Introduction
IoTConnect generic C SDK package is flexible to integrate with Azure IoT C SDK or Paho MQTT C Client.
It works for both – Azure as well as AWS brokers. Azure IoT C SDK lib does not work for AWS configuration.
At the same time, the Paho MQTT implementation does not support TPM authentication.
CMake Build Options
Note: Our SDK is configured with Azure IoT C SDK by default. You can toggle with CMake flags:
- IOTC_USE_PAHO=ON – Builds with Paho MQTT Client instead of Azure IoT C SDK by default.
- IOTC_TPM_SUPPORT=ON – Adds TPM Support for Azure IoT C SDK. Requires IOTC_USE_PAHO=OFF.
Getting started
Prerequisites
The IoTConnect generic C SDK depends on curl OpenSSL libraries and UUID library. (UUID required for
Azure C SDK flavor only).
To build the source, ensure that the shared libraries and the C source headers are on the build host.
This SDK depends on Curl and OpenSSL libraries while running on the device. To run this SDK,
use the following git submodules:
- cJSON v1.7.13
- iotc-c-lib v2.0.2
- azure-iot-sdk lts_01_2021
- paho.mqtt.c v1.3.9
Installation
This project has git submodules that need to be pulled before building. You can either:
- Download “iotc-generic-c-sdk-2.1.zip” and extract.
- Edit samples/basic-sample/config/app_config.h to reflect your account and device’s configuration.
- If using CA Certificate-based authentication, follow the instructions in the iotc-c-lib/tools/ecc-certs.
Place the device certificate and private key into certs/client-crt.pem and certs/client-key.pem in the basic-sample project.
Note: Build or re-build the IoTConnect generic C SDK after editing the app_config.h file.
- Follow the instructions for your OS: