| 
      
      
      From: <la...@no...> - 2010-12-02 11:27:17
      
     | 
| Hi, Thanks for your kindly feedback. I just come back from a leave, so sorry for the late reply. If we re-write the check-mtp-device.sh as a c program, then I am afraid the implementation has been a little complicated. Because, the argument I got in the script is the device path, like '/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-8', we know, each interface of the new device has its own sub-directory under this device path, thus to re-write as a c program, we have to read each sub-dir entries under this device path, search if there exist a file with filename 'interface', if found, read out its contents to check if certain pattern, like 'mtp' exist. With bash script, one line of code can achieve this: grep -i mtp `find -name interface`, it is much simple , what's your opinion, will there be a significant performance decrease by implementing as a bash script? For MS OS descriptor, I am not sure whether it has been exported to sys fs by kernel, even yes, string descriptor is much more simple to deal with, thus currently we do not use MS OS descriptor approach. Of course, I have to admit this does not cover devices who do not set its string descriptors. Thanks & Regards, Lan Liu -----Original Message----- From: ext Linus Walleij [mailto:lin...@gm...] Sent: Thursday, December 02, 2010 7:01 AM To: lib...@li... Cc: Li Feng.5 (Nokia-MS/Beijing); Tarvainen Miska (Nokia-MS/Beijing); Quadros Roger (Nokia-MS/Helsinki); Wang Hongyu (Nokia-MS/Beijing); lin...@vg... Subject: Re: [Libmtp-discuss] udev and libmtp: detect a new mtp device based on its USB interface descriptor 2010/12/1 Linus Walleij <lin...@gm...<mailto:lin...@gm...>>: > 2010/11/3 <la...@no...<mailto:la...@no...>>: > >> Based on this information, I wrote a bash script, passing it with 2 >> arguments: device path and the string description to match >> against > > I've added this script in the new utils/ subdir in the libmtp CVS for > now, thinking about how to possibly write a C program to do the > same probing and also potentially check for the OS descriptor. I've added a skeleton util/mtp-probe.c program that will hopefully do the interface probing at some point.. Linus Walleij ------------------------------------------------------------------------------ Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! Tap into the largest installed PC base & get more eyes on your game by optimizing for Intel(R) Graphics Technology. Get started today with the Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. http://p.sf.net/sfu/intelisp-dev2dev _______________________________________________ Libmtp-discuss mailing list Lib...@li...<mailto:Lib...@li...> https://lists.sourceforge.net/lists/listinfo/libmtp-discuss |