On Thu, Nov 01, 2012 at 10:10:07PM +0530, $rik@nth wrote: > Android is not giving any abstract layer for this kind of scenarios. > > I heard that using udev rule we can solve the problem. But that is also not > the right way to do it, so thought of asking for experts thoughts. What problem are you trying to solve? And if you're trying to write a udev rule, why not just trigger off the device vendor and product ID, rather than some random device address? Sarah Sharp > On Thu, Nov 1, 2012 at 9:56 PM, Sarah Sharp > <sarah.a.sharp@xxxxxxxxxxxxxxx>wrote: > > > On Wed, Oct 31, 2012 at 02:27:04PM +0530, $rik@nth wrote: > > > Hi Sarah, > > > > > > I need some help regarding the usb devices(Android based mobiles)., > > > > > > I am having some trouble in automating the task. I am testing some > > android > > > based mobiles in linux machine. The automation script uses the device id > > > under "/dev/bus/usb/001/"053" it will be always under bus 001 only.. But > > > the dev id will be random like if i insert one mobile then the dev id > > will > > > be 053, if remove and insert it again then the dev id will be 054.. > > > > That's the device address, not the device ID. > > > > And note that if there are two host controllers (which is probably not > > likely with a smart phone, but may be possible with a tablet), then the > > bus numbers might change as well across reboots. One bus may be > > enumerated before the other for one boot, and get bus number 1, while on > > the next boot it gets bus number 2. > > > > > The problem is, when some tests runs on the device and if device gets > > > rebooted then new dev id is showing for the rebooted one and my scripts > > > failing due to new dev id.. > > > > > > Is there any way to force usb devices to use same dev id instead of new > > > one. So that there will be no issues to my tests even after device > > reboots. > > > > No, there isn't. The USB core goes through device addresses > > incrementally, and that's not something you can change. > > > > The bigger question here is *why* you need to dig around in the sysfs > > files. Doesn't Android give you some higher level abstraction that you > > should be using instead? > > > > Sarah Sharp > > > > > > -- > Thanks & Regards, > M.Srikanth Kumar. -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html