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);
14 int localportsend = 5011;
15 int localportrecv = 6011;
18 //String address = "localhost";
19 //String address = "192.168.2.191"; // RPi2
20 //String skeletonAddress = "128.195.136.170"; // dc-9.calit2.uci.edu
21 String skeletonAddress = "128.195.204.132";
22 String callbackAddress = "128.195.204.132"; // dw-2.eecs.uci.edu (this machine)
23 //String skeletonAddress = "192.168.2.108"; // RPi1
24 //String callbackAddress = "192.168.2.191"; // RPi2
27 TestClassComplete_Stub tcstub = new TestClassComplete_Stub(localportsend, localportrecv, portsend, portrecv,
28 skeletonAddress, rev);
29 System.out.println("==== CALLBACKS ====");
30 CallBackInterface cbSingle = new CallBack(2354);
31 tcstub.registerCallback(cbSingle);
32 System.out.println("Registered callback!");
33 CallBackInterface cbSingle1 = new CallBack(2356);
34 tcstub.registerCallback(cbSingle1);
35 System.out.println("Registered callback!");
36 // CallBackInterface cbSingle2 = new CallBack(2360);
37 // tcstub.registerCallback(cbSingle2);
38 // System.out.println("Registered callback!");
40 System.out.println("Return value from callback 1: " + tcstub.callBack() + "\n\n");
41 // System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)4576) + "\n\n");
42 // System.out.println("Return value from callback 2: " + tcstub.callBack() + "\n\n");
43 // System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1233) + "\n\n");
44 // System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1321) + "\n\n");