All Projects → GeekBugs → Android-SerialPort

GeekBugs / Android-SerialPort

Licence: Apache-2.0 License
『Android Lib』 Android 平台上的 usb 串口调试库,支持串口号、波特率、数据位、校验位、停止位、流控等参数设置,能够控制数据的收发

Programming Languages

java
68154 projects - #9 most used programming language
c
50402 projects - #5 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to Android-SerialPort

SerialPundit
Serial port communication in Java - FTDI D2XX, HID API, X/Y modem
Stars: ✭ 116 (-50.85%)
Mutual labels:  serialport, serial-port
serialport
PHP Serial Port
Stars: ✭ 42 (-82.2%)
Mutual labels:  serialport
ble-serial
"RFCOMM for BLE" a UART over Bluetooth low energy (4.0+) bridge for Linux, Mac and Windows
Stars: ✭ 134 (-43.22%)
Mutual labels:  serialport
SerialTest
Serial port test tool on Win/Linux/Android, with realtime plotting, shortcut | 跨平台串口助手,带实时绘图和快捷发送面板
Stars: ✭ 98 (-58.47%)
Mutual labels:  serialport
usbSerialPortTools
provide read and write debugging tools between USB serial port and serial port (UART ,RS232) under Android system
Stars: ✭ 38 (-83.9%)
Mutual labels:  serial-port
MonoSerialPort
Serial port library for .Net / Mono, that can be used with virtual usb port
Stars: ✭ 42 (-82.2%)
Mutual labels:  serial-port
libcssl
Columbo Simple Serial Library is an easy to use, event driven serial port communication library for Linux.
Stars: ✭ 38 (-83.9%)
Mutual labels:  serialport
BaseIotUtils
🔥🔥串口工具,屏幕适配,通知工具类,多文件断点下载,xls,xlsx操作,文件处理,crash控制,音视频播放,usb设备检测,adb工具等...
Stars: ✭ 44 (-81.36%)
Mutual labels:  serialport
pySerialTransfer
Python package to transfer data in a fast, reliable, and packetized form
Stars: ✭ 78 (-66.95%)
Mutual labels:  serialport
etherport-client
Client-side virtual serial port for Etherport. Used to implement firmata-compatible boards and relays.
Stars: ✭ 20 (-91.53%)
Mutual labels:  serialport
SerialPortYmodem
串口通过 YMODEM 协议进行文件传输
Stars: ✭ 132 (-44.07%)
Mutual labels:  serial-port
DrawingBotV3
DrawingBotV3 is a software for creating line drawings from Images
Stars: ✭ 161 (-31.78%)
Mutual labels:  serial-port
consrv
Command consrv is a SSH to serial console bridge server, originally designed for deployment on gokrazy.org devices. Apache 2.0 Licensed.
Stars: ✭ 76 (-67.8%)
Mutual labels:  serial-port
bifrost
🌈 burning rainbow bridge between your terminal and serial ports
Stars: ✭ 70 (-70.34%)
Mutual labels:  serial-port
serialPort
Android通用的串口通信库
Stars: ✭ 39 (-83.47%)
Mutual labels:  serialport
serial2mqtt
Serial to MQTT adapter serivce
Stars: ✭ 21 (-91.1%)
Mutual labels:  serialport
netty-transport-purejavacomm
A netty serial pipeline using JNA and PureJavaComm
Stars: ✭ 30 (-87.29%)
Mutual labels:  serialport
PInvokeSerialPort
P/Invoke wrapper for Win32API serial port
Stars: ✭ 30 (-87.29%)
Mutual labels:  serialport
SerialPortHelper
一个低成本,能快速接入的串口通讯工具,支持处理并发,适配三种协议,同时支持监听多种不同报文头,适用于口红机、快递柜(格子柜),售货机、售餐机、咖啡机、游戏机等串口设备
Stars: ✭ 62 (-73.73%)
Mutual labels:  serialport
libserialport.dart
Serial Port for Dart
Stars: ✭ 51 (-78.39%)
Mutual labels:  serialport

Android-SerialPort

此项目移植于谷歌官方串口库android-serialport-api,但该项目仅支持串口名称及波特率,所以在项目的基础上添加支持数据位、数据位、停止位、流控等配置。

License

下载

Get it on Google Play

酷安:https://www.coolapk.com/apk/251882

引入

Step 1. Add the JitPack repository to your build file

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Step 2. Add the dependency

dependencies {
        implementation 'com.github.F1ReKing:Android-SerialPort:1.5.1'
}

使用

1. 查询串口列表

SerialPortHelper#getAllDevices();
// 查询串口设备地址列表
SerialPortHelper#getAllDeicesPath();

2. 配置串口参数

SerialPortHelper#Builder(String port, int baudRate).build(); //支持配置串口号,波特率(默认值115200)
setStopBits(int stopBits); // 支持设置停止位 默认值为2
setDataBits(int dataBits); // 支持设置数据位 默认值为8
setParity(int parity); // 支持设置检验位 默认值为0
setFlowCon(int flowCon); // 支持设置流控 默认值为0
setFlags(int flags); // 支持设置标志 默认值为0,O_RDWR  读写方式打开

3. 打开串口

SerialPortHelper#open();

4. 关闭串口

SerialPortHelper#close();

4. 发送数据

SerialPortHelper#sendBytes(byte[] bytes); // 支持发送byte[]
SerialPortHelper#sendHex(String hex); // 支持发送Hex
SerialPortHelper#sendTxt(String txt); // 支持发送ASCII码

5. 接收数据

public interface ISerialPortDataListener {
	// 接收数据回调
    void onDataReceived(byte[] bytes);
   	// 发送数据回调
    void onDataSend(byte[] bytes);
}

6. 回调

//  串口打开状态监听
void setIOpenSerialPortListener(IOpenSerialPortListener IOpenSerialPortListener);

// 串口消息监听
void setISerialPortDataListener(ISerialPortDataListener ISerialPortDataListener);

版本更新记录

1.1

  • 优化api
  • 支持设置可选参数,并配置默认值

1.0

  • 基础功能、支持设置串口号、波特率、数据位、校验位、停止位、流控等配置
  • 支持发送、接收数据

License

Copyright 2019 F1ReKing. 

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Stargazers over time

Stargazers over time

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].