All Versions
6
Latest Version
Avg Release Cycle
438 days
Latest Release
37 days ago

Changelog History

  • v2.2.2

    March 01, 2020

    🛠 fixes:

    • 🛠 fix CP2102N initialization
    • 0️⃣ align device_filter.xml with devices recognized by DefaultProber
  • v2.2.1

    February 11, 2020

    🛠 fixes

    • 🛠 fix CH340 initialization
  • v2.2.0

    January 11, 2020

    🔋 features:

    • 👌 support multi-port CDC devices
    • 👌 support FTDI control lines
    • ➕ added FTDI specific get/setLatencyTimer, getModemStatus methods

    ♻️ refactoring:

    • reuse UsbRequest to reduce to reduce LogCat output
  • v2.1.0

    November 15, 2019

    🔋 features:

    • 👍 DTR and RTS support for CP21xx drivers
    • reimplemented read timeout. caution: too short timeout can cause data loss, see wiki for details
    • include proguard rules in .aar library to retain driver classes instantiated by UsbSerialProber

    🛠 fixes:

    • 👌 improve error handling in close and more reliably interrupt read and terminate SerialInputOutputManager
    • harmonize + cleanup error messages
    • correct purgeHwBuffers parameter description
    • manage USB permission intent in sample app
    • ✅ more code coverage tests

    🔄 changes:

    • 👍 distinguish IllegalArgumentException and UnsupportedOperationException in setParameter
      If you had dedicated handling for IllegalArgumentException, you now have to handle both
    • 0️⃣ SerialInputOutputManager now has infinite read/write timeout per default, to prevent data loss
      If you want to use SerialInputOutputManager.writeAsync you should set a readTimeout!=0 before starting the thread
  • v2.0.0

    October 12, 2019

    🔀 merged back changes collected in kai-morich's fork

    🆕 new features:

    • support ft_232h, cp210_ multiport devices
    • CH34x: data bits, parity, stop bits
    • CP21xx: mark+space
    • 👌 support USB devices with other non CDC related endpoints
    • 👍 CH34x: support more baudrates

    🔄 changes:

    increased minimum Android version to 4.3 (API 17)

    🚀 Always use async read (UsbDeviceConnection.requestWait), as bulkTransfer (UsbDeviceConnection. bulkTransfer) can cause data loss at high baud rates. Before this release only the CdcAcm driver used async read.

    With async read currently read timeout != 0 is ignored. read blocks until data is available (except Ftdi, where status data is available each 16msec).

    💻 Instead of using read you can use the asynchronuos SerialInputOutputManager to be notified on available data. SerialInputOutputManager.writeAsync is also affected, as the loop blocks in a read. Instead you can write directly in your UI thread.

  • v0.1.0

    March 04, 2014

    Version : 0.1.0
    🚀 Release date: November 13, 2012
    Notes : First public release of usb-serial-for-android.

    Quick Start

    1. Download usb-serial-for-android-v010.jar

    2. Copy the jar to your Android project's libs/ directory. (See Android's FAQ for help).

    3. Copy device_filter.xml to your project's res/xml/ directory.

    4. Configure your AndroidManifest.xml to notify your app when a device is attached (see Android USB Host documentation for help).

    \<activityandroid:name="..." ...\> \<intent-filter\> \<action android:name="android.hardware.usb.action.USB\_DEVICE\_ATTACHED" /\> \</intent-filter\> \<meta-dataandroid:name="android.hardware.usb.action.USB\_DEVICE\_ATTACHED"android:resource="@xml/device\_filter" /\> \</activity\>
    

    5. Use it! Example code snippet:

    // Get UsbManager from Android.UsbManager manager = (UsbManager) getSystemService(Context.USB\_SERVICE);// Find the first available driver.UsbSerialDriver driver = UsbSerialProber.acquire(manager);if (driver != null) { driver.open(); try { driver.setBaudRate(115200); byte buffer[] = new byte[16]; int numBytesRead = driver.read(buffer, 1000); Log.d(TAG, "Read " + numBytesRead + " bytes."); } catch (IOException e) { // Deal with error. } finally { driver.close(); } }
    

    👀 For a more complete example, see the UsbSerialExamples/ project, which is a simple application for reading and showing serial data.

    ✅ A simple Arduino application is also available (in arduino/), which can be used for testing.

    usb-serial-for-android is written and maintained by mike wakerly.

    This library is licensed under LGPL Version 2.1. Please see LICENSE.txt for the complete license.

    Copyright 2011-2012, Google Inc. All Rights Reserved.

    👀 Portions of this library are based on libftdi (http://www.intra2net.com/en/developer/libftdi). Please see FtdiSerialDriver.java for more information.

    Help & Discussion

    👀 For common problems, see the Troubleshooting wiki page.

    For other help and discussion, please join our Google Group, usb-serial-for-android.