Skip to content

kojish/iothub_client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

iothub_c_client

This is a sample client application for Azure IoT Hub. The application uses the lower level APIs with an _ll_ infix that is contained in the C SDK. This is just for learning purpose or possibly to support a resource constrained device for my project in the future. The appilcation will support the following:

  • D2C and C2D message
  • Device Twin (Getting desired / Updating reported props)
  • Direct Methods
  • Upload file to Azure storage
  • Authentication: SAS key, X509
  • Device Provisioning Service
  • Leaf device of IoT Edge; Supporting downstream device

Build Prerequisites

You will need to build Azure IoT Hub C SDK in your development environment before compiling the application. See Set up a Linux development environment and Build the C SDK on Linux.

Dependency

  • Ubuntu 18.04. I would recommend to build with LTS version.

How to build

  1. Go to azure-iot-sdk-c/iothub_client/samples, and run the following:
    >git clone https://github.com/kojish/iothub_c_client
    After downloading the source code, the directory should look like the following:
    azure-iot-sdk-c/iothub_client/samples/iothub_c_client
  2. Open main.c and set the connection string generated by your IoT Hub.
  3. Open azure-iot-sdk-c/iothub_client/samples/CMakeLists.txt. Add "add_sample_directory(iothub_c_client)" to CMakeLists.txt to be compiled.
  4. Go to azure-iot-sdk-c/cmake directory, and run "cmake --build ." to build the application. You will find the executable file under azure-iot-sdk-c/cmake/iothub_client/samples/iothub_c_client directory. The file name is iothub_c_client.
  5. You can also run the "cmake --build ." command under azure-iot-sdk-c/cmake/iothub_client/sample/iothub_c_client diredtory after the initial build.

About

This is a client application for Azure IoT Hub.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published