OSDN Git Service

AI 146315: am: CL 146314 modify GSM emulation to accomodate 1.0 and 1.1 system images.
authorDavid Turner <>
Wed, 15 Apr 2009 13:50:15 +0000 (06:50 -0700)
committerThe Android Open Source Project <initial-contribution@android.com>
Wed, 15 Apr 2009 13:50:15 +0000 (06:50 -0700)
  without this, networking doesn't work well when using the 1.1 add-on with
  the cupcake sdk
  Original author: digit
  Merged from: //branches/cupcake/...

Automated import of CL 146315

emulator/qemud/qemud.c

index 8f7e616..c578145 100644 (file)
@@ -1438,12 +1438,14 @@ multiplexer_handle_control( Multiplexer*  mult, Packet*  p )
          */
         if (client != NULL) {
             client_registration(client, 1);
+        } else {
+            D("%s: NULL client: '%.*s'", __FUNCTION__, p->len, p->data+11);
         }
         goto EXIT;
     }
 
     /* connection registration failure */
-    if (p->len >= 13 && !memcmp(p->data, "ko:connect:",11)) {
+    if (p->len == 13 && !memcmp(p->data, "ko:connect:",11)) {
         int     channel = hex2int(p->data+11, 2);
         Client* client  = multiplexer_find_client(mult, channel);
 
@@ -1464,8 +1466,18 @@ multiplexer_handle_control( Multiplexer*  mult, Packet*  p )
         goto EXIT;
     }
 
-    D("%s: unknown control message: '%.*s'",
-      __FUNCTION__, p->len, p->data);
+    /* A message that begins with "X00" is a probe sent by
+     * the emulator used to detect which version of qemud it runs
+     * against (in order to detect 1.0/1.1 system images. Just
+     * silently ignore it there instead of printing an error
+     * message.
+     */
+    if (p->len >= 3 && !memcmp(p->data,"X00",3)) {
+        goto EXIT;
+    }
+
+    D("%s: unknown control message (%d bytes): '%.*s'",
+      __FUNCTION__, p->len, p->len, p->data);
 
 EXIT:
     packet_free(&p);
@@ -1477,6 +1489,8 @@ multiplexer_serial_receive( Multiplexer*  mult, Packet*  p )
 {
     Client*  client;
 
+    T("%s: channel=%d '%.*s'", __FUNCTION__, p->channel, p->len, p->data);
+
     if (p->channel == CHANNEL_CONTROL) {
         multiplexer_handle_control(mult, p);
         return;