Phil Dibowitz wrote:
FYI: I get the feeling that unistd.h may not be available on Windows - so
someone may want to test that and let me know...

Well, the attached patch fixes the compile failure.

However, it seems like there are some pretty serious issues with the Windows USB code:

FindRemote doesn't actually enumerate attached USB devices, but instead uses APIs that seem to just query the registry. The registry keeps information on all USB devices ever attached. I believe the consequences are:

1) If a Harmony has ever been attached, FindRemote will always return success, even if the remote isn't currently attached. (I've certainly observed this myself.)

2) If you have plugged in more than one type of Harmony, the code will always find the first one you plugged in, again, even if it isn't currently attached. (I'm unable to test this assertion.)

In turn, this means that the wait-for-reset loop in concordance.c always immediately exits, but then set_time fails, because the remote isn't really there.

This can be solved by adding a calling to get_identity within the wait-for-reset loop. This actually does touch HW on Windows, and hence fails, which can be made to force the loop to loop instead of exit.

However, I figure we should instead fix FindRemote to only find actually-attached remotes. I'm trying to look into this, but it's not a 5-minute fix.
Index: concordance/concordance.c
===================================================================
RCS file: /cvsroot/concordance/concordance/concordance/concordance.c,v
retrieving revision 1.28
diff -u -p -r1.28 concordance.c
--- concordance/concordance.c   14 Apr 2008 08:07:07 -0000      1.28
+++ concordance/concordance.c   15 Apr 2008 05:04:12 -0000
@@ -27,7 +27,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 #ifdef WIN32
 /* Windows includes*/
@@ -37,6 +36,7 @@
 
 #define strcasecmp stricmp
 #define strncasecmp strnicmp
+#define sleep Sleep
 
 /*
  * Windows, in it's infinite awesomeness doesn't include POSIX things
@@ -58,6 +58,7 @@ HANDLE con;
 #include <getopt.h>
 #include <strings.h>
 #include <libgen.h>
+#include <unistd.h>
 
 #endif
 
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel

Reply via email to