licheedev / Android-SerialPort-API

Fork自Google开源的Android串口通信Demo,修改成Android Studio项目
https://code.google.com/archive/p/android-serialport-api/
Apache License 2.0
1.3k stars 374 forks source link

请问一下,同时读取多个串口,该如何操作 #17

Closed onebee closed 3 years ago

onebee commented 4 years ago

请问一下,同时读取多个串口,该如何操作

tydqcjj commented 4 years ago

多个串口就是多个InputStream,你想怎么读都行

daochushilang commented 4 years ago

请问一下同时打开两个串口,应该怎么区分数据,现在有数据混乱的现象,还有,如果我想要两个串口同时读取和接收数据,这部分代码应该怎么写呀?提问兄弟,你弄出来没?

licheedev commented 4 years ago

@daochushilang 每个串口都开独立的读写线程。可以参考一下这个 https://github.com/licheedev/SerialWorker

daochushilang commented 4 years ago

好的,谢谢,我看看,这部分,我找了好久,都不知道要怎么解决,好难呀

------------------ 原始邮件 ------------------ 发件人: "John Lee"<notifications@github.com>; 发送时间: 2019年11月30日(星期六) 上午10:24 收件人: "licheedev/Android-SerialPort-API"<Android-SerialPort-API@noreply.github.com>; 抄送: "到处是狼"<371718330@qq.com>; "Mention"<mention@noreply.github.com>; 主题: Re: [licheedev/Android-SerialPort-API] 请问一下,同时读取多个串口,该如何操作 (#17)

@daochushilang 每个串口都开独立的读写线程。可以参考一下这个 https://github.com/licheedev/SerialWorker

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

master5277 commented 8 months ago

@daochushilang 请问您最后解决两个串口同时读取和接收数据的问题了吗?如果解决了,可以分享一下您的代码或者开发思路吗?