1.需要检查PC端的driver是否安装正确.
2.需要检查USB tethering的设置,比如我碰到的问题如下: Android2.3上把wifi不作为tethering 的upstream. Android4.0的确将wifi作为tethering的upstream.device/samsung/smdkc110/overlay_ulmo-ics-gmk/frameworks/base/core/res/res/values/config.xml<!-- Array of allowable ConnectivityManager network types for tethering --> <!-- Common options are [1, 4] for wifi and dun or [0,1,5,7] for --> <!-- mobile, wifi, hipri and bluetooth --> <integer-array translatable="false" name="config_tether_upstream_types"> <item>0</item> <item>1</item> <item>5</item> <item>7</item> </integer-array>
3.需要了解USB tethering 的代码通路.
比如:Android4.0 BSP切换不同的usb gadget功能的入口函数functions_store,
那这个入口函数如何和Framework层联系起来的? 请看下面的文件中的内容:
device/samsung/smdkc110/init.smdkc110.usb.rc
on property:sys.usb.config=rndis,adb终于弄明白Framework的UsbService.java和BSP的USB gadget function之间的联系。
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04e8
write /sys/class/android_usb/android0/idProduct 6864
write /sys/class/android_usb/android0/functions $sys.usb.config
write /sys/class/android_usb/android0/bDeviceClass 224
write /sys/class/android_usb/android0/enable 1
start adbd
setprop sys.usb.state $sys.usb.config
4. Reference:
http://www.dzsc.com/data/html/2009-8-11/78192.html
http://www.doc88.com/p-468115456611.html
http://fgsink.blog.163.com/blog/static/1671699702012112429589/
http://blog.csdn.net/wangyunqian6/article/details/7162636
http://blog.csdn.net/hongjiujing/article/details/4508105
http://armbedded.eu/node/193
http://www.cnblogs.com/cute/archive/2011/04/21/2023365.html
http://blog.csdn.net/yaozhenguo2006/article/details/7748896
http://blog.csdn.net/spark_fountain/article/details/7616001
http://blog.21ic.com/user1/1536/archives/2006/30783.html
http://blog.csdn.net/mcgrady_tracy/article/details/8164587
http://www.cnblogs.com/xidongs/archive/2011/11/26/2264229.html
http://blog.csdn.net/lidong_zhou/article/details/7677602
http://my.oschina.net/u/147624?disp=2&p=3
5. Android2.3/4.0 USB tethering archetecture comparation: