Skip to content

低波特率下解码UTF-8错误 #166

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

Open
XuanTongYao opened this issue Dec 31, 2024 · 1 comment
Open

低波特率下解码UTF-8错误 #166

XuanTongYao opened this issue Dec 31, 2024 · 1 comment
Labels

Comments

@XuanTongYao
Copy link

在低波特率(例如2400Hz)的情况下解码多字节编码文本,比如UTF-8会发生错误

image
image

图中选中部分的16进制数据解码的文本应该为下载:0x56,启动:0xF1\n

逻辑分析仪采样数据显示时序都是正常的
image

我个人猜测你们使用了asyncio.sleep()或者定时器之类的东西把字节流切片后再解码,然后切片的时序出错导致解码出现错误。

@Neutree Neutree added the bug label Jan 1, 2025
@Neutree
Copy link
Owner

Neutree commented Jan 1, 2025

可能是这里

if buffer and (time.time() - t > self.oneByteTime * 2): # no new data in next frame
try:
self.onReceived(buffer)
maybe,没用过这么低的波特率过

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants