From: Steven P. <n9...@n9...> - 2003-12-13 06:28:43
|
On Dec 12, 2003, at 11:57 PM, Roger Binns wrote: > That is what the native/usb/usb.py code does as a test, but isn't > what bitpim proper does. BitPim invokes usbscan.py in the main > code to get a list of all USB devices and names them > usb::bus::device::interface What a shame, then, that MacOS X sort of gets in the way of this. Well, perhaps not, because if you can't use the device then what is the point of allowing it to show up? In this case, I mean the other interfaces which are already spoken for by the kernel drivers... I am able to get a list of the busses and vendor/products of the devices on the bus, I just can't open the device if it's busy. I suppose I could *try* to open a whole range of interfaces on the device, say, 0-32, and save a list of the ones that could be opened. > comdiagnose then picks out what devices from the output of comscan.py > and usbscan.py are likely to be phones or USB to serial cables. Well, USB-to-serial cables would be mapped (at least on MacOS X) to /dev/cu.* devices (most likely), and then could be handled outside of the USB stuff. >> On MacOS X for this device, you *CAN* get to the interface in >> question, but you actually have to go directly for the interface by >> vendor, product, configuration and interface number. > > What if there are multiple devices with the same details? You actually get an iterator object that would cover all matching interfaces for your specification. > You can build a seperate interface for USB if you want to instead > of using libusb. You can see another example in native/wab > where I actually wrote my own code for Python interfacing. Okay, this will bear more thinking things through, then. I see that you have a usbdb list of phones supported and their vendor/product/config/interface information. This would be once source to use for just trying to see if the interfaces could be opened, and if so, put them in the list (for the Mac, at least). I see you have some USB->serial cables there with no interface listed. Do these connect as USB or through a device entry? At any rate, I will play around with a few things and get back to you. Unless I get it working at all, there's not much point in haggling over how to fit it into the project. :-) -. ----. -.-- - -.-- Steve Palm - n9...@n9... -. ----. -.-- - -.-- |