ThingWorx Edge C SDK > Running the C SDK > Registering Properties and Services
  
Registering Properties and Services
Registering properties and services with the API accomplishes two things:
1. Tells the API what callback function to invoke when a request for that property or service comes in from ThingWorx platform.
2. Gives the API information about the property or service so that when ThingWorx browses the Edge device, it can be informed about the availability and the definition of that property or service.
To register services and properties, follow these examples:
/* Register our services */
ds = twDataShape_Create(twDataShapeEntry_Create("a",NULL,TW_NUMBER));
twDataShape_AddEntry(ds, twDataShapeEntry_Create("b",NULL,TW_NUMBER));
twApi_RegisterService(TW_THING, thingName,
"AddNumbers", NULL, ds, TW_NUMBER, NULL, addNumbersService, NULL);


/* Register our properties */
twApi_RegisterProperty(TW_THING, thingName,
"InletValve", TW_BOOLEAN, NULL, "ALWAYS", 0, propertyHandler, NULL);
twApi_RegisterProperty(TW_THING, thingName,
"Pressure", TW_NUMBER, NULL, "ALWAYS", 0, propertyHandler, NULL);
twApi_RegisterProperty(TW_THING, thingName,
"BigGiantString", TW_STRING, NULL, "ALWAYS", 0, propertyHandler, NULL);
For more information about using the callbacks, refer to the section, Server-Initiated Interactions.