From e8ee09d9764d7c8b8b5eab99de7a433ac65d20a2 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Fri, 8 Nov 2024 17:19:52 +0800 Subject: [PATCH] fix wave save bugs --- uart/uart.hpp | 11 +++++------ uart/uart_feature_parse.cpp | 3 +-- uart/uart_parameter_config.cpp | 3 ++- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/uart/uart.hpp b/uart/uart.hpp index 439115c..6ef4748 100644 --- a/uart/uart.hpp +++ b/uart/uart.hpp @@ -34,12 +34,11 @@ enum InteractiveCommand { typedef enum { kUpgradeSuccess = 0, // 成功 - kUpgradeIndexError = 1, //包接收序号错误,要重试 - kProductTypeMismatch = 2, // 包有问题,不再重试 - kZigbeeHWMismatch = 3, // 包有问题,不再重试 - kTransmitFileCrcError = 4, // 此返回值时,要重试 - kRecvDataLenError = 5, // 此返回值时,要重试 - kUpgradeDoneBefore = 6 // 当前就是这个版本,不需要升级了 + kProductTypeMismatch = 1, // 包有问题,不再重试 + kZigbeeHWMismatch = 2, // 包有问题,不再重试 + kTransmitFileCrcError = 3, // 此返回值时,要重试 + kRecvDataLenError = 4, // 此返回值时,要重试 + kUpgradeDoneBefore = 5 // 当前就是这个版本,不需要升级了 } FirmFileCheckResult; // 无线传感器请求任务 typedef struct { diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index ea2f418..1ebd3b2 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -1081,8 +1081,7 @@ void Uart::WriteDatFile(int sampleRate, std::string &strMeasurementID, int iChan id = id + strlen(buf); strncpy(mqttData + id,",",1); id = id + 1; - } - else{ + }else{ strncpy(mqttData + id ,buf,strlen(buf)); } } diff --git a/uart/uart_parameter_config.cpp b/uart/uart_parameter_config.cpp index 1ffb29a..73dd203 100644 --- a/uart/uart_parameter_config.cpp +++ b/uart/uart_parameter_config.cpp @@ -8,6 +8,7 @@ #include #include #include "common/common_func.hpp" +#include "minilzo/minilzo.h" extern zlog_category_t* zct; extern zlog_category_t* zbt; @@ -83,7 +84,7 @@ bool Uart::ReadUpdatePackge(unsigned short shortAdd) { fread(buffer, sizeof(char), thisSize, pFile); fclose(pFile); } - + int r = lzo1x_1_compress(data, count, outdata, &new_len, NULL); unsigned char Data[12] = {0x00}; unsigned char size[4] = {0x00}; zlog_info(zct, "thisSize = %d", thisSize);