2015年11月3日 星期二

Connect cp2102 or FTDI to Android 3.1 +

The issue here is that the CP210x driver is not enabled in the Android kernel by default. So you will either need to build this driver in to your kernel to get the tty access and ability to use JavaComm.
The other option is to use the USB Host functionality and access your CP210x directly with it's API.
from Preston answered Dec 10 '13 at 15:19


Roger Clark 



The other people trying experience, still not work.
http://www.crifan.com/add_rts_and_dtr_support_for_silicon_labs_cp2102_in_usb_serial_for_android/

CP210x driver on Android 4.0.4
http://124.16.139.131:24080/lxr/source/kernel/omap/drivers/usb/serial/cp210x.c?v=android-4.0.4


It works if your Android kernel support CP210x or FTDI driver by using this App.
"USB Serial Terminal Lite"
https://play.google.com/store/apps/details?id=com.oneman.freeusbtools&hl=zh_TW


6/26/14




Ok.

Eventually solved my own problem.

When I imported the projects into Eclipse, the default Java Build path -> Source   location settings are are for /src and /gen
However the project sources for this are in /java/src/...

So I've moved the files into /src as this seem to be the default (possibly current best practice ???) - as I said, I'm new to Android dev, so I'm not sure what the norms are, but when you create an empty project in the latest version of Eclipse it puts the source files in /src

The issue of the library name was just syntax, i.e the project can be renamed in Eclipse from "main" to USBSerialLibrary using the Refactor -> Rename command.

The stuff in the HowTo about linking the library seems to be out of date as well. As far as I can see (and it works for me in Eclipse ADT  v22.6.2-1085508), is just to add the USBSerialLibrary project as a library to the Android setting in Properties.

BTW. I seem to need to compile as Android 4.2.2 because of a reference to JELLYBEAN in the code

I'm also getting lots of warnings, but normally isn't good news, however the only ones that probably needs to be dealt with in the long term is that

import android.widget.TwoLineListItem;

appears to be deprecated.

Anyway, I hope this helps anyone else just starting out on this journey ;-)

沒有留言:

張貼留言