Skip to content
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

数据读取不全应该怎么解决 #51

Closed
luhuanxml opened this issue Jun 12, 2024 · 5 comments
Closed

数据读取不全应该怎么解决 #51

luhuanxml opened this issue Jun 12, 2024 · 5 comments

Comments

@luhuanxml
Copy link

luhuanxml commented Jun 12, 2024

image

版本2.1.1

@xmaihh
Copy link
Owner

xmaihh commented Jun 12, 2024

当串口数据接收分段时,需要对接收到的数据进行重组,将属于同一数据帧(或数据包)的分段数据组装起来,以恢复出完整的数据帧。

@luhuanxml
Copy link
Author

image
如何重组可以指导一下吗,第一次用。不是很懂原理。只是每次读取的时候偶尔会分段返回,一次不返回完全,要等下一次卡片贴上去的时候才返回,我的send间隔时间500ms

@xmaihh
Copy link
Owner

xmaihh commented Jun 12, 2024

你的工程大致工作流程是通过Uart串口连接NFC模块,实现NFC设备间数据传输的对吗

你可以将NFC模块连接到电脑,打开串口调试助手,测试是否存在数据读取不全的问题

@luhuanxml
Copy link
Author

luhuanxml commented Jun 12, 2024

的确是模拟nfc功能,设备厂商提供了命令码。您说的意思是还是我的模块有可能有问题是吧,我下载了一些其他的测试软件,在显示16进制的时候没有出现卡号分割的问题。

@xmaihh
Copy link
Owner

xmaihh commented Jun 12, 2024

你需要参考这部分实现处理一下数据读取,粘包处理

@xmaihh xmaihh closed this as completed Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants