# jSerialComm
_A platform-independent serial port access library for Java._
## Usage
For usage examples, please refer to the [Usage wiki](https://github.com/Fazecast/jSerialComm/wiki/Usage-Examples).
In order to use the ```jSerialComm``` library in your own project, you must simply
include the JAR file in your build path and import it like any other
Java package using ```import com.fazecast.jSerialComm.*;```.
Alternatively, you can automatically add ```jSerialComm``` to your project as a
dependency from the ```Maven Central Repository```. Use the following dependency
declaration depending on your build system:
* Maven:
```
<dependency>
<groupId>com.fazecast</groupId>
<artifactId>jSerialComm</artifactId>
<version>[2.0.0,3.0.0)</version>
</dependency>
```
* Ivy:
```
<dependency org="com.fazecast" name="jSerialComm" rev="[2.0.0,3.0.0)"/>
```
* Groovy:
```
@Grab(group='com.fazecast', module='jSerialComm', version='[2.0.0,3.0.0)')
```
* Gradle:
```
compile 'com.fazecast:jSerialComm:[2.0.0,3.0.0)'
```
* Gradle (.kts):
```
compile("com.fazecast:jSerialComm:[2.0.0,3.0.0)")
```
* Buildr:
```
compile.with 'com.fazecast:jSerialComm:jar:[2.0.0,3.0.0)'
```
* Scala/SBT:
```
libraryDependencies += "com.fazecast" % "jSerialComm" % "[2.0.0,3.0.0)"
```
* Leiningen:
```
[com.fazecast/jSerialComm "[2.0.0,3.0.0)"]
```
## Troubleshooting
If you are using Linux and this library does not appear to be working, ensure
that you have the correct permissions set to access the serial port on your system.
One way to test this is to run your application as root or by using the
```sudo``` command. If everything works, you will need to either run your
application as ```root``` in the future or fix the permissions on your system.
For further instructions, refer to the [Troubleshooting wiki](https://github.com/Fazecast/jSerialComm/wiki/Troubleshooting).
On some very few systems which use custom ARM-based CPUs and/or have extremely
restrictive permissions, the library may be unable to determine that the
underlying system architecture is ARM. In this case, you can force the
library to disable its auto-detect functionality and instead directly specify
the architecture using the Java ```os.arch_full``` system property. Acceptable
values for this property are currently one of: ``armv5``, ``armv6``,
``armv6-hf``, ``armv7``, ``armv7-hf``, ``armv8_32``, ``armv8_64``,
``x86``, or ``x86_64``.
An additional note for Linux users: If you are operating this library in
event-based mode, the ```LISTENING_EVENT_DATA_WRITTEN``` event will never occur.
This is not a bug, but rather a limitation of the Linux operating system.
For other troubleshooting issues, please see if you can find an answer in either
the [Usage-Examples wiki](https://github.com/Fazecast/jSerialComm/wiki/Usage-Examples)
or the [Troubleshooting Wiki](https://github.com/Fazecast/jSerialComm/wiki/Troubleshooting).
If your question is still not answered, feel free to open an issue report on
this project's [GitHub page](https://github.com/Fazecast/jSerialComm/issues),
and we will be glad to look into it.
## Building
Building this library yourself is not advised (at least not for distribution)
since it requires native compilation across multiple platforms. It is
recommended to simply use the pre-built ```jSerialComm``` library in your
application. For installation/usage instructions, please skip to the [usage](#usage) section.
If you do choose to build this library for your specific system, the recommended
methodology is to use [Gradle](https://gradle.org/) coupled with two
Java SDKs, [version 1.6](https://www.oracle.com/java/technologies/javase-java-archive-javase6-downloads.html)
and [version 9.0.4](https://www.oracle.com/java/technologies/javase/javase9-archive-downloads.html)
(for backward compatibility).
Once the Java SDKs have been installed, ensure that you have an environment
variable called ```JDK_HOME``` set to the base directory of your JDK 9.0.4
installation. Once this has been done, refer to the section corresponding to
your specific Operating System for further instructions.
Please note, if you would like to edit any of the source code or view it in an
IDE (such as Eclipse), you can automatically build the Eclipse project files by
entering the following on a command line or terminal from the base directory of
this project:
gradle eclipse
You can then Import the project using the "Existing Project into Workspace" import
tool in Eclipse. (Note that if you use Eclipse as an IDE, you will probably want
to install the Eclipse CDT plugin for proper handling of the C source code).
### Linux/UNIX
Ensure that the following tools are installed on your Linux distribution:
# On some distros, these may be called multilib tools for gcc and binutils
gcc make glibc-devel.x86_64 glibc-devel.i686
Ensure that the ```JDK_HOME``` environment variable has been set for the 9.0.4
version of your Java SDK. The correct directory can usually be found by entering
the following command:
readlink -f /usr/bin/java
Export the result of this command ***up to but not including*** the
```/jre/...``` portion using the ```export``` command. For example, if
```readlink``` produced ```/usr/lib/jvm/java-9.0.4/jre/bin/java``` as an output,
the export command would look like: ```export JDK_HOME=/usr/lib/jvm/java-9.0.4```
Run the following commands:
cd src/main/c/Posix
make linux
cd ../../../..
gradle build
The resulting ```jSerialComm``` library can be found in the project directory
```build/libs``` under the name ```jSerialComm-{VERSION}.jar```.
### Solaris
Ensure that you have a cross-compiler installed on your Linux distribution
capable of compiling for both x86 and Sparc-based Solaris architectures.
Instructions for creating such a toolchain can be found on the
[Solaris Cross-Compiler wiki](https://github.com/Fazecast/jSerialComm/wiki/Building-Solaris-Cross-Compilers).
Ensure that the ```JDK_HOME``` environment variable has been set for the 9.0.4
version of your Java SDK. The correct directory can usually be found by entering
the following command:
readlink -f /usr/bin/java
Export the result of this command ***up to but not including*** the
```/jre/...``` portion using the ```export``` command. For example, if
```readlink``` produced ```/usr/lib/jvm/java-9.0.4/jre/bin/java``` as an output,
the export command would look like: ```export JDK_HOME=/usr/lib/jvm/java-9.0.4```
Run the following commands:
cd src/main/c/Posix
make solaris
cd ../../../..
gradle build
The resulting ```jSerialComm``` library can be found in the project directory
```build/libs``` under the name ```jSerialComm-{VERSION}.jar```.
### ARM-Based Mobile Linux (non-Android)
Ensure that you have a cross-compiler installed on your Linux distribution
capable of compiling for ARM-based architectures. I prefer ```crosstool-ng```
for this purpose.
Ensure that the ```JDK_HOME``` environment variable has been set for the 9.0.4
version of your Java SDK. The correct directory can usually be found by entering
the following command:
readlink -f /usr/bin/java
Export the result of this command ***up to but not including*** the
```/jre/...``` portion using the ```export``` command. For example, if
```readlink``` produced ```/usr/lib/jvm/java-9.0.4/jre/bin/java``` as an output,
the export command would look like: ```export JDK_HOME=/usr/lib/jvm/java-9.0.4```
Run the following commands:
cd src/main/c/Posix
make arm
cd ../../../..
gradle build
The resulting ```jSerialComm``` library can be found in the project directory
```build/libs``` under the name ```jSerialComm-{VERSION}.jar```.
### Android
Ensure that the Android NDK is installed on your system. For purposes of these
instructions, assume that it is installed at ```{NDK_HOME}```.
Run the following commands in order:
cd src/main/c/Android
{NDK_HOME}/ndk-build
cd ../../../..
gradle build
The resulting
没有合适的资源?快使用搜索试试~ 我知道了~
jSerialComm:Java平台无关的串行端口访问
共67个文件
so:18个
java:12个
c:5个
需积分: 10 17 下载量 21 浏览量
2021-04-29
21:42:45
上传
评论 1
收藏 636KB ZIP 举报
温馨提示
jSerialComm Java的独立于平台的串行端口访问库。 用法 有关用法示例,请参阅“ 。 为了在您自己的项目中使用jSerialComm库,您只需在构建路径中包含JAR文件,然后像其他Java包一样使用import com.fazecast.jSerialComm.*;将其import com.fazecast.jSerialComm.*; 。 另外,您可以自动将jSerialComm作为Maven Central Repository的依赖项添加到项目Maven Central Repository 。 根据您的构建系统使用以下依赖项声明: Maven: <dependency> <groupId>com.fazecast</groupId> <artifactId>jSerialComm</artifactId> <version>[2.0.0,3.0.0
资源推荐
资源详情
资源评论
收起资源包目录
jSerialComm-master.zip (67个子文件)
jSerialComm-master
.gitignore 444B
build.gradle 3KB
src
moduleInfo
java
module-info.java 70B
main
resources
OSX
aarch64
libjSerialComm.jnilib 55KB
x86_64
libjSerialComm.jnilib 31KB
Android
AndroidManifest.xml 86B
arm64-v8a
libjSerialComm.so 109KB
x86
libjSerialComm.so 98KB
x86_64
libjSerialComm.so 104KB
armeabi-v7a
libjSerialComm.so 185KB
Solaris
sparcv8plus_32
libjSerialComm.so 19KB
sparcv9_64
libjSerialComm.so 22KB
x86
libjSerialComm.so 17KB
x86_64
libjSerialComm.so 21KB
Windows
x86
jSerialComm.dll 113KB
x86_64
jSerialComm.dll 133KB
Linux
armv6-hf
libjSerialComm.so 22KB
armv5
libjSerialComm.so 26KB
armv6
libjSerialComm.so 26KB
armv8_32
libjSerialComm.so 22KB
armv8_64
libjSerialComm.so 30KB
armv7
libjSerialComm.so 22KB
ppc64le
libjSerialComm.so 66KB
x86
libjSerialComm.so 25KB
armv7-hf
libjSerialComm.so 22KB
x86_64
libjSerialComm.so 26KB
c
Posix
jni
Android.mk 405B
Application.mk 69B
jSerialCommPPC64LE.config 19KB
Makefile 16KB
jSerialComm64.config 19KB
jSerialComm32.config 20KB
jSerialComm32HF.config 20KB
com_fazecast_jSerialComm_SerialPort.h 9KB
PosixHelperFunctions.h 3KB
PosixHelperFunctions.c 21KB
SerialPort_Posix.c 32KB
Windows
WindowsHelperFunctions.c 2KB
Makefile 3KB
WindowsHelperFunctions.h 1KB
ftdi
ftd2xx.h 39KB
SerialPort_Windows.c 41KB
java
com
fazecast
jSerialComm
SerialPortMessageListener.java 2KB
SerialPortInvalidPortException.java 3KB
SerialPortMessageListenerWithExceptions.java 2KB
SerialPortDataListener.java 3KB
SerialPortDataListenerWithExceptions.java 2KB
SerialPort.java 70KB
SerialPortPacketListener.java 2KB
SerialPortIOException.java 3KB
SerialPortTimeoutException.java 2KB
SerialPortEvent.java 5KB
test
c
testOpenClose.c 13KB
java
com
fazecast
jSerialComm
SerialPortTest.java 11KB
gradlew 6KB
AUTHORS.md 859B
.github
workflows
update_gradle_wrapper.yml 370B
COPYING 34KB
README.md 9KB
gradlew.bat 3KB
LICENSE-APACHE-2.0 11KB
NOTICE 731B
gradle
wrapper
gradle-wrapper.properties 287B
gradle-wrapper.jar 58KB
COPYING.LESSER 7KB
LICENSE-LGPL-3.0 7KB
.gitattributes 13B
共 67 条
- 1
资源评论
泰国旅行
- 粉丝: 31
- 资源: 4773
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 筷手引流工具.apk
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功