skin: define startup argumnet for ECS port
authorGiWoong Kim <giwoong.kim@samsung.com>
Tue, 30 Jul 2013 11:18:34 +0000 (20:18 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Tue, 30 Jul 2013 11:24:06 +0000 (20:24 +0900)
Change-Id: I1a95ef2b48f0d0ac55c88030d8970208d9c2cdae
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/emulator.c
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorShmSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/EmulatorSkin.java
tizen/src/skin/client/src/org/tizen/emulator/skin/config/EmulatorConfig.java
tizen/src/skin/client/src/org/tizen/emulator/skin/layout/GeneralPurposeSkinComposer.java
tizen/src/skin/client/src/org/tizen/emulator/skin/util/SkinUtil.java
tizen/src/skin/maruskin_client.c

index 0a303eae35730d864b5beb0adbb3028e1bbc02da..dc2fc132a10dc13fed425ec3dded2dcb52746e76 100644 (file)
@@ -150,6 +150,17 @@ int get_emul_vm_base_port(void)
     return _emul_info.vm_base_port;
 }
 
+/* ecs port for emualtor vm */
+void set_emul_vm_ecs_port(int port)
+{
+    _emul_info.vm_ecs_port = port;
+}
+
+int get_emul_vm_ecs_port(void)
+{
+    return _emul_info.vm_ecs_port;
+}
+
 /* current emulator condition */
 int get_emulator_condition(void)
 {
index ab7a5668de8fe817e75ec72a41f11cba24154eeb..692c3c2955ba5e14b23c58e84bcd09aa088ce1ad 100644 (file)
@@ -83,6 +83,7 @@ typedef  struct EmulatorConfigInfo {
     bool input_touch_enable;
     int max_touch_point;
     int vm_base_port;
+    int vm_ecs_port;
     /* add here */
 } EmulatorConfigInfo;
 
@@ -106,6 +107,7 @@ void set_emul_input_mouse_enable(bool on);
 void set_emul_input_touch_enable(bool on);
 void set_emul_max_touch_point(int cnt);
 void set_emul_vm_base_port(int port);
+void set_emul_vm_ecs_port(int port);
 
 void set_emulator_condition(int state);
 void set_emul_rotation(short rotation_type);
@@ -122,6 +124,7 @@ bool is_emul_input_mouse_enable(void);
 bool is_emul_input_touch_enable(void);
 int get_emul_max_touch_point(void);
 int get_emul_vm_base_port(void);
+int get_emul_vm_ecs_port(void);
 
 int get_emulator_condition(void);
 short get_emul_rotation(void);
index 1db3f9e20bf467f28f7a77c1ab06a1d6adef3235..ba608d3cac88d0764fa47a856efb28f8735def5d 100644 (file)
@@ -377,6 +377,8 @@ static void prepare_basic_features(void)
     sdb_setup(); /* determine the base port for emulator */
     set_emul_vm_base_port(tizen_base_port);
 
+    set_emul_vm_ecs_port(tizen_ecs_port);
+
     gchar * const tmp_str = g_strdup_printf(" sdb_port=%d,"
         " http_proxy=%s https_proxy=%s ftp_proxy=%s socks_proxy=%s"
         " dns1=%s", get_emul_vm_base_port(),
index 4b038328d33767a5c2c422937f74475bcbb2d7c3..935a051e0dc318ba7660bc0347a0db639963b849 100644 (file)
@@ -243,7 +243,7 @@ public class EmulatorShmSkin extends EmulatorSkin {
 
                /* base + 1 = sdb port */
                /* base + 2 = shared memory key */
-               int shmkey = config.getArgInt(ArgsConstants.NET_BASE_PORT) + 2;
+               int shmkey = config.getArgInt(ArgsConstants.VM_BASE_PORT) + 2;
                logger.info("shmkey = " + shmkey);
 
                /* initialize shared memory */
index 6e5af2d62afd3511b5603c7b1ade49a5e05189e4..ac043922cf8f5e52c90b7f29d250c1b6f8438893 100644 (file)
@@ -228,7 +228,8 @@ public class EmulatorSkin {
        }
 
        private void setColorVM() {
-               int portNumber = config.getArgInt(ArgsConstants.NET_BASE_PORT) % 100;
+               int portNumber =
+                               config.getArgInt(ArgsConstants.VM_BASE_PORT) % 100;
 
                if (portNumber >= 26200) {
                        int red = (int) (Math.random() * 256);
@@ -1084,9 +1085,10 @@ public class EmulatorSkin {
                        public void widgetSelected(SelectionEvent e) {
 
                                String emulName = SkinUtil.getVmName(config);
-                               int portSdb = config.getArgInt(ArgsConstants.NET_BASE_PORT);
-                               int portEcp = 0;
+                               int portSdb = config.getArgInt(ArgsConstants.VM_BASE_PORT);
+                               int portEcp = config.getArgInt(ArgsConstants.VM_ECS_PORT);
 
+                               /*
                                DataTranfer dataTranfer = communicator.sendDataToQEMU(
                                                SendCommand.ECP_PORT_REQ, null, true);
                                byte[] receivedData = communicator.getReceivedData(dataTranfer);
@@ -1094,6 +1096,7 @@ public class EmulatorSkin {
                                portEcp |= receivedData[1] << 16;
                                portEcp |= receivedData[2] << 8;
                                portEcp |= receivedData[3];
+                               */
 
                                ProcessBuilder procEcp = new ProcessBuilder();
 
@@ -1544,7 +1547,7 @@ public class EmulatorSkin {
                                        return;
                                }
 
-                               int portSdb = config.getArgInt(ArgsConstants.NET_BASE_PORT);
+                               int portSdb = config.getArgInt(ArgsConstants.VM_BASE_PORT);
 
                                ProcessBuilder procSdb = new ProcessBuilder();
 
index a326bd49cf17ccda38ed4c5e86e0157e08767c7d..1a7016f9f52fa168a6f7bbefc9d41ae3d21a4641 100644 (file)
@@ -77,9 +77,10 @@ public class EmulatorConfig {
                public static final String RESOLUTION_WIDTH = "width";
                public static final String RESOLUTION_HEIGHT = "height";
                public static final String TEST_HEART_BEAT_IGNORE = "test.hb.ignore";
-               public static final String VM_PATH = "vm.path";
                public static final String LOG_LEVEL = "log.level";
-               public static final String NET_BASE_PORT = "net.baseport";
+               public static final String VM_PATH = "vm.path";
+               public static final String VM_BASE_PORT = "vm.baseport";
+               public static final String VM_ECS_PORT = "vm.ecsport";
                public static final String SKIN_PATH = "skin.path";
                public static final String DISPLAY_SHM = "display.shm";
                public static final String INPUT_MOUSE = "input.mouse";
index 7d4c95751c66590920d4f2561b2d47f2f2f2e51a..ac158fbae0a48ec027296948539c62d1ef768fae 100644 (file)
@@ -48,8 +48,6 @@ import org.eclipse.swt.widgets.Shell;
 import org.tizen.emulator.skin.EmulatorSkin;
 import org.tizen.emulator.skin.EmulatorSkinState;
 import org.tizen.emulator.skin.comm.ICommunicator.RotationInfo;
-import org.tizen.emulator.skin.comm.ICommunicator.SendCommand;
-import org.tizen.emulator.skin.comm.sock.data.DisplayStateData;
 import org.tizen.emulator.skin.config.EmulatorConfig;
 import org.tizen.emulator.skin.config.EmulatorConfig.ArgsConstants;
 import org.tizen.emulator.skin.config.EmulatorConfig.SkinPropertiesConstants;
@@ -115,7 +113,8 @@ public class GeneralPurposeSkinComposer implements ISkinComposer {
 
                displayCanvas = new Canvas(shell, style);
 
-               int vmIndex = config.getArgInt(ArgsConstants.NET_BASE_PORT) % 100;
+               int vmIndex =
+                               config.getArgInt(ArgsConstants.VM_BASE_PORT) % 100;
 
                int x = config.getSkinPropertyInt(SkinPropertiesConstants.WINDOW_X,
                                EmulatorConfig.DEFAULT_WINDOW_X + vmIndex);
index 81a4db4edd474d69b09433643e85c0433f9b59b6..b476393ad729bb2fc651dd910efdfb8317360a69 100644 (file)
@@ -105,7 +105,7 @@ public class SkinUtil {
                        vmName = EMULATOR_PREFIX;
                }
 
-               int portNumber = config.getArgInt(ArgsConstants.NET_BASE_PORT);
+               int portNumber = config.getArgInt(ArgsConstants.VM_BASE_PORT);
 
                return vmName + ":" + portNumber;
        }
index 98b5d242b066d4e05a5f19d86aab983fdff36f1b..ecf6d24ca2b982ee9dd417e5a112b11ac663d31c 100644 (file)
@@ -62,7 +62,8 @@ MULTI_DEBUG_CHANNEL(qemu, skin_client);
 #define OPT_SVR_PORT "svr.port"
 #define OPT_UID "uid"
 #define OPT_VM_PATH "vm.path"
-#define OPT_NET_BASE_PORT "net.baseport"
+#define OPT_VM_BASE_PORT "vm.baseport"
+#define OPT_VM_ECS_PORT "vm.ecsport"
 #define OPT_DISPLAY_SHM "display.shm"
 #define OPT_INPUT_MOUSE "input.mouse"
 #define OPT_INPUT_TOUCH "input.touch"
@@ -102,12 +103,15 @@ static void *run_skin_client(void *arg)
 
     char* vm_path = tizen_target_path;
     //INFO( "vm_path:%s\n", vm_path );
+
     char buf_skin_server_port[16];
     char buf_uid[16];
-    char buf_tizen_base_port[16];
+    char buf_vm_base_port[16];
+    char buf_vm_ecs_port[16];
     sprintf(buf_skin_server_port, "%d", skin_server_port);
     sprintf(buf_uid, "%d", uid);
-    sprintf(buf_tizen_base_port, "%d", get_emul_vm_base_port());
+    sprintf(buf_vm_base_port, "%d", get_emul_vm_base_port());
+    sprintf(buf_vm_ecs_port, "%d", get_emul_vm_ecs_port());
 
     /* display */
     char buf_display_shm[8] = { 0, };
@@ -180,8 +184,10 @@ static void *run_skin_client(void *arg)
             strlen(buf_uid) + SPACE_LEN +
         strlen(OPT_VM_PATH) + EQUAL_LEN +
             QUOTATION_LEN + strlen(vm_path) + SPACE_LEN +
-        strlen(OPT_NET_BASE_PORT) + EQUAL_LEN +
-            strlen(buf_tizen_base_port) + SPACE_LEN +
+        strlen(OPT_VM_BASE_PORT) + EQUAL_LEN +
+            strlen(buf_vm_base_port) + SPACE_LEN +
+        strlen(OPT_VM_ECS_PORT) + EQUAL_LEN +
+            strlen(buf_vm_ecs_port) + SPACE_LEN +
         strlen(OPT_DISPLAY_SHM) + EQUAL_LEN +
             strlen(buf_display_shm) + SPACE_LEN +
         strlen(OPT_INPUT_TOUCH) + EQUAL_LEN +
@@ -204,6 +210,7 @@ static void *run_skin_client(void *arg)
 %s=%d \
 %s=\"%s\" \
 %s=%d \
+%s=%d \
 %s=%s \
 %s=%s \
 %s=%d \
@@ -217,7 +224,8 @@ static void *run_skin_client(void *arg)
         OPT_SVR_PORT, skin_server_port,
         OPT_UID, uid,
         OPT_VM_PATH, vm_path,
-        OPT_NET_BASE_PORT, get_emul_vm_base_port(),
+        OPT_VM_BASE_PORT, get_emul_vm_base_port(),
+        OPT_VM_ECS_PORT, get_emul_vm_ecs_port(),
         OPT_DISPLAY_SHM, buf_display_shm,
         OPT_INPUT_TOUCH, buf_input_touch,
         OPT_MAX_TOUCHPOINT, maxtouchpoint,