[Libusbx-devel] Reverting atexit call of libusb_exit from libusb-compat ?

2013-09-22 Thread Igor Furlan
Hi

Recently I've ordered (and received)  two USB based I2C/SPI interfaces
from NANO River Technology http://nanorivertech.com/viperboard.html.
This board is very useful for the LAB work during the evaluation and
debugging of the, so called, 'first silicon'.

Based on the sample code for Linux from NANO River, I've wrote a small
CLI utility to talk to our DUTs from the terminal prompt.

Everything works fine. Users are happy. There is just one thing they
do not like. They are getting on their screen the following message:

 [~/I2C]$   i2c 2B AA BB -b 100kbit -U VIPER
libusbx: warning [libusb_exit] application left some devices open

Yes, I've installed the latest version of the libusbx package. We are
running it on CentOS 6.4.

Is there a trick (or workaround) to suppress the message ?

Regards

Igor

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] Reverting atexit call of libusb_exit from libusb-compat ?

2013-09-22 Thread Hans de Goede
Hi,

On 09/22/2013 10:14 AM, Igor Furlan wrote:
> Hi
>
> Recently I've ordered (and received)  two USB based I2C/SPI interfaces
> from NANO River Technology http://nanorivertech.com/viperboard.html.
> This board is very useful for the LAB work during the evaluation and
> debugging of the, so called, 'first silicon'.
>
> Based on the sample code for Linux from NANO River, I've wrote a small
> CLI utility to talk to our DUTs from the terminal prompt.
>
> Everything works fine. Users are happy. There is just one thing they
> do not like. They are getting on their screen the following message:
>
>   [~/I2C]$   i2c 2B AA BB -b 100kbit -U VIPER
> libusbx: warning [libusb_exit] application left some devices open
>
> Yes, I've installed the latest version of the libusbx package. We are
> running it on CentOS 6.4.
>
> Is there a trick (or workaround) to suppress the message ?

Not really a trick or a workaround, you just need to make sure
that your application properly closes any devices it has opened
before exiting.

Regards,

Hans

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] Reverting atexit call of libusb_exit from libusb-compat ?

2013-09-22 Thread Ludovic Rousseau
2013/9/22 Igor Furlan :
> Hi

Hello,

> Recently I've ordered (and received)  two USB based I2C/SPI interfaces
> from NANO River Technology http://nanorivertech.com/viperboard.html.
> This board is very useful for the LAB work during the evaluation and
> debugging of the, so called, 'first silicon'.
>
> Based on the sample code for Linux from NANO River, I've wrote a small
> CLI utility to talk to our DUTs from the terminal prompt.
>
> Everything works fine. Users are happy. There is just one thing they
> do not like. They are getting on their screen the following message:
>
>  [~/I2C]$   i2c 2B AA BB -b 100kbit -U VIPER
> libusbx: warning [libusb_exit] application left some devices open
>
> Yes, I've installed the latest version of the libusbx package. We are
> running it on CentOS 6.4.
>
> Is there a trick (or workaround) to suppress the message ?

Are you using libusb-compat?

if yes, can't you switch to libusbx directly?

Bye

-- 
 Dr. Ludovic Rousseau

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: hotplug/unplug support (#9)

2013-09-22 Thread litghost
I've tested tested the hotplug on USB 3.0 with a Windows Intel XCHI controller, 
and it appears to work.  I built with VS 2012, and was required to make some 
assorted fixes to get it to build 
https://github.com/manuelnaranjo/libusbx/pull/1 .

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/9#issuecomment-24884941--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Fixes memory leaks (#141)

2013-09-22 Thread Ludovic Rousseau
Closed #141.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/141--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Fixes memory leaks (#141)

2013-09-22 Thread Ludovic Rousseau
Fixed in e2babf7ec295bde9d0b04fe1c325131dc6aacf51

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/pull/141#issuecomment-24888525--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] Reverting atexit call of libusb_exit from libusb-compat ?

2013-09-22 Thread Igor Furlan
On Sun, Sep 22, 2013 at 2:43 AM, Ludovic Rousseau
 wrote:
> Are you using libusb-compat?
>
> if yes, can't you switch to libusbx directly?


Yes, I am using libusb-compat.  No, I can not switch to libusbx
directly because:
A) the example code from NANO River uses API based on libusb 0.1
B) my programming skills are not adequate to do the conversion
C) I plan to support DIMAX SUB-20 board within the same i2c CLI utility
D) their API (and example code) is based on libusbx 1.0

So, the libusbx+compat layer is  ideal combo for my tiny i2c CLI utility.

Or, perhaps, you know for some doc | guidance for "how to map legacy
libusb 0.1 API to modern libusbx 1.0 API" ?

Regards

Igor

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


[Libusbx-devel] [libusbx] Fixes minor problems (#142)

2013-09-22 Thread Ludovic Rousseau
Fix some problems reported by the Coverity scan tool
You can merge this Pull Request by running:

  git pull https://github.com/LudovicRousseau/libusbx fixes

Or you can view, comment on it, or merge it online at:

  https://github.com/libusbx/libusbx/pull/142

-- Commit Summary --

  * examples: check the value returned by libusb_init()
  * examples: check the value returned by libusb_handle_events()
  * examples: check value returned by libusb_bulk_transfer()
  * tests: set output_file to a valid value

-- File Changes --

M examples/hotplugtest.c (11)
M examples/xusb.c (8)
M tests/testlib.c (1)

-- Patch Links --

https://github.com/libusbx/libusbx/pull/142.patch
https://github.com/libusbx/libusbx/pull/142.diff
--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


[Libusbx-devel] Somes simple fixes

2013-09-22 Thread Ludovic Rousseau
Hello,

I propose some fixes in https://github.com/libusbx/libusbx/pull/142
If no objection in the next few days I will push them upstream.

The problems were reported by the Coverity scan tool. Some other
problems still need to be fixed.

Bye

-- 
 Dr. Ludovic Rousseau

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] Reverting atexit call of libusb_exit from libusb-compat ?

2013-09-22 Thread Igor Furlan
On Sun, Sep 22, 2013 at 2:37 AM, Hans de Goede  wrote:
> Not really a trick or a workaround, you just need to make sure
> that your application properly closes any devices it has opened
> before exiting.


Since I am not professional (or even semi professional) programmer,
can you, please, point me to the doc | info | code snippet | hint ,
where I can learn how to  close any devices properly.

What I did until now, was to take the C++ code example from NANO River
Tech web side and compile it on my system (CentOS 6.4).  At that time,
my CentOS had only the 'old' libusb installed. I am talking here about
libusb 0.1 (legacy).  Or, to be more specific, NANO River Tech uses
http://nanorivertech.com/files/viper/linux/libusb-0.1.12.tar.gz.

Their  C++ code example works without any issue with the libusb 0.1.
No problems with potentially opened devices at exit.

There is another  I2C interface I want to support with  my  i2c CLI
utility. It is a DIMAX  SUB-20 module (
http://www.xdimax.com/sub20/sub20.html ). Their  C code example uses
libusbx 1.0.

So, I decided to install libusbx 1.0.16  + compat layer on the CentOS.
This would cover both interface boards.

Yes, the both boards work. The NANO board produces warnings about non
closed devices at exit. The DIMAX board is OK

Igor

--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel


Re: [Libusbx-devel] [libusbx] Windows: hotplug/unplug support (#9)

2013-09-22 Thread Pete Batard
> Yes sorry my fault, it's just that I'm using linux for development with emacs 
> and those lines are just too long to actually be readable (yes I'm doing 80 
> chars here!).

You poor soul. You know they have invented high resolution monitors and editors 
with nice UI interfaces, where one can be fairly productive, since the 1990s, 
right? ;)

On a more serious note, I know some people swear by 80 chars, but I have yet to 
see a study indicating that it helps with being more productive and and 
introducing less bugs. If anything, I'd say it makes the amount of distracting 
code higher (since your eyes have to parse more lines), and therefore reduces 
the ability to concentrate on the actual substance. Then again, this is just my 
subjective opinion from using a nice UI editor on a > 1600px screen. Anyhoo:

> I got used to some linux kernel development long time ago and now can't leave 
> it behind as I really like it. But I can fix that no problem. I did paid 
> attention to the tabs/whitespace nightmare in libusb, what did I miss? Did I 
> introduce any spaces where there should be tabs? I'll review my changes again.

Since you have a Windows machine to test with, my advice would be to install 
TortoiseGit (note you'll need to install msysgit first) and fetch your repo. 
The diff has a very nice UI that will make it very explicit where spaces are 
used in lieu of tabs, by displaying dots vs arrows. For what is worth, pretty 
much all the lines you introduced in edde05c45ba7052b01fb25394d0a7267bad4c878 
use space in lieu of tabs. There's also some weird stuff where you introduce 
tabs in comments in d2612f119ab6dc969084e55fa122a66d998826cf. 
16f11affc63fe6593036799111c8a4f86011cde4 also has spaces instead of tabs.

> BTW shouldn't there be just one code guideline for the hole project?

Some people may insist on rigid project-wide guidelines, but I personally don't 
see that as a necessity, as too constraining. My take is that if you create a 
new source, you get to pick your styling (as long as it's not too wild). If you 
follow a source, you follow the styling used by the original author. Especially 
on a project such as libusb(x), this can help with keeping people who want to 
introduce a new backend happy for not having to depart from the style they are 
comfortable with (even if it's something as historical as 80 chars emacs...)

I'm not going to comment on MS vs C standards, since I would only have some 
very negative things to say, and that won't change the fact that, at the end of 
the day, we have no choice but to deal with how restrictive MSVC is in that 
respect.

---
Reply to this email directly or view it on GitHub:
https://github.com/libusbx/libusbx/issues/9#issuecomment-24894839--
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel