communication: added protocol for emulator reset 54/13254/2
authorGiWoong Kim <giwoong.kim@samsung.com>
Mon, 2 Dec 2013 02:14:41 +0000 (11:14 +0900)
committerGiWoong Kim <giwoong.kim@samsung.com>
Mon, 2 Dec 2013 02:27:35 +0000 (11:27 +0900)
The Qemu-Skin protocol has been extended to share the
emulator reset state.

Change-Id: I2d9a49c3ddee0ecf7f9006efddc5e710e88fbb51
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/emul_state.c
tizen/src/emul_state.h
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/ICommunicator.java
tizen/src/skin/client/src/org/tizen/emulator/skin/comm/sock/SocketCommunicator.java
tizen/src/skin/maruskin_server.c
tizen/src/skin/maruskin_server.h

index 9f16e6bf02c83249d81c653589e1e478ef4014a2..6d94209cedb682e7155092072f88e5571c67c433 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "maru_common.h"
 #include "emul_state.h"
+#include "skin/maruskin_server.h"
 #include "debug_ch.h"
 
 #if defined(CONFIG_LINUX)
@@ -166,6 +167,11 @@ void set_emulator_condition(int state)
 {
     if (state == BOOT_COMPLETED) {
         INFO("boot completed!\n");
+        // TODO:
+    } else if (state == RESET) {
+        INFO("reset emulator!\n");
+
+        notify_emul_reset();
     }
 
     _emul_state.emulator_condition = state;
index b58ee6dc71dcc58723c0987928c3668a16200253..a87d2a120fbaee0f4f20828163e2d3824af20e6a 100644 (file)
@@ -40,6 +40,7 @@
 enum {
     BOOTING = 0,
     BOOT_COMPLETED = 1,
+    RESET = 2,
 };
 
 /* keep it consistent with emulator-skin definition */
index e17fc4abcd47c0cf05d25c37f45f21540e277a4b..51891eb9daa319c20084ff789181075f5cac5734 100644 (file)
@@ -258,7 +258,8 @@ public interface ICommunicator extends Runnable {
                RECV_ECS_STARTED((short) 802),
                RECV_DRAW_FRAME((short) 900),
                RECV_DRAW_BLANK_GUIDE((short) 901),
-               RECV_SHUTDOWN((short) 999);
+               RECV_EMUL_RESET((short) 998),
+               RECV_EMUL_SHUTDOWN((short) 999);
 
                private short value;
 
index 3564c624772a4f53c146bc3eae81625e7a23bbe3..98ba55d9ed7bb76467971777ba738b18a0ce25d1 100755 (executable)
@@ -463,8 +463,15 @@ public class SocketCommunicator implements ICommunicator {
 
                                        break;
                                }
-                               case RECV_SHUTDOWN: {
-                                       logger.info("received SHUTDOWN from QEMU");
+                               case RECV_EMUL_RESET: {
+                                       logger.info("received EMUL_RESET from QEMU");
+
+                                       // TODO:
+
+                                       break;
+                               }
+                               case RECV_EMUL_SHUTDOWN: {
+                                       logger.info("received EMUL_SHUTDOWN from QEMU");
 
                                        sendToQEMU(SendCommand.RESPONSE_SHUTDOWN, null, false);
                                        terminate();
index ebcb90fb42d33ab60c6e6266bc0c8d9581920878..e14e547efd0032474f563b88512bc06446b42ec6 100644 (file)
@@ -138,7 +138,8 @@ enum {
     SEND_ECS_STARTED = 802,
     SEND_DRAW_FRAME = 900,
     SEND_DRAW_BLANK_GUIDE = 901,
-    SEND_SHUTDOWN = 999,
+    SEND_EMUL_RESET = 998,
+    SEND_EMUL_SHUTDOWN = 999,
 };
 
 static int seq_req_id = 0;
@@ -227,7 +228,7 @@ void shutdown_skin_server(void)
 
     if (client_sock) {
         INFO("send shutdown to skin.\n");
-        if (0 > send_skin_header_only(client_sock, SEND_SHUTDOWN, 1)) {
+        if (0 > send_skin_header_only(client_sock, SEND_EMUL_SHUTDOWN, 1)) {
             ERR("fail to send SEND_SHUTDOWN to skin.\n");
             close_server_socket = 1;
         } else {
@@ -454,6 +455,21 @@ void notify_host_kbd_state(bool on)
     }
 }
 
+void notify_emul_reset(void)
+{
+    INFO("notify_emul_reset\n");
+
+    if (client_sock) {
+        if (0 > send_skin_header_only(
+            client_sock, SEND_EMUL_RESET, 1)) {
+
+            ERR("fail to send SEND_EMUL_RESET to skin\n");
+        }
+    } else {
+        INFO("skin client socket is not connected yet\n");
+    }
+}
+
 int is_ready_skin_server(void)
 {
     return ready_server;
index 3e492a33f6320b98a0ba3cb6ef6f9602e2c619b0..e7e278f425511393969fdad684606ce427272e7a 100644 (file)
@@ -42,6 +42,7 @@ void notify_ramdump_completed(void);
 void notify_booting_progress(unsigned int layer, int progress_value);
 void notify_brightness_state(bool on);
 void notify_host_kbd_state(bool on);
+void notify_emul_reset(void);
 
 int is_ready_skin_server(void);
 int get_skin_server_port(void);