修复包序号错误的bug

This commit is contained in:
CSSC-WORK\murmur 2023-11-05 10:24:33 +08:00
parent d6edb25d2d
commit 20605db7f8

View File

@ -199,10 +199,10 @@ void upSend_thread_entry(void* parameter)
cfg.fallpiece[0] = msg->len/PACK_SIZE+1;
#ifdef CRYPT_BEFRE_PACK
//crypt before pack
//更改后3S单帧数据由160升为240超出TT最大单包数据容量须分包
//更改后3S单帧数据升为200+超出TT最大单包数据容量须分包
for (size_t var = 0; var < msg->len; var=var+PACK_SIZE) {
cfg.fcurpiece[0] = var+1;
cfg.fcurpiece[0] = var/PACK_SIZE+1;
uint8_t tmp[200];
uint8_t len = cryptSingleMsg(msg->data+var, (msg->len-var)>PACK_SIZE?PACK_SIZE:(msg->len-var), tmp);
@ -221,6 +221,7 @@ void upSend_thread_entry(void* parameter)
{
LOG_E("send error, try to cache %d bytes data to file.",msg->len);
cacheDataToFile(msg->data, msg->len);
break;
}
}
}