-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
发送命令时,可能会造成空指针异常 #1
Comments
大兄弟,这个问题你是怎么解决的?我也会遇到这个问题,偶尔会报空 |
简单的先try catch 掉 |
你好, 我也遇到了同样的问题,请问是要try catch 修改源码吗 在 SphDataProcess 中改吗 ? |
不好意思很久 没有登录邮箱了 是的 在报错的那里try catch 掉 ,不过后续我已经换掉这个框架了,因为遇到过发送命令下位机无返回数据的情况,应该是由于这套框架引起的
在 2021-04-08 18:08:26,"小张哥" ***@***.***> 写道:
你好, 我也遇到了同样的问题,请问是要try catch 修改源码吗 在 SphDataProcess 中改吗 ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
新的框架在哪? |
你好 ,这是我现在用的库,目前没有发现问题,自己写的首发线程,这个库只是通过c层增加了停止位等设置
https://github.com/licheedev/Android-SerialPort-API
你这个问题 不太好说 也有可能是调用此方法的数据有问题导致的 ,
在 2021-05-31 10:44:57,"ChloeDimen" ***@***.***> 写道:
我这边下位机也是无数据返回的,但是我这边发一次数据,会多次Byte[15]或byte[16]的数据
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
SphDataProcess 这个类的writeData()方法
if (concurrentCom.getCurrentCmdEntity() == null) {
}
这里if判断 偶尔会造成空指针异常
The text was updated successfully, but these errors were encountered: