-
+ Welcome to GitHub Pages.+ + What is jSerialComm?
jSerialComm is a Java library designed to provide a platform-independent way to access standard serial ports without requiring external libraries, native code, or any other tools. It is meant as an alternative to RxTx and the (deprecated) Java Communications API, with increased ease-of-use and an enhanced support for timeouts.
+ +Some of the features of this library include:
+ +-
+
- Platform-independent library deployment (automatically uses correct native library based on current architecture) +
- Very lightweight and efficient implementation +
- Enumerates all available serial ports on a machine +
- Returns both a system port description and a friendly device description +
- Configurable ports according to baud rate, data bits, stop bits, and parity +
- Configurable port timeouts (blocking and non-blocking) for both reading and writing +
- Configurable flow control parameters for the serial port (CTS, RTS/CTS, DSR, DTR/DSR, XOn/XOff) +
- Ability to read and write raw data bytes directly to the serial port +
- Ability to read and write byte streams via Java's InputStream and OutputStream interfaces +
- Event-based reading and writing via callbacks +
- Callback notification when: +
- New data is available for reading +
- All data has been successfully written +
- A complete fixed-length data packet has arrived +
-
+
Additionally, this library can be used in any Java project intended for use on the following platforms:
+ +-
+
- 32/64-bit Windows XP or later +
- 32/64-bit Mac OS X Tiger (10.4) or later +
- 32/64-bit Linux distributions +
- 32/64-bit Mobile Linux derivatives (e.g. Android) +
+ + How can use this library in my own project?
One of the most convenient features of this library is that it allows you to simply include the JAR file in your custom project, and it will automatically select and load the correct native library for your platform and architecture. As such, you can make use of this library by simply copying the jSerialComm.jar file into your project directory and linking to it as you would any other JAR file.
+ +To access the contents of the library in your project, make sure to import com.fazecast.jSerialComm.*
into your java files. You can then generate a list of all available serial ports on your system (real or virtual), by calling the following static method:
SerialPort.getCommPorts()
+
+ This will return an array of SerialPort objects through which you can iterate. See the Javadoc Library Reference for a complete overview of this library and its methods.
+ +Note for Linux users: Serial port access is limited to certain users and groups in Linux. To enable user access, you must open a terminal and enter the following commands before jSerialComm will be able to access the ports on your system. (Note, this must only be done once for each user):
+ +sudo usermod -a -G uucp username
sudo usermod -a -G dialout username
+
+ Replace the username parameter with your current username. (If you are not sure what your username is, type whoami
and it will tell you.) If you are using SUSE 11.3 or higher, replace the '-a -G' flags with a single '-A' flag. Log out and you should have access to the serial port after logging back in.
Additionally, if you are using an automated build system (such as Maven), you can import this library directly into your project as a dependency from the Maven Central Repository instead of copying the .jar file manually. Use one of the following dependency declarations depending on the build system you are using:
+ +<dependency>
<groupId>com.fazecast.jSerialComm</groupId>
<artifactId>jSerialComm</artifactId>
<version>1.0.0</version>
</dependency>
+ <dependency org="com.fazecast.jSerialComm" name="jSerialComm" rev="1.0.0"/>
+ @Grapes(
@Grab(group='com.fazecast.jSerialComm', module='jSerialComm', version='1.0.0')
)
+ 'com.fazecast.jSerialComm:jSerialComm:1.0.0'
+ 'com.fazecast.jSerialComm:jSerialComm:jar:1.0.0'
+ libraryDependencies += "com.fazecast.jSerialComm" % "jSerialComm" % "1.0.0"
+ [com.fazecast.jSerialComm/jSerialComm "1.0.0"]
+ + + Are there any usage examples?
Although this library was designed to be as simple and flexible as possible, you can enable a number of different modes of operation via manipulation of the serial port timeout values and the interface through which you choose to access the serial port.
+ +For a description of the various modes of operation available in this library, please refer to the Modes of Operation wiki article. For code-based examples of how to use this library in your own project, we provide a Usage Examples wiki.
+ +Finally, you can view the API Documentation for further information on how to use this library.
+ ++ + Authors and Contributors
This library was created and developed by Will Hedgecock (@willhedgecock) of Fazecast, Inc. (@fazecast)
+ +Support or Contact
+ +Having trouble with this library? Check out the documentation or open an issue report and we’ll help you sort it out.
-This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown, select a template crafted by a designer, and publish. After your page is generated, you can check out the new branch:
- -$ cd your_repo_root/repo_name
-$ git fetch origin
-$ git checkout gh-pages
-
-
-If you're using the GitHub for Mac, simply sync your repository and you'll see the new branch.
- --
- - Designer TemplatesWe've crafted some handsome templates for you to use. Go ahead and continue to layouts to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved if it remained markdown format.
- --
- - Rather Drive Stick?If you prefer to not use the automatic generator, push a branch named gh-pages
to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator written by our own Tom Preston-Werner. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.
-
- - Authors and ContributorsYou can @mention a GitHub username to generate a link to their profile. The resulting <a>
element will link to the contributor's GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.
-
- - Support or ContactHaving trouble with Pages? Check out the documentation at https://help.github.com/pages or contact support@github.com and we’ll help you sort it out.