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

第一包的时候接收ACK+C有问题。 #3

Open
xianyo opened this issue May 3, 2024 · 1 comment
Open

第一包的时候接收ACK+C有问题。 #3

xianyo opened this issue May 3, 2024 · 1 comment

Comments

@xianyo
Copy link

xianyo commented May 3, 2024

private void handleFileName(byte[] value) {
if (value.length == 2 && value[0] == ACK && value[1] == ST_C) {//Receive 'ACK C' for file name
Lg.f("Received 'ACK C'");
packageErrorTimes = 0;
startSendFileData();
} else if (value[0] == ST_C) {//Receive 'C' for file name, this package should be resent
Lg.f("Received 'C'");
handlePackageFail("Received 'C' without 'ACK' after sent file name");
} else {
handleOthers(value[0]);
}
}

蓝牙接收数据不确定性,可能断断续续的。当接收的 byte 分开来送入库,此时就认不出了。
这里只能是 ACK C在一个数组,2个字节一起送入才能识别出来!

@ArdWang
Copy link
Owner

ArdWang commented Jun 15, 2024

好的,最近在忙mqtt都没有想起来这个库了😄

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