[Nut-upsdev] blazer_usb: compatibility with Ippon BackPro UPSes (Phoenix Power Co., Ltd usb-to-serial controller)

Alexey Loukianov mooroon2 at mail.ru
Tue Jan 12 14:20:00 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

08.01.2010 12:59, Arjen de Korte wrote:
> We probably need a small delay between sending a command and reading  
> the reply. Currently it seems to read just three characters. Since we  
> only try reading once (instead of repeatedly until a timeout or end of  
> line occurs), this probably fails.
> 

Gotcha!
Here is diff that fixes error and makes ippon subdriver to work normally on
RHEL4 (and Fedora8 also, tested on my home PC):

[allukjanov at server drivers]$ svn diff blazer_usb.c
Index: blazer_usb.c
===================================================================
- --- blazer_usb.c        (revision 2240)
+++ blazer_usb.c        (working copy)
@@ -202,7 +202,7 @@
                return ret;
        }

- -       snprintf(buf, sizeof(buf), "%.*s", ret, tmp);
+       snprintf(buf, buflen, "%.*s", ret, tmp);

        upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf);
        return ret;

I think, this bug is pretty self-explaining.

- -- 
Best regards,
Alexey Loukianov                          mailto:mooroon2 at mail.ru
System Engineer,                            Mob.:+7(926)218-1320
*nix Specialist

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJLTIUQAAoJEPB9BOdTkBUL6j4H/0WA5feZ7QMbqrbXkkIrh4lm
R+sR7N8bn++OPtp6Q5Ylj5KaiuxQWHPDg1CHLa1VMB3AhIdeSvV/OqWmqnzTlGlJ
OK5SnYTMWEEvhDM4HW4Wgw/cCjo32zgMu1wysQ1v6xQhFmQeK8NbkdJNZsGvA71Y
9HW9QdO3HHcJrcDPLANuBhvgIIfTfca6YgGi8pm0lCi1enjY5uJYcaYtxKvnboZ/
Llpqr5Zm0R3F5VD11/ZaCCmqgr2k+8yt/ePGxTdSHadk+pvokZ2K7Hyqj80sncAV
0xhCRq/NldVOpNmL80eaPHkvOcMFoyiLtsJjuKmU/P1lHZEUFtrMzes7srgQQzA=
=6/aj
-----END PGP SIGNATURE-----



More information about the Nut-upsdev mailing list