Материал из Module developer
Device.AddListener()
to add the device listener
Syntax
Device.AddListener(event, function, [pointer]);
| input | sample | description |
| function | function(data) {} | type: function the unnamed function or reference to the function |
| pointer | - | type: object the pointer to the object which services the function (optional) |
| output |
| data | type: string to get data in the byte format |
Example:
Module.GetDevice("MyDevice").AddListener(IR.EVENT_RECEIVE_TEXT, function(text) { IR.Log(text); });
When using the device listener only driver events work
