From 51ccf29106d11355f0595be802cf78a4ce285626 Mon Sep 17 00:00:00 2001 From: "munkyu.im" Date: Fri, 16 Mar 2012 12:25:35 +0900 Subject: [PATCH] [Title]remove useless sdb source [Type] [Module] [Priority] [CQ#] [Redmine#] [Problem] [Cause] [Solution] [TestCase] --- tizen/src/sdb.c | 49 ++----------------------------------------------- 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/tizen/src/sdb.c b/tizen/src/sdb.c index 326d756..10ea92e 100644 --- a/tizen/src/sdb.c +++ b/tizen/src/sdb.c @@ -278,53 +278,7 @@ int get_sdb_base_port(void) void sdb_setup(void) { - int tries = 10; - const char *base_port = "26100"; - int success = 0; int s; - int port; - uint32_t guest_ip; - const char *p; - char buf[64] = {0,}; - - inet_strtoip("10.0.2.16", &guest_ip); - - port = strtol(base_port, (char **)&p, 0); - - for ( ; tries > 0; tries--, port += 10 ) { - // redir form [tcp:26100:10.0.2.16:26101] - sprintf(buf, "tcp:%d:10.0.2.16:26101", port+1); - if(net_slirp_redir((char*)buf) < 0) - continue; - - // fprintf(stdout,"SDBD established on port %d\n", port+1); - success = 1; - break; - } - - INFO("redirect [%s] success\n", buf); - if (!success) { - ERR( "it seems too many emulator instances are running on this machine. Aborting\n" ); - exit(1); - } - -// if( tizen_base_port != port ){ -// ERR( "sdb port is miss match. Aborting (tizen_base_port=%d, port=%d)\n", tizen_base_port, port); -// exit(1); -// } - - /* Save base port. */ - tizen_base_port = port; - INFO( "Port(%d/tcp) listen for SDB \n", tizen_base_port + 1); - - /* for sensort */ - sprintf(buf, "tcp:%d:10.0.2.16:3577", get_sdb_base_port() + SDB_TCP_EMULD_INDEX ); - if(net_slirp_redir((char*)buf) < 0){ - ERR( "redirect [%s] fail \n", buf); - }else{ - INFO("redirect [%s] success\n", buf); - } - /* send a simple message to the SDB host server to tell it we just started. * it should be listening on port 26099. if we can't reach it, don't bother */ @@ -340,7 +294,8 @@ void sdb_setup(void) } /* length is hex: 0x13 = 19 */ - sprintf(tmp,"0013host:emulator:%d",port+1); + sprintf(tmp,"0013host:emulator:%d", tizen_base_port + 1); + INFO("sent %s to sdb server", tmp); socket_send(s, tmp, 30); } -- 2.7.4