xmaihh / Android-Serialport

移植谷歌官方串口库,仅支持串口名称及波特率,该项目添加支持校验位、数据位、停止位、流控配置项

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom baud rate support

Nntsyeo opened this issue · comments

A word of thanks for this project, I've been able to perform UART communication via my Android app. Just one issue, however, is that I need it to work at 128000 baud rate. As of now, I could only make it work at either 115200 or 230400.

Are there any ways to enable it at 128000?

I'm glad to hear that you found the project helpful for UART communication in your Android app!

In theory, Android apps can support UART communication at 128000 baud or higher depending on the hardware. The microcontroller or other device on the other end would also need to support this speed.

In practice, higher baud rates may be unreliable or limited by the specific chipset being used. Lower baud rates like 115200 or 38400 are more commonly used.

To implement custom speed UART in an Android app, you would need to interact with the UART interface of the device. This is typically done using the Android NDK and native code rather than pure Java.

I will proceed to create a branch that supports custom baud rates. However, please note that I cannot guarantee its functionality. Alternatively, you can download the source code and make modifications yourself.

If you need further assistance during your experimentation or have any more questions along the way, please don't hesitate to ask. Good luck with your project!