AndroidSerialPort
                                
                                 AndroidSerialPort copied to clipboard
                                
                                    AndroidSerialPort copied to clipboard
                            
                            
                            
                        无法接受串口返回数据
用电脑连接串口可以,串口初始化也ok了,可以发送但无法接收
您好 串口问题请教 加一下好友吧 qq 841020929 或微信 1973328389 谢谢 遇到同样问题 发送但接收不到数据
用电脑连接串口可以,串口初始化也ok了,可以发送但无法接收
您好 串口问题请教 加一下好友吧 qq 841020929 或微信 1973328389 谢谢 遇到同样问题 发送但接收不到数据
@AndyAls 您好,返回数据接收不到解决了吗?我也遇到了相同的问题。
@gxh-apologize @zhaobinsir @AndyAls 你好,请问解决了吗
我也遇到相同的问题,发送成功,但是接收失败
哇,我解決了,这个问题,是我的代码错误,我在发送了数据后,就把串口关闭了,我要为我的错误反思:下面是我的代码,希望大家不要犯相同的错误 ``` String inputCommand = editText.getText().toString().trim(); if (openSerialPort && !TextUtils.isEmpty(inputCommand)) { boolean sendBytes = mSerialPortManager.sendBytes(hexToByteArray(inputCommand)); Log.d(TAG, "initViews: ----发送:" + (sendBytes ? "成功" : "失败")); Toast.makeText(this, "发送" + (sendBytes ? "成功" : "失败"), Toast.LENGTH_SHORT).show(); //我原来并没有把这行代码注释掉,注释掉就能接收到数据了 // mSerialPortManager.closeSerialPort(); } else { Toast.makeText(this, "串口连接错误或者命令为空", Toast.LENGTH_SHORT).show(); }