On Wednesday 09 April 2008, Phil Dibowitz wrote:
> Marcel de Jong wrote:
> > Hello all,
> >
> > I'm afraid I have some bad news, not sure if others have had this as
> > well. When I tried to set up my 555, I needed to have the remote learn
> > some new trick via IR (basically because it refused to turn on or off me
> > TV and all other devices I have), but when I ran the command it gave me
> > this error message:
>
> It got broken sometime recently - when the file_read() stuff was done. I
> fixed it in CVS, thanks for pointing that out.

Did you? Cannot see any change yet.. In case you didn't have time, I found 
meanwhile that it's actually two bugs - one probably from the file_read 
changes in libharmony.cpp, which fails because checking an unset err 
variable, and the next one in remote.cpp from the USB buffer changes, to the 
effect that the length byte now sits in rsp[63], not in rsp[64].

Attached patch should fix both.

Andreas
Index: libconcord.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/libconcord.cpp,v
retrieving revision 1.26
diff -u -3 -p -u -p -r1.26 libconcord.cpp
--- libconcord.cpp	4 Apr 2008 09:16:08 -0000	1.26
+++ libconcord.cpp	10 Apr 2008 19:39:52 -0000
@@ -1215,12 +1215,9 @@ int extract_firmware_binary(uint8_t *xml
 
 int learn_ir_commands(uint8_t *data, uint32_t size, int post)
 {
-	int err;
+	int err = 0;
 
 	if (data) {
-		if (err != 0) {
-			return err;
-		}
 
 		uint8_t *t = data;
 		string keyname;
Index: remote.cpp
===================================================================
RCS file: /cvsroot/concordance/concordance/libconcord/remote.cpp,v
retrieving revision 1.30
diff -u -3 -p -u -p -r1.30 remote.cpp
--- remote.cpp	4 Apr 2008 09:16:09 -0000	1.30
+++ remote.cpp	10 Apr 2008 19:39:52 -0000
@@ -638,7 +638,7 @@ int handle_ir_response(uint8_t rsp[64], 
 	unsigned int &t_on, unsigned int &t_off, unsigned int &pulse_count,
 	unsigned int *&pulses, unsigned int &freq)
 {
-	const unsigned int len = rsp[64];
+	const unsigned int len = rsp[63];
 	if ((len & 1) == 0) {
 		for (unsigned int u = 2; u < len; u += 2) {
 			const unsigned int t = rsp[u] << 8 | rsp[1+u];
-------------------------------------------------------------------------
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