-
Notifications
You must be signed in to change notification settings - Fork 14
Sending Signals
###Sessionless Signal To send a signal, use the sendSignal method in the bus class. Its signature looks like this:
bus.sendSignal(sendSignalSuccess, sendSignalError, indexList, inParameterType, parameters)
####sendSignalSuccess The first parameter is the success callback.
####sendSignalError The second parameter is the failure callback.
####indexList
The third parameter is an array with four elements, each of which is an array index. Together, they are used to locate the signature (e.g. “!Chat str>s”
) of the signal to be sent. (details)
####inParameterType The fourth parameter is a string representing the types of parameters which will be sent with the notification. It take the type codes for each of the signal's output parameters and concatenate them together. (details)
####parameters An array containing the parameters to be sent.
###Session Signal Using the bus to send a signal means you are sending a sessionless signal. To send a signal as part of a session use the sendSignal method in the session class:
session.sendSignal(sendSignalSuccess, sendSignalError, destination, path, indexList, inParameterType, parameters)
These are these same parameters as the bus's sendSignal
method, with the exception of the destination
and path
parameters. What these are for requires further investigation. Passing null
for both values has worked for our test applications thus far.
Example:
session.sendSignal(
function(){console.log("signal success)},
function(){console.log("signal failure)},
null,
null,
[1, 0, 0, 0], //indicates '!CounterChanged CountValue>i'
'i',
[3]
);