Re: linux development
"Roger Binns" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <000a01c555ea$e0d46010$3501a8c0@rogersqyvr14d3> |
Incidentally, what phone do you have? The various models and manufacturers behave differently and it is a bad idea to extrapolate from a sample of one. > OK. I guess one of the things I wanted to fix (for at least my Fedora > machine) was that the hotplug scripts did not know anything about the /dev > devices. They should do on other distros. (There is the added complication of whether or not you are using udev). > it seemed possible to create symbolic links or > even 'dummy' files for every possible device Bitpim supported (through the > use of a device.usermap). It isn't as you can't tell whether a USB to serial device is seen and is a cell phone, a GPS, an old mouse or something else. > On the other hand if you are > actually opening the devices, it may need some more work. Yes, we need to open the devices in some cases because the kernel provides a device driver we need to speak through. And unfortunately on Linux and Mac, you can't use libusb against a device for which a driver is installed and they both install the generic ACM driver, so the workaround of using our own ACM implementation wouldn't help. >>That is exactly what we need at the moment. Don't worry about the >>Python side. What I do need is C userspace code that will do various >>things and needs to run as a non-root user. >> > Great, please elaborate. If you have C userspace code that implements functionality we need then it is trivial for me to glue it into the Python. > So you really do need to open the /dev and read/write some data. Yes, for some phones and/or cables. Life would be easier if we could just stick to libusb and had our own drivers. > From what I have seen with the hotplug (and it could be because this is the > latest and greatest design which is incompatible with older distros), hotplug won't solve the notification problem since it is one or more unpriviledged user processes that need to find out about a device change. If hotplug was used then there would need to be some convoluted way for the user processes (BitPim) to register in a way that the running as root hotplug could notify them. There are so many potential security holes I won't go there. DBus is supposed to solve this, but I couldn't get it to give me device notifications. I would rather use it directly or whatever underlying mechanism it uses is. Roger ------------------------------------------------------- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click