Working Java v.1.0 for arbitrary calls of callback objects
[iot2.git] / iotjava / iotrmi / Java / basics / TestClassCallbacks_Stub.java
index 390ed8fa39f0064df62e97cd17b60b9317e39a57..81b20dd25dab5eedbe22daedb801bedb7b5730c0 100644 (file)
@@ -8,9 +8,10 @@ public class TestClassCallbacks_Stub {
        public static void main(String[] args) throws Exception {
 
                CommunicationHandler comHan = new CommunicationHandler(true);
-               int numOfPorts = 4;
+               int numOfPorts = 2;
                int[] ports = comHan.getCallbackPorts(numOfPorts);
 
+               int localport = 5011;
                int port = 5010;
                //String address = "localhost";
                //String address = "192.168.2.191";     // RPi2
@@ -21,11 +22,20 @@ public class TestClassCallbacks_Stub {
                //String callbackAddress = "192.168.2.191";     // RPi2
                int rev = 0;
 
-               TestClassComplete_Stub tcstub = new TestClassComplete_Stub(port, skeletonAddress, callbackAddress, rev, ports);
+               TestClassComplete_Stub tcstub = new TestClassComplete_Stub(localport, port, skeletonAddress, callbackAddress, rev, ports);
                System.out.println("==== CALLBACKS ====");
                CallBackInterface cbSingle = new CallBack(2354);
                tcstub.registerCallback(cbSingle);
                System.out.println("Registered callback!");
-               System.out.println("Return value from callback: " + tcstub.callBack());
+               //CallBackInterface cbSingle1 = new CallBack(2356);
+               //tcstub.registerCallback(cbSingle1);
+               System.out.println("Registered callback!");
+
+               System.out.println("Return value from callback 1: " + tcstub.callBack() + "\n\n");
+               //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)4576) + "\n\n");
+               System.out.println("Return value from callback 2: " + tcstub.callBack() + "\n\n");
+               //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1233) + "\n\n");
+               //System.out.println("\n\nCalling short one more time value: " + tcstub.getShort((short)1321) + "\n\n");
+               while(true) {}
        }
 }