ThingWorx Edge SDK Extensions for the C SDK > Examples of Using Edge Extensions with the C SDK > Simple Thing Extension
  
Simple Thing Extension
The Simple Thing extension provides a simple thing shape example This example is intended to provide a starting point for you to create your own shape libraries. It creates a thing shape that has two String properties and a service that operates on them. The genericPropertyHandler() function is used to store your current property values on the help and automatically make them available to the ThingWorx platform.
This example extension is located in the ./examples/simpleextlib/ subdirectory of the C SDK installation. The files in this subdirectory include:
simpleshape.h—This header file is required only if this library is going to be statically linked to your application. It exposes the library initialization function. When your application starts, you can load this shape into your list of shapes. These shapes can then be used in the construction of a thing, using the twCreateThingFromTemplate() function.
simpleshape.c—This file provides the code for this simple thing shape example. The service, createMessage, concatenates two property values and a parameter value into a single string that is returned. This file is commented to help you understand how to create your own thing shapes. The comments explain the actions of the service as well as an explanation of how the shape is created, how properties, and services are added to a thing shape. Finally the comments explain the requirement for an init function that will be called when this shape is dynamically loaded. The name of the function must include the same name as the library itself and init. For this example, this function is named init_simple.
CMakeLists.txt—This file is the CMake file that you pass in when building this example.