You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a driver library to allow your Xamarin Android app to communicate with many common USB serial hardware. It uses the [Android USB Host API](http://developer.android.com/guide/topics/connectivity/usb/host.html)
5
+
This is a driver library to allow your Xamarin Android app to communicate with many common USB serial hardware. It uses the [Android USB Host API](http://developer.android.com/guide/topics/connectivity/usb/host.html)
6
6
available on Android 3.1+.
7
7
8
8
No root access, ADK, or special kernel drivers are required; all drivers are implemented in
9
-
c#. You get a raw serial port with `Read()`, `Write()`, and other basic
10
-
functions for use with your own protocols. The appropriate driver is picked based on the device's Vendor ID and Product ID.
9
+
c#. You get a raw serial port with `Read()`, `Write()`, and other basic
10
+
functions for use with your own protocols. The appropriate driver is picked based on the device's Vendor ID and Product ID.
11
11
12
-
This is a Xamarin C# port of Mike Wakerly's Java [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) library. It follows that library very closely. The main changes were to make the method names follow C# standard naming conventions. Some Java specific data types were replaced with .NET types and the reflection code is .NET specific. Code examples written for the Java version of the library should translate more or less faithfully to C#.
12
+
This is a Xamarin C# port of Mike Wakerly's Java [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) library. It followed that library very closely when it was ported. The main changes were to make the method names follow C# standard naming conventions. Some Java specific data types were replaced with .NET types and the reflection code is .NET specific. Code examples written for the Java version of the library should translate more or less faithfully to C#.
13
13
14
-
It also includes code derived from LusoVU's [XamarinUsbSerial](https://bitbucket.org/lusovu/xamarinusbserial) library. XamarinUsbSerial was a C# wrapper for the Java usb-serial-for-android. It used an older version of the usb-serial-for-android .jar file.
14
+
It also includes code derived from a portion of LusoVU's [XamarinUsbSerial](https://bitbucket.org/lusovu/xamarinusbserial) library. XamarinUsbSerial was a C# wrapper for the Java usb-serial-for-android. It used an older version of the usb-serial-for-android .jar file. Only the the C# code was used, the Java library is not referenced.
15
15
16
-
UsbSerialForAndroid is a 100% C# port of the original java code.
16
+
The default branch has been renamed from master to main. if you have a local clone, you can run the following commands to update the name of the default branch
17
+
18
+
```
19
+
git branch -m master main
20
+
git fetch origin
21
+
git branch -u origin/main main
22
+
git remote set-head origin -a
23
+
```
17
24
18
25
## Structure
19
26
@@ -25,7 +32,7 @@ This solution contains two projects.
25
32
## Getting Started
26
33
**1.** Reference the library to your project
27
34
28
-
**2.** Copy the [device_filter.axml](https://github.com/anotherlab/UsbSerialForAndroid/blob/master/UsbSerialExampleApp/Resources/xml/device_filter.xml) from the example app to your Resources/xml folder. Make sure that the Build Action is set to AndroidResource
35
+
**2.** Copy the [device_filter.axml](https://github.com/anotherlab/UsbSerialForAndroid/blob/master/UsbSerialExampleApp/Resources/xml/device_filter.xml) from the example app to your Resources/xml folder. Make sure that the Build Action is set to AndroidResource
29
36
30
37
**3.** Add the following attribute to the main activity to enable the USB Host
31
38
```C#
@@ -45,10 +52,10 @@ This solution contains two projects.
45
52
**6.** Refer to [MainActivity.cs](https://github.com/anotherlab/UsbSerialForAndroid/blob/master/UsbSerialExampleApp/MainActivity.cs) in the example app to see how connect to a serial device and read data from it.
46
53
47
54
## Working with unrecognized devices
48
-
The UsbSerialForAndroid has been compiled with the Vendor ID/Product ID pairs for many common serial devices. If you have a device that is not defined by the library, but will work with one of the drivers, you can manually add the VID/PID pair.
55
+
The UsbSerialForAndroid has been compiled with the Vendor ID/Product ID pairs for many common serial devices. If you have a device that is not defined by the library, but will work with one of the drivers, you can manually add the VID/PID pair.
49
56
50
57
UsbSerialProber is a class to help you find and instantiate compatible
51
-
UsbSerialDrivers from the tree of connected UsbDevices. Normally, you will use
58
+
UsbSerialDrivers from the tree of connected UsbDevices. Normally, you will use
52
59
the default prober returned by ``UsbSerialProber.getDefaultProber()``, which
53
60
uses the built-in list of well-known VIDs and PIDs that are supported by our
54
61
drivers.
@@ -95,5 +102,4 @@ For other help and discussion, please join the usb-serial-for-android Google Gro
95
102
96
103
This library is licensed under LGPL Version 2.1. Please see LICENSE.txt for the complete license.
97
104
98
-
Copyright 2017, Tyler Technologies. All Rights Reserved. Portions of this library are based on the [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) and [XamarinUsbSerial](https://bitbucket.org/lusovu/xamarinusbserial) libraries. Their rights remain intact.
99
-
105
+
Copyright 2017, Tyler Technologies. All Rights Reserved. Portions of this library are based on the [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) and [XamarinUsbSerial](https://bitbucket.org/lusovu/xamarinusbserial) libraries. Their rights remain intact.
0 commit comments