summaryrefslogtreecommitdiff
path: root/src/transport_usb.c
diff options
context:
space:
mode:
authorho.namkoong <ho.namkoong@samsung.com>2013-11-20 21:58:45 +0900
committerho.namkoong <ho.namkoong@samsung.com>2013-11-20 22:05:45 +0900
commitb9624afc01b221260f007b694609db7e39af89c5 (patch)
tree321088da1b4c1cd00b37273b17daddb331be3458 /src/transport_usb.c
parent68b194a569a4ba98297655e61fdddc6baefc90eb (diff)
downloadsdb-b9624afc01b221260f007b694609db7e39af89c5.tar.gz
sdb-b9624afc01b221260f007b694609db7e39af89c5.tar.bz2
sdb-b9624afc01b221260f007b694609db7e39af89c5.zip
SDB: support suspend mode
support suspend mode in emulator. If emulator is in suspend mode, all the connections between sdb and emulator are closed Change-Id: I633e06906aeb8a84ac0044f3efbbd369b37842d2 Signed-off-by: ho.namkoong <ho.namkoong@samsung.com>
Diffstat (limited to 'src/transport_usb.c')
-rwxr-xr-xsrc/transport_usb.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/transport_usb.c b/src/transport_usb.c
index 270bddd..b364e87 100755
--- a/src/transport_usb.c
+++ b/src/transport_usb.c
@@ -25,7 +25,6 @@
#include "sdb_usb.h"
#include "transport.h"
-static void init_usb_transport(TRANSPORT *t, usb_handle *h, int state);
static int remote_read(TRANSPORT* t, void* data, int len)
{
@@ -61,21 +60,6 @@ static void remote_kick(TRANSPORT *t)
sdb_usb_kick(t->usb);
}
-static void init_usb_transport(TRANSPORT *t, usb_handle *h, int state)
-{
- D("transport: usb\n");
- t->close = remote_close;
- t->kick = remote_kick;
- t->read_from_remote = remote_read;
- t->write_to_remote = remote_write;
- t->connection_state = state;
- t->type = kTransportUsb;
- t->usb = h;
- t->sdb_port = -1;
- t->req = 0;
- t->res = 0;
-}
-
static int get_connected_device_count(transport_type type)
{
int cnt = 0;
@@ -102,7 +86,19 @@ void register_usb_transport(usb_handle *usb, const char *serial)
D("transport: %p init'ing for usb_handle %p (sn='%s')\n", t, usb,
serial ? serial : "");
- init_usb_transport(t, usb, CS_OFFLINE);
+
+ t->close = remote_close;
+ t->kick = remote_kick;
+ t->read_from_remote = remote_read;
+ t->write_to_remote = remote_write;
+ t->connection_state = CS_OFFLINE;
+ t->type = kTransportUsb;
+ t->usb = usb;
+ t->sdb_port = -1;
+ t->req = 0;
+ t->res = 0;
+ t->suspended = 0;
+
if(serial) {
t->serial = strdup(serial);
}