We are developing a new USB Serial Driver "Physicaloid Library".
Physicaloid Library is FTDriver + Arduino Writer + CP210x Driver and has simple APIs.
https://github.com/ksksue/PhysicaloidLibrary
USB Serial Driver using Android USB Host API
- Java source code
- no root
- baudrate : 9600 - 230400 (be able to setting immediate baudrate number)
- support FTDI chips (FT232RL, FT232H, FT2232C/D/HL, FT4232HL FT230X, REX-USB60F/MI(FT232BL) checked)
- support any channels (FT2232X:2ch, FT4232X:4ch)
- support CDC-ACM(beta)
- like Arduino library's interface
Connection
Android [USB A port] --- [USB B port] FTDI Chip
- requirement
- Android : version 3.1 or upper and have an USB host port
- Board : FTDI Chip or CDC-ACM(beta)
-
Library Project
FTDriver : Driver for connecting an FTDI chip to Android USB host port -
Sample Projects
FTSampleTerminal : very simple terminal
FTSerialCSV : serial communication with a Genet educational board (www.genet-nara.jp) in CSV format (Thanks for Heima Hayashida)
Fig. Connecting an Android tablet to a Genet board(FT232RL) by a USB cable.(ET2011 Forum in Japan)
new
mSerial = new FTDriver((UsbManager)getSystemService(Context.USB_SERVICE));
open
mSerial.begin(FTDriver.BAUD9600);
- baud rate (bps)
BAUD9600
BAUD14400
BAUD19200
BAUD38400
BAUD57600
BAUD115200
BAUD230400
and be able to setting immediate baud rate (no check).
read n bytes
byte[] rbuf = new byte[n];
len = mSerial.read(rbuf);
read n bytes from channel p
byte[] rbuf = new byte[n];
len = mSerial.read(rbuf, n, p)
write n bytes
byte[] wbuf = new byte[n];
...(set wbuf)
len = mSerial.write(wbuf,n);
write n bytes to channel p
byte[] wbuf = new byte[n];
...(set wbuf)
len = mSerial.write(wbuf,n,p);
close
mSerial.end();
@ksksue
Web page : Geekle Board - http://ksksue.com/wiki/
Copyright © 2011 @ksksue Licensed under the Apache License, Version 2.0