
0
Answered
How to listen clients with iRidium server.
TuomoHautala 5 years ago
in Applications / i3 Pro
•
updated by Aleksandr Romanov (CTO) 5 years ago •
5
Customer support service by UserEcho
Log: http://support.iridiummobile.net/topics/12357-log-of-channels-and-feedbacks-in-ui/
Connected users: http://dev.iridiummobile.net/Server_API/en#IR.EVENT_AUTHORIZE
Catch tag change: http://dev.iridiummobile.net/Editor_Server_Tools/en#Activation_of_scenes_from_control_panels
[code]
IR.SetGlobalListener(IR.EVENT_GLOBAL_TAG_CHANGE, function (name, value)
{
IR.Log(name + ">" + value);
switch (name){
case ("Server.Channels.getTechnicalData"):
//Insert code
break;
case ("Server.Channels.getAreaData"):
//Insert code
break;
case ("Server.Channels.getAreaNumbersAndNames"):
//Insert code
break;
}
});
IR.SubscribeTagChange("Server.Channels.getTechnicalData");
IR.SubscribeTagChange("Server.Channels.getAreaData");
IR.SubscribeTagChange("Server.Channels.getAreaNumbersAndNames");
[/code]
Remeber, You can have _only one_ "EVENT_GLOBAL_TAG_CHANGE" on you project.
Also, you can use the parameter "Script Modifier" on Channels. With this parameter you can call one function on JS.
So, for example, if you write this function
and set "Script Modifier" parameter of channel named as getTechnicalData for run function "virtual_to_virtual" then you can copy the value of channel on tag with same name.
So for example if i have nodejs client that will connect to server and send requests / commands to iRidium server, is there iRidium server RECEIVE script EVENT so i can log requests / commands and use the in my script?