diff --git a/applications/func/func.c b/applications/func/func.c index 8faba88..c78edde 100644 --- a/applications/func/func.c +++ b/applications/func/func.c @@ -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; } } }