I am new to this type of programming but what I want to do is to return a value from a function on a imp device from within a function inside the Agent.
To keep the communication between the device and the agent at a minimum I want to pull the imp on demand from the agent -vs- listening for events. Is this possible?
For example
// the following is a mix of Perl and C not squirrel ( I don’t know how to do it in squirrel yet )
//agent code
function GETIMPDATA(){
sensorvalue=remotefunction(1);
server.log(“the sensor value for sensor 1 =”+sensorvalue);
sensorvalue=remotefunction(2);
server.log(“the sensor value for sensor 2 =”+sensorvalue);
};
//device code
function remotefunction (sensor){
returnvalue=thesensor.sensor;
return returnvalue;
}
Thanks for your help