C Applications

The agent provides C APIs to enable you to create client applications.

Linux

The agent supports C APIs on Ubuntu 16.04. You need to write an application that runs in user space, and you must install make, gcc, and glibc on your development computer. Other C compilers should also work.

The source code is available in the following GitHub repository:

https://github.com/deviceWISE/device-cloud-lib

To download the latest stable release, click releases and on the Release page, download the latest release.

For build instructions, including the list of required dependencies, see the README.md file in the source code you download.

VxWorks 7

The source code is available in the device-cloud-lib GitHub repository from the vxworks_layer branch:

https://github.com/deviceWISE/device-cloud-lib/tree/vxworks_layer

For more information about obtaining, configuring, and building the agent in VxWorks 7, see Device Cloud Quick Start for VxWorks 7.

Writing Your Application

To use the C APIs in your application, do the following:

  • Link your application against the libiot.so library.

  • Include the header file iot.h.

Workflow

  1. Create a thing definition in Device Cloud. For more information, see Device Cloud Management Portal User's Guide: Thing Definitions.

  2. Create an application in Device Cloud and specify the thing definition as the auto-registration thing definition ID. For more information, see Device Cloud Management Portal User's Guide: Applications.

    To create an application you need organization administrator privileges. You must also specify the privileges for your application. For security reasons, you should create a role for your application that specifies only the privileges your application requires before deploying your application in a production environment.

  3. Write your application using the C APIs and implement the required elements of the thing definition you created, including properties, attributes, alarms, and methods.

  4. Generate the connection configuration file for your application. For more information, see Generating a Connection Configuration File for a C Application.

  5. Run your application.

  6. Confirm that your application connected successfully to Device Cloud.