Re: [tuxdroid-user] usleep in send_daemon_disconnect()
Status: Beta
Brought to you by:
ks156
From: David B. <da...@ja...> - 2007-06-04 09:39:45
|
On Sat, 02 Jun 2007 10:04:59 +0200, neimad <ror...@gm...> wrote: > "David Bourgeois" <da...@ja...> writes: > >> There are 3 usleep in the code right now: >> 1. in id_lookup(), the RF is not connected and an id_lookup request is >> sent, usleep is used to wait for the answer that should be in the >> dongle 100ms to a few seconds later, there's nothing else to do while >> waiting here so usleep maybe still makes sense, no? > > That's ok, i guess. I forgot something here. The daemon will start when the dongle is plugged, will open the USB connection, but the connection to tux won't be initialized. It's the client that will request to conenct to tux with a specific id or do a id lookup. So during this function, the client is connected to the dongle. Anyway, during the id lookup, there's nothing else to send back to the client but the client might send another request to the daemon (though I don't have an exmaple on hand yet but we may find the need sometime). So I'll probably cut it in 2 parts like a normal tux command. >> 2. in send_daemon_disconnected() but I don't understand what it's for, >> I'll ask rémi on Monday but I guess we can just remove it; > > Ok, I'll repress my urges until then. Rémi doesn't know neither, so you know what to do :-) > >> 3. in usb_write_TuxDroid(), we first send the request to get the >> status, then the USB IC stores all data in the buffer and then it's >> available on the USB bus, usleep is meant to wait for the data here. >> That's the part I'd like to change by cutting the function in 2 parts >> as we can process some TCP stuff while waiting for the USB. > > Agreed, we definitely need to make this asynchronous. > > Damien > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > tux-droid-user mailing list > tux...@li... > https://lists.sourceforge.net/lists/listinfo/tux-droid-user |