The Libusb of the Road of android--4.2-3g transplantation (i.)

Source: Internet
Author: User

The previous time to the smart TV transplant 3G module, found that the transplant 3G Baidu Google a search, basically all Linux Development Board,

I am here to record the whole process of my transplant, let others less detours, what advice or not the welcome message ~


Writing is not easy, reproduced please specify the source: http://blog.csdn.net/jscese/article/details/39057033

I. Equipment identification

The current 3G module is USB interface, plug in the Android system will be recognized by default as a USB storage device, will try to mount as a USB storage device Vold!

So it is necessary to turn off the device type, converted into a modem type device, only in order to achieve normal communication between the host and the module, here need a conversion driver,

usb-modeswitch Open source Drive, download online: http://www.draisberghof.de/usb_modeswitch/#download

which also need to support the API library, source download: http://www.libusb.org/

Only if the 3G device is correctly identified by mode conversion, the porting of the API required by Usb-modeswitch is first resolved.



Two. Compiling Libusb/libusb-compat

The latest libusb-1.0.9 and libusb-compat-0.1.4 (compatible with long versions) can be downloaded from the above URLs.

Extracted to our Android source external , these two lib is for the back of the Usb_modeswitch service Dynamic library, can be directly on the Linux cross-compiling, and finally can get libusb.so Libusb-compat.so, compiling methods online there are many!

I think it is to the Android platform transplant, then I put into the external with the Android compilation mechanism to compile!

Add a android.mk to two folders below

First look at Libusb's android.mk:


#jscese Add this android.mk to compile libusb.so for Usb_modelswitch 140819local_path: = $ (call My-dir) include $ (clear_var S) COMMON_SRC: =libusb/core.c libusb/descriptor.c libusb/io.c libusb/sync.c libusb/os/linux_usbfs.c common_include: =$ (Local_path)/$ (Local_path)/libusb $ (local_path)/libusb/oslocal_module: = Libusblocal_src_files: =$ (COMMON_SRC) Local_c_includes +=$ (common_include) include $ (build_shared_library)

You can see the compiled. C source files as long as 5 is OK, we download the LIBUSB package inside some do not need to make some modifications and configuration,

My libusb source download: http://download.csdn.net/detail/jscese/7868431


Libusb-compat's ANDROID.MK:


#jscese Add this android.mk to compile libusb-compat.so for Usb_modelswitch 140819local_path: = $ (call My-dir) include $ (CL Ear_vars) Libusb_dir: =external/libusbcommon_src: =libusb/core.c common_include: =$ (Local_path)/$ (LOCAL_PATH)/ Libusb $ (libusb_dir)/libusblocal_module: = Libusb-compatlocal_src_files: =$ (COMMON_SRC) local_c_includes +=$ (common_ Include) Local_shared_libraries: = Libusbinclude $ (build_shared_library)

You can see Libusb-compat introducing LIBUSB

My libusb-compat source download: http://download.csdn.net/detail/jscese/7868445


Can be passed under the source code:

Mmm External/libusb

Compile the corresponding. So separately


Here first record Libusb transplant, step by step.



Android--4.2-3g Libusb of the transplant (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.