ThingWorx Edge C SDK > Installing and Navigating the Directories of the C SDK
Installing and Navigating the Directories of the C SDK
To install the ThingWorx Edge C SDK, go to the PTC Support site (, Software Downloads page, and download the bundle to your computer, and extract the files. After you extract the files, the top level directory is called <MED-nnnnn-CD-055_<datecode>_C_SDK-v.v.v.bbbb where v.v.v.bbbb is the release number plus the build number. For example, 2-2-1-108 is the release number 2.2.1, with build number 108.
As of v.2.2.1, the non-FIPS distribution bundles of the C SDK include OpenSSL 32– and 64–bit libraries, version 1.0.2q, which, on Windows platforms are based on the Visual Studio 2015 runtime library. The FIPS distribution bundles of this SDK include OpenSSL 32–bit libraries, v.1.0.2l, which are based on the Visual Studio 2012 runtime library.
In addition, the axTLS library is no longer included in the C SDK distribution bundles as of release 2.2.1.
Directories and Files
The following table lists and briefly describes the directories and files of the C SDK. Note that the notation ./ indicates the top-level directory, which is named for the release, c-sdk-v.v.v.bbbb and <version> in the second-level directory replaces v.v.v.bbbb.
This Directory
See Also
The file,, which provides the major, minor, and revision numbers that comprise the SDK version.
The file, CMakeLists.txt, which provides the options for building a C SDK application. Note that such a file is provided for each of the C SDK examples.A README_BUILDING.txt file provides instructions for building the SDK with CMake
This directory also contains the subdirectories, doc, examples, src, and test. The rest of this table describes the contents of these main directories.
The PDF files for this document and the release notes; also the file for the Doxygen documentation.
The ThingWorx Edge SDKs and WS EMS Help Center, available at PTC ThingWorx Support site,
All the files and the search subdirectory for the Doxygen documentation.
The file provides an overview of the C SDK source code organization. To view the Doxygen documentation in a browser, open any of the *.html files in the html directory.
Subdirectories for the various examples: ExtUseExample, simpleextlib, SteamSensor, and warehouseextlib. Each subdirectory contains the source files for the example. Two of the examples also provide an XML file that contains entities for the example. You need to import this XML file into ThingWorx platform (using ThingWorx Composer) before running the example. Finally each example provides the CMake.txt file needed to build the example with CMake.
This directory contains subdirectories that contain all of the source code (*.c and *.h files) for the C SDK. For details, see the table below.
This directory contains subdirectories for the test suite for the C SDK. For details, see the table, below.
Source Files Directory (src)
This Subdirectory
See Also
The API source (*.c) and header (*.h) files. twApi.c, twApi.h.
twDefinitions.h contains the enumerated message types, message codes (status, errors), as well as type definitions (characteristic, BaseType, entityType).
twErrors.h contains definitions for different types of errors, including websocket, messaging, primitive/infotable, api, tasker, logger, utils, system socket, file transfer, tunneling, and managed property. It also contains the #defines for the msgCodeEnum errors.
twProperties.h contains definition structures and metadata functions for creating properties. twProperties.c contains the implementations of functions for creating and deleting property definitions.
twServices.h contains service definition structures and metadata functions for services. twProperties.c contains the implementations of functions for creating and deleting services.
twVersion.h contains the #define for the version of the C SDK. twVersion.h.template contains
Two configuration files, twConfig.h and twDefaultSettings.h. As its name implies, the twDefaultSettings.h file contains the default settings for many of the C SDK, parameters, should you decide to use default values and not include your own specific settings in your project. You can also change values here so that you have different default values for your projects.
The twConfig.h file is provided should you need to override common settings provided in the CMakeList.txt file. You can also use it if you are using Windows Solution (sln) or gcc Makefiles (the use of sln and make files is deprecated). Use this file only if you are not using one of these provided files to do per project configuration. Note that the settings in these files apply to ALL of your projects that use the SDK.
You can also edit CMake options at any time by editing them in the CMakeCache.txt files created when you generate your CMake build.
This directory contains the source and header files for the file transfer functionality of the C SDK, twFileManager.c, twFileManager.h, twFileTransferCallbacks.c, and twFileTransferCallbacks.h.
The following source and header files:
twBaseTypes.c, twBaseTypes.h contain the definitions of the Base Types of the SDK.
twInfoTable.c, twInfoTables.h contain the definitions of functions related to creating an infotable with the SDK.
twMessages.c, twMessages.h
twMessaging.c, twMessaging.h
Source and header files that contain wrappers for OS-specific functionality (twIos.c, twIos.h, twLinux.c, twLinux.h, twLinux-opensll.h, twMarvellExtras.c, twMarvelThreads.c twOSPort.h, twPThreads.c, twThreads.h, twTlSimplelink.c, twTlSimplelink.h, twWin32Threads.c, twWindows.c, twWindows.h, twWindows-openssl.h)
The stubs files in this directory are for compiling.
Source and header files (subscribedProps.c and subscribedProps.h) that contain the functionality to support subscribed properties.
Third-party libraries for the C SDK, including cJSON, libcfu, ntlm, openssl-<version>_fips-<version>_sdk, tomcrypt, and wildcard.
The files needed to use SSL/TLS with the SDK.
The source (twTunnelManager.c) and header (twTunnelManager.h) files for the Tunneling feature.
The source and header files for utilities provided by the SDK:
cryptoWrapper.c, cryptoWrapper.h
list.c (for doubly-linked list utilities)
stringUtils.c, stringUtils.h
twDict.c, twDict.h
twHttpProxy.c, twHttpProxy.h
twLogger.c, twLogger.h
twMap.c, twMap.h
twNtlm.c, twNtlm.h
twOfflineMsgStore.c, twOfflineMsgStore.h
twTasker.c, twTasker.h
The source (twWebsocket.c) and header (twWebsocket.h) files for the Websocket Client (abstraction layer).
The following table lists and briefly describes the contents of the test subdirectory, which contains all the source code files, entity files, and CMakeList.txt files needed to build and run the tests.
Test Subdirectory
This Subdirectory
chart-js-client.c and chart-js-client.h
Subdirectories and files to support the test applications, including XML files that contain entities used in the tests. The entities need to be imported into ThingWorx platform for the tests to run successfully.
graphite-client.c and graphite-client.hl This test is a simple, pure C client for Graphite that allows you to send metrics to Graphite/Carbon, using Graphite plain-text protocol.
Header files to support the test utilities.
Integration tests for the C SDK that test different features, including file transfers, FIPS, offline message storage, property writes, services, and more.
BindingIntegrationTestsSlow.c, which tests multiple combinations of bindng and connecting. OfflineMsgStoreIntegrationTestsSlow.c, which tests filling up the offline message store and flushing it, in different ways.
Performance tests that exercise binding, file transfer, ListForeach, property writes, and service execution. Also includes Kepware tests that represent high bandwidth throughput of properties (up to 10000 unique integer properties pushed up to a single thing in under one second).
TestServices.c, TestUtilities.c, crossPlatformTestSupport.c, testmain.c, and twPrimitiveUtils.c
Subdirectories and files for unit tests of twApi, twFileManager, twOfflineMessageStore, and more. Also contains the CMakeLists.txt file that is needed to build the tests.
The Unity Project test framework for C from MIT.
File required for building the test suite using CMake.