From 5b80a97317a630ccb5567e94db65b99d0eb46f0f Mon Sep 17 00:00:00 2001 From: David Turner <> Date: Sat, 18 Apr 2009 20:50:39 -0700 Subject: AI 146565: am: CL 146315 am: CL 146314 modify GSM emulation to accomodate 1.0 and 1.1 system images. 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/... Original author: android-build Automated import of CL 146565 --- emulator/qemud/qemud.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'emulator') diff --git a/emulator/qemud/qemud.c b/emulator/qemud/qemud.c index 8f7e616..c578145 100644 --- a/emulator/qemud/qemud.c +++ b/emulator/qemud/qemud.c @@ -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; -- cgit v1.1