C - Basic Worker APIs

This section describes how to use the basic functions available to interact with the IoT Platform.  The definition of each function is described below. By clicking the link provided on the function, you will be redirected to the equivalent function description provided by the IoT Portal interface.  

Function API
Alarm Publish
(TR50: alarm.publish)
Use the following method to publish alarm values to a given thing.

int tr50_alarm_publish(void *tr50, constchar *alarm_key, constint state)

Property Publish
(TR50: property.publish)
Use the following method to publish property values to a given thing.

int tr50_property_publish(void *tr50, const char *prop_key, const double value)

Property Current
(TR50: property.current)
Use the following method to get property current values for a given thing.

int tr50_property_current(void *tr50, const char *prop_key, double *value);

Location Publish
(TR50: location.publish)
Use the following method to publish location values to a given thing.

int tr50_location_publish(void *tr50, const double lat, const double lng)

Log Publish
(TR50: log.publish)
Use the following method to publish logs to a given thing.

int tr50_log_publish(void *tr50, const char *msg)

Thing Bind
(TR50: thing.bind)
Use the following method to bind the session to a given thing.

int tr50_thing_bind(void *tr50, const char *thing_key)

Thing Unbind
(TR50: thing.unbind)
Use the following method to unbind session from a given thing.

int tr50_thing_unbind(void *tr50, const char *thing_key)

Attribute Set
(TR50: attr.set)
Use the following method to set an attribute to a given thing.

int tr50_thing_attr_set(void *tr50, const char *key, const char* value)

Attribute Unset
(TR50: attr.unset)
Use the following method to unset an attribute for a given thing.

int tr50_thing_attr_unset(void *tr50, const char *key)

Attribute Get
(TR50: attr.get)
Use the following method to get the attribute for a given thing.

int tr50_thing_attr_get(void *tr50, const char *key, char **value)

Tag Add
(TR50: tag.add)
Use the following method to add a tag for a given thing.

int tr50_thing_tag_add(void *tr50, const char *tags[], const int count)

Tag Delete
(TR50: tag.del)
Use the following method to delete a tag for a given thing.

int tr50_thing_tag_delete(void *tr50, const char *tags[], const int count)

Mailbox Send
(TR50: mailbox.send)
Use the following method to send a mailbox item to a given thing.

int tr50_mailbox_send(void *tr50, const char *mailbox_cmd, JSON* params);

Method Exec
(TR50: method.exec)
Use the following method to invoke a method on a given thing.

int tr50_method_exec(void *tr50, cconst char *method, JSON* params);