From 6ab686bd4bfa1459d67fa108697f0bac1f4d67ad Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 21 Jul 2010 16:35:51 +0200 Subject: irecovery: Only request data on initial connect, not after every command This prevents possibly obsolete usb traffic. It appears requesting data after every command is also no longer needed due to the new event handling code. --- src/irecovery.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/irecovery.c') diff --git a/src/irecovery.c b/src/irecovery.c index 327527b..da5812d 100644 --- a/src/irecovery.c +++ b/src/irecovery.c @@ -104,13 +104,13 @@ void init_shell(irecv_client_t client) { irecv_event_subscribe(client, IRECV_RECEIVED, &received_cb, NULL); irecv_event_subscribe(client, IRECV_PRECOMMAND, &precommand_cb, NULL); irecv_event_subscribe(client, IRECV_POSTCOMMAND, &postcommand_cb, NULL); - while (!quit) { - error = irecv_receive(client); - if (error != IRECV_E_SUCCESS) { - debug("%s\n", irecv_strerror(error)); - break; - } + error = irecv_receive(client); + if (error != IRECV_E_SUCCESS) { + debug("%s\n", irecv_strerror(error)); + } + + while (!quit) { char* cmd = readline("> "); if (cmd && *cmd) { error = irecv_send_command(client, cmd); -- cgit v1.1-32-gdbae