Re: [tuxdroid-user] Daemon to USB connection
Status: Beta
Brought to you by:
ks156
From: neimad <ror...@gm...> - 2007-06-10 06:36:23
|
"David Bourgeois" <da...@ja...> writes: [...] > 1. either they're called alternately and we can't send a raw if the > ack is not received (as of now) > 2. either we can send a second command while waiting for the ack of > the first one; we can't send more than 2 commands while waiting for > the ack otherwise it's possible that it will overwrite the previous > command. > > I'd like to implement 2. and also add a buffer for the incoming > commands (from the API or anything else). > As of now the API sends one command to the daemon, waits for the ACK > and store it in a variable which is not used by the applications, > this explains why the daemon is still working. The ACK is always > TIMEOUT but that doesn't matter for the application. > > Any thought about this before I start working on it? (Yes I know I > have to add the protocols on the wiki ;-) ) Well, I'd like the daemon to use real *structures* instead of byte arrays. At least for client communication (i.e., commands coming from and replies to the API). The byte arrays' contents is anonymous, needs the declaration of symbolic index constants, makes the code bigger (and less readable) than necessary. On the Python side, sending data to a C program that expects structs can be achieved by the use of marshaling. I'm not aware of the latest and greatest ways to do this in Python, but 10+ years ago there were already such facilities, so I guess it must be possible and even easier today ;-) Damien |