Files
Marcus Handte 4375bdd5fe
SmartBotKit/serial/master This commit looks good
Version 1.0.1
2019-05-23 15:21:09 +02:00

102 lines
3.6 KiB
Markdown

# SmartBotKit Serial Communication Library
A simple (wrapper) library to support the interaction between devices over a serial port.
## Structure
The **serial-core** of the library is a very thin interface to configure and access a serial
connection with the usual settings, i.e. baud rate, data bits, stop bits, parity and flow
control. In addition, the library contains the following extensions:
- **serial-rxtx**: a wrapper around the [rxtx](http://rxtx.qbang.org) library which provides support for
traditional desktop systems including Windows, Linux and MacOS. A set of prebuilt binaries
with installation instructions for for 64-bit operating systems can be found
[here](http://fizzed.com/oss/rxtx-for-java).
- **serial-android**: an implementation of different USB serial drivers for devices running Android
that is based mostly on [UsbSerial](https://github.com/felHR85/UsbSerial). Note that in order to
load the correct driver, you need to know the association between hardware id and driver class as
explained in the [USB Guide](https://developer.android.com/guide/topics/connectivity/usb/host).
- **serial-test**: an implementation of a serial port that will generate a known byte sequence for
testing.
## Versions
- Latest development version: **1.0.2-SNAPSHOT**
- Latest production version: **1.0.1**
## Usage
To use the library, include the NES Maven repository in your build. The URLs are
[https://project.nes.uni-due.de/artifactory/snapshots](https://project.nes.uni-due.de/artifactory/snapshots)
and [https://project.nes.uni-due.de/artifactory/releases](https://project.nes.uni-due.de/artifactory/releases)
for the snapshot and release repository. The username is **public** and the password is also **public**.
### Maven
To include the repository in a Maven build, simply add the corresponding username and password via server entries
to your settings.xml.
```
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
...
<servers>
<server>
<id>snapshots.project.nes.uni-due.de</id>
<username>public</username>
<password>public</password>
</server>
<server>
<id>releases.project.nes.uni-due.de</id>
<username>public</username>
<password>public</password>
</server>
</servers>
...
</settings>
```
Then point Maven to the correct repository by including the servers as repositories in you project's pom.xml.
```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
...
<repositories>
<repository>
<id>snapshots.project.nes.uni-due.de</id>
<url>https://project.nes.uni-due.de/snapshots</url>
</repository>
<repository>
<id>releases.project.nes.uni-due.de</id>
<url>https://project.nes.uni-due.de/releases</url>
</repository>
</repositories>
...
</project>
```
### Gradle
To include the repository in a Gradle project, add the configuration using the Maven closure to the repositories section of your build.gradle:
```
repositories {
...
maven {
url "https://project.nes.uni-due.de/artifactory/snapshots"
credentials {
username = 'public'
password = 'public'
}
}
maven {
url "https://project.nes.uni-due.de/artifactory/releases"
credentials {
username = 'public'
password = 'public'
}
}
}
```