Re: linux development
"Don Zickus" <[email protected]>
| Newsgroups | gmane.comp.mobile.bitpim.devel |
|---|---|
| Message-ID | <[email protected]> |
Roger, >> One of the things I was looking at is setting up the hotplug scripts >>properly on Linux. Currently on my box they don't work, so I have to >>change all the file permissions by hand to use bitpim with my personal >>account. > >BTW the hotplug scripts have nothing to do with Python. They do >fundamentally >work. You have to get the usb ids correct which depend on your phone >and/or >cable. We can't install the scripts ourselves since some devices are >generic >USB to serial (eg Prolific PL2303 used in many phone as well as other >cables) >and there are several different versions of hotplug out there and the >various >distro vendors like to move the config files around. > 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 only dealt with the /proc filesystem. This lead me to my earlier question about what you actually did with those files. Using the USB scanner as an example it seemed possible to create symbolic links or even 'dummy' files for every possible device Bitpim supported (through the use of a device.usermap). If you just needed an easy way to locate inserted devices, this seemed like a possible approach. On the other hand if you are actually opening the devices, it may need some more work. I guess that was what I was looking to investigate (again for my machine for starters) and didn't want to step on anyone's toes. >>I am not a python programmer, more like a low level kernel programmer. > >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. >>I understand the comscan logic but not the entire reason. Does bitpim >>just scan the /dev/* stuff just to see what is plugged in or does it >>actually use those devices for reading/writing? If so, then how does the >>usb library fit in to the whole picture. > >That depends on the phone model and/or cable. Some phones export a USB >modem interface (ACM) and that is what BitPim needs to talk to. BitPim >doesn't have the ACM protocol builtin, so we have to talk to a device >node that implements it. > >Other cables are USB to serial (eg PL2303 based) and we have to speak >to the device node that has the relevant driver behind that. > >And other phones are composite USB devices and have a secondary diagnostics >interface that must be spoken to. For those phones BitPim uses libusb. > So you really do need to open the /dev and read/write some data. >The things we really need are: > >- Being able to map from USB devices to the relevant device nodes. > Just how can we tell that USB device X on bus Y happens to be > /dev/ttyACM0? At the moment we just try to open the various > device nodes, but when it fails we can't tell if that is because > there is no device at all, or that there is and there are permissions > issues. > Ok. I noticed that. >- Notification that there has been a device change (appearance or > removal of any of the relevant device names) > 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), provided a list of USB ids are given through some device.usermap file, any time one of those ids is inserted/extracted, the corresponding device script is executed. That script is given some limited info and can do whatever it wants as 'root' (ie create symbolic links, create /tmp files, send signals to programs). This method seemed useful. Perhaps I am missing something. What do you guys think? Regards, Don >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 >_______________________________________________ >BitPim-devel mailing list >[email protected] >https://lists.sourceforge.net/lists/listinfo/bitpim-devel ------------------------------------------------------- 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