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
Copy file name to clipboardExpand all lines: README.md
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ This is a driver library to allow your Microsoft Android app to communicate with
4
4
available on Android 3.1+.
5
5
6
6
No root access, ADK, or special kernel drivers are required; all drivers are implemented in
7
-
c#. You get a raw serial port with `Read()`, `Write()`, and other basic
7
+
C#. You get a raw serial port with `Read()`, `Write()`, and other basic
8
8
functions for use with your own protocols. The appropriate driver is picked based on the device's Vendor ID and Product ID.
9
9
10
-
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#.
10
+
This is a 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#.
11
11
12
-
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 C# code was used, the Java library is not referenced.
12
+
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 C# code was used, the Java library is not referenced.
13
13
14
14
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
15
15
@@ -21,6 +21,11 @@ git remote set-head origin -a
21
21
```
22
22
This library supports .NET 10 and Microsoft Android. Support for Xamarin Android and previous versions of .NET have been dropped. Sample application has been replaced with a new app demo. If you need the old demo or want to support older versions of .NET, please use [verson 1.1.1](https://github.com/anotherlab/UsbSerialForAndroid/releases/tag/v1.1.1).
23
23
24
+
## Breaking changes
25
+
I'm cleaning up the code in order to publish this as a nuget package. Someone created a nuget package based on a two year old version of this code base and published to nuget under their own name (and without credit to the original authors). I changed the root namespace from `Hoho.Android.UsbSerial` to `Anotherlab.UsbSerialForAndroid` to make it easier to find on nuget.
26
+
27
+
The "Hoho" namespace came from original Java library package name, [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android), and while I based this code from that library, they are separate.
28
+
24
29
## Structure
25
30
26
31
This solution contains two projects and a slnx solution file.
@@ -34,7 +39,7 @@ The original demo and the .sln format solution file are deprecated and will be r
34
39
## Getting Started
35
40
**1.** Reference the library to your project
36
41
37
-
**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
42
+
**2.** Copy the [device_filter.axml](https://github.com/anotherlab/UsbSerialForAndroid/blob/main/UsbSerialForAndroidDemo/Resources/xml/device_filter.xml) from the example app to your Resources/xml folder. Make sure that the Build Action is set to AndroidResource
38
43
39
44
**3.** Add the following attribute to the main activity to enable the USB Host
40
45
```C#
@@ -51,16 +56,12 @@ The original demo and the .sln format solution file are deprecated and will be r
**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.
59
+
**6.** Refer to [MainActivity.cs](https://github.com/anotherlab/UsbSerialForAndroid/blob/main/UsbSerialForAndroidDemo/MainActivity.cs) in the example app to see how connect to a serial device and read data from it.
55
60
56
61
## Working with unrecognized devices
57
62
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. If you have a device that is not in the GetSupportedDevices() method for that driver, you can submit a pull request that adds the vendor and product IDs to that driver.
58
63
59
-
UsbSerialProber is a class to help you find and instantiate compatible
60
-
UsbSerialDrivers from the tree of connected UsbDevices. Normally, you will use
61
-
the default prober returned by ``UsbSerialProber.getDefaultProber()``, which
62
-
uses the built-in list of well-known VIDs and PIDs that are supported by our
63
-
drivers.
64
+
UsbSerialProber is a class to help you find and instantiate compatible UsbSerialDrivers from the tree of connected UsbDevices. Normally, you will use the default prober returned by ``UsbSerialProber.getDefaultProber()``, which uses the built-in list of well-known VIDs and PIDs that are supported by our drivers.
64
65
65
66
To use your own set of rules, create and use a custom prober:
66
67
@@ -89,7 +90,7 @@ Of course, nothing requires you to use UsbSerialProber at all: you can instantia
89
90
90
91
## Additional information
91
92
92
-
This is a port of the usb-serial-for-android library and code examples written for it can be adapted to C# without much effort.
93
+
This is a port of the [usb-serial-for-android](https://github.com/mik3y/usb-serial-for-android) library and code examples written for it can be adapted to C# without much effort.
@@ -98,14 +99,14 @@ wiki page for usb-serial-for-android library. For other help and discussion, ple
98
99
99
100
Pull Requests are welcome, but please include what hardware was used for testing. We do not have the hardware or the bandwidth to test the various chipsets supported by the library.
100
101
101
-
We will do our best to repond to reported issues. If you have a code fix or suggestion, we are only looking at changes submitted as pull requests.
102
+
We will do our best to respond to reported issues. If you have a code fix or suggestion, we are only looking at changes submitted as pull requests.
102
103
103
-
For more information about contributing or reporting an issue, please see [](https://github.com/anotherlab/UsbSerialForAndroid/blob/main/CONTRIBUTING.md) for more information for what we are looking for and how to get started.
104
+
For more information about contributing or reporting an issue, please see [CONTRIBUTING.md](https://github.com/anotherlab/UsbSerialForAndroid/blob/main/CONTRIBUTING.md) for more information for what we are looking for and how to get started.
104
105
105
106
## Author, License, and Copyright
106
107
107
108
This library is licensed under the MIT License. Please see [LICENSE.txt](https://github.com/anotherlab/UsbSerialForAndroid/blob/main/LICENSE.txt) for the complete license.
108
109
109
110
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.
110
111
111
-
The icon used for the demo app was derived from [Serial to USB by Bonegolem](https://thenounproject.com/browse/icons/term/serial-to-usb/)from <a href="https://thenounproject.com/browse/icons/term/serial-to-usb/" (CC BY 3.0)
112
+
The icon used for the demo app was derived from [Serial to USB by Bonegolem](https://thenounproject.com/browse/icons/term/serial-to-usb/) (CC BY 3.0)
0 commit comments