Similar to Sming this sample calls the
we register the events that we are interested in. As shown below.
addEventListener mimics the browser addEventListener function.
It accepts two parameters - a unique event name and a callable function. Similar to the browser function
you can add multiple callable functions to one event.
Excerpt from the
The actual implementation of the
addEventListener C++ function is in the
There you will find also the
triggerEvent function which is available only in the C/C++ code.
JsEventData params; params["temp"]="20"; triggerEvent("EVENT_TEMP", params);
The code above simulates a temperature sensor sending the temperature in Celsius (C).