1 import java.util.Arrays;
3 import java.util.ArrayList;
4 import iotruntime.master.CommunicationHandler;
6 public class TestClassCallbacks_Stub {
8 public static void main(String[] args) throws Exception {
10 CommunicationHandler comHan = new CommunicationHandler(true);
12 int[] ports = comHan.getCallbackPorts(numOfPorts);
16 //String address = "localhost";
17 //String address = "192.168.2.191"; // RPi2
18 //String skeletonAddress = "128.195.136.170"; // dc-9.calit2.uci.edu
19 String skeletonAddress = "128.195.204.132";
20 String callbackAddress = "128.195.204.132"; // dw-2.eecs.uci.edu (this machine)
21 //String skeletonAddress = "192.168.2.108"; // RPi1
22 //String callbackAddress = "192.168.2.191"; // RPi2
25 TestClassComplete_Stub tcstub = new TestClassComplete_Stub(localport, port, skeletonAddress, callbackAddress, rev, ports);
26 System.out.println("==== CALLBACKS ====");
27 CallBackInterface cbSingle = new CallBack(2354);
28 tcstub.registerCallback(cbSingle);
29 System.out.println("Registered callback!");
30 //CallBackInterface cbSingle1 = new CallBack(2356);
31 //tcstub.registerCallback(cbSingle1);
32 System.out.println("Registered callback!");
34 System.out.println("Return value from callback 1: " + tcstub.callBack() + "\n\n");
35 //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)4576) + "\n\n");
36 System.out.println("Return value from callback 2: " + tcstub.callBack() + "\n\n");
37 //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1233) + "\n\n");
38 //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1321) + "\n\n");