Comments (5)
为避免消耗电池电量,处于空闲状态的 Android 设备会快速进入休眠模式。
需要长时间保持串口连接状态可以考虑:1.使屏幕保持开启状态 2.使 CPU 保持运行状态 。
from android-serialport.
如您提供的这些信息,无法回答,这需要您自己排查是软件的问题还是硬件问题
from android-serialport.
from android-serialport.
造成串口死机的原因:
1、代码问题
2、硬件问题
from android-serialport.
确实存在这种长时间保持串口连接状态会出故障的BUG。
1.在线程中开启串口open
2.在同线程中保持一个死循环,每1500毫秒间隔 轮询一个 指令池队列,有指令就发送串口指令,没有就无动作继续轮询;
3.刚启动这个线程的时候,能稳定按队列的指令逐条执行,但是一但串口open时间过长,就只能执行一次指令,并且得不到正确的串口反馈信息(回调)。
from android-serialport.
Related Issues (20)
- Open串口成功,可以发送数据,但接受不到数据 HOT 1
- 你好我想问一下,咱们这个支持 ModBus通讯协议,RTU模式 吗? HOT 1
- 运行demo,从demo发送数据正常,但是接收不到从pc发送的数据 HOT 11
- 能打开串口,但是接收不到消息! HOT 4
- 粘包处理求助 HOT 7
- 安卓设备发送大数据问题求助 HOT 1
- 在连接状态,拔了usb 串口,日志一直警告的报错,能监听usb串口连接状态吗 HOT 1
- ANR in com.ex.serialport (com.ex.serialport/.MainActivity) 点击了两次开启报ANR异常 HOT 1
- 串口发送正常,但接收数据单次超过9个数字类型长度app就会卡死。 HOT 6
- 我遇到了丢数据的问题 HOT 1
- 在Android 10.0版本上报错:Cannot run program "/system/bin/su": error=2, No such file or directory HOT 3
- Class 'FileDescriptor' has no field named 'descriptor'. HOT 2
- file not found and Use of undeclared identifier 'ioctl' HOT 3
- 多串口同时接收和发送数据怎样做? HOT 2
- java.lang.NullPointerException: println needs a message at android.util.Log.println_native(Native Method) at android.util.Log.e(Log.java:236) at tp.xmaihh.serialport.SerialHelper$ReadThread.run(SerialHelper.java:114) HOT 8
- 串口发送正常,但接收数据单次超过9个数字类型长度app就会卡死
- 串口发送成功了,硬件已响应,但是程序不会收到结果(如果用其他串口软件开启一下串口后,用此项目就能显示到接收的结果) HOT 2
- serialHelper.close() HOT 1
- 如果我要读取卡片ID应该怎么做。 HOT 2
- 数据读取不全应该怎么解决 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-serialport.