Re: [Pyobjc-dev] Wrapping GetLocationID from IOUSBLib
Brought to you by:
ronaldoussoren
From: Orestis M. <or...@or...> - 2009-06-22 22:18:22
|
Hi Brendan, I would advise that you first confirm (by reading the apple docs or by asking at the appropriate apple list) that GetLocationID does indeed do what you want it to. The I/O Kit documentation should point you to the right direction. You are unlikely to receive answers about such esoteric stuff on this list, unless you strike gold and one of the members of the audience has experience with the inner workings of Mac OS X usb libs. If you do find out that GetLocationID does what you want, you'd need to load the framework it's part of in PyObjC, as it's not already there. If that turns out to be too much of a bother (I think it might be), you can always try using ctypes, but I think you can't mix ctypes and PyObjC values together (in case you want to embed your code in a PyObjC app). I *think* the above are accurate, but I'd love to be corrected if anyone has more accurate information. Orestis -- or...@or... http://orestis.gr/ On 23 Jun 2009, at 00:25, Brendan Simon (eTRIX) wrote: > I'm new to PyObjC (and Object C in general). > > I have a python application that accesses a USB device, and I want to > display the LocationID (like System Profiler and ioreg does). > > The LocationID seems to be OS X specific and not part of the standard > USB protocol and thus not part of PyUSB. > > So assuming OS X does not provide a python interface to IOUSBLib > (please > let me know if it does), then I have to find a way to access it from > Python. It would seem that PyObjC would be an appropriate method -- > yes/no ??? > > The header file IOUSBLib.h contains the function GetLocationID. > > IOReturn (*GetLocationID)(void *self, UInt32 *locationID); > > Am I able to wrap this one function (or is it a method ?) easily with > PyObjC ?? > > If it is easy, could someone provide some skeleton code for me to > work/play with. > If not so easy, could someone outline things that need to done and > point > me to some appropriate doucmentation. > > Many thanks, Brendan (pyobjc newbie) :) > > < > Brendan_Simon > .vcf > > > ------------------------------------------------------------------------------ > Are you an open source citizen? Join us for the Open Source Bridge > conference! > Portland, OR, June 17-19. Two days of sessions, one day of > unconference: $250. > Need another reason to go? 24-hour hacker lounge. Register today! > http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org_______________________________________________ > Pyobjc-dev mailing list > Pyo...@li... > https://lists.sourceforge.net/lists/listinfo/pyobjc-dev |