1.优化代码

2.适配eg915q
3.修复rtos下连拍发送问题
4.升级后保存参数(升级后保存参数存在偶发bug未修复)
This commit is contained in:
payton 2023-07-25 15:02:24 +08:00
parent 9776baf171
commit cf56097085
6 changed files with 30 additions and 15 deletions

View File

@ -1455,7 +1455,8 @@ SINT32 sf_sms_read_message(void)
if(strstr((const char *)gsmPara, "$")) if(strstr((const char *)gsmPara, "$"))
{ {
strtok((char *)gsmPara, "$"); strtok((char *)gsmPara, "$");
strcpy((char *)strok, strtok(NULL, "$")); //strcpy((char *)strok, strtok(NULL, "$"));
snprintf((char *)strok, sizeof(strok), "%s", strtok(NULL, "$"));
//printf("strok:%s\n", strok); //printf("strok:%s\n", strok);
} }
@ -1468,7 +1469,8 @@ SINT32 sf_sms_read_message(void)
while(temp != 0) while(temp != 0)
{ {
strcpy((char *)strValue[mm], (const char *)temp); //strcpy((char *)strValue[mm], (const char *)temp);
snprintf((char *)strValue[mm], sizeof(strValue[mm]), "%s", temp);
printf("strValue[%d]:%s\n", mm, strValue[mm]); printf("strValue[%d]:%s\n", mm, strValue[mm]);
mm++; mm++;
temp = (UINT8 *)strsep(&pStr, "#"); temp = (UINT8 *)strsep(&pStr, "#");
@ -1752,6 +1754,8 @@ SINT32 sf_check_message(void)
UINT8 location = MMS_ATCMGL1; UINT8 location = MMS_ATCMGL1;
SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get(); SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get();
SINT32 ttyRet = 0; SINT32 ttyRet = 0;
char strtmp[20] = {0};
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
printf("%s:%d s\n", __FUNCTION__, __LINE__); printf("%s:%d s\n", __FUNCTION__, __LINE__);
@ -1766,6 +1770,12 @@ SINT32 sf_check_message(void)
} }
} }
if(strncmp(puiPara->ModuleVer, GPRS_MODULE_TYPE_EG915Q, 6) == 0){
sprintf(strtmp, "sms/listmsgmap");
}else {
sprintf(strtmp, "SMS/ListMsgMap");
}
strcpy((char *)gsmPara, "AT+QCFG=\"sms/listmsgmap\",\"REC UNREAD\"\r"); strcpy((char *)gsmPara, "AT+QCFG=\"sms/listmsgmap\",\"REC UNREAD\"\r");
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara)); ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara));
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE); SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
@ -1839,7 +1849,7 @@ SINT32 sf_check_message(void)
case MMS_ATCMGL1: case MMS_ATCMGL1:
if(strstr((const char *)gsmPara, "SMS/ListMsgMap")) if(strstr((const char *)gsmPara, strtmp))
{ {
char *temp = NULL; char *temp = NULL;
char *delim;// char *delim;//
@ -2118,7 +2128,7 @@ void sf_hd_pic_list_print(void)
struct stat st_buffer; struct stat st_buffer;
char sendListName[64] = {0}; char sendListName[64] = {0};
char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0}; char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
SubImgList_t *pList = pSubImgListHead; SubImgList_t *pList = pSubImgListHead->pNext;
printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__); printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__);
SF_HDFILE_ATTR_S* fileCfg = sf_file_hd_cfg_get(); SF_HDFILE_ATTR_S* fileCfg = sf_file_hd_cfg_get();
@ -2225,17 +2235,17 @@ void sf_video_add_to_list(UINT8 *fileName)
*************************************************/ *************************************************/
void sf_video_list_print(void) void sf_video_list_print(void)
{ {
UINT8 i = 0; //UINT8 i = 0;
SF_HDFILE_ATTR_S* fileCfg = sf_file_video_cfg_get(); SF_HDFILE_ATTR_S* fileCfg = sf_file_video_cfg_get();
SubImgList_t *pList = pSubVideoListHead; SubImgList_t *pList = pSubVideoListHead->pNext;
printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__); printf("[%s:%d] print list:\n", __FUNCTION__, __LINE__);
while(pList != NULL) while(pList != NULL)
{ {
fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey; fileCfg->stfileattr[fileCfg->filecnt].dirKey = pList->dirKey;
fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey; fileCfg->stfileattr[fileCfg->filecnt].fileKey = pList->fileKey;
fileCfg->filecnt += 1; fileCfg->filecnt += 1;
printf("filecnt:%d f:%d,%d\n", fileCfg->filecnt, pList->dirKey, pList->fileKey);
pList = pList->pNext; pList = pList->pNext;
printf("ID:%d f:%d,%d\n", i++, pList->dirKey, pList->fileKey);
} }
} }

View File

@ -51,6 +51,7 @@
#include "sf_keymng.h" #include "sf_keymng.h"
#include "sf_wifi_svr.h" #include "sf_wifi_svr.h"
#include "sf_battery.h" #include "sf_battery.h"
#include "ftp_manager.h"
//#include <libavcodec/avcodec.h> //#include <libavcodec/avcodec.h>
//#include <libavformat/avformat.h> //#include <libavformat/avformat.h>
//#include <libavutil/imgutils.h> //#include <libavutil/imgutils.h>
@ -289,7 +290,7 @@ int main(int argc, char *argv[])
sf_com_message_send_to_cardv(&stMessageBuf); sf_com_message_send_to_cardv(&stMessageBuf);
}*/ }*/
ftp_manager_uninit();
sf_share_mem_file_deinit(); sf_share_mem_file_deinit();
sf_share_mem_customer_deinit(); sf_share_mem_customer_deinit();
SF_MUTEX_DESTROY(Param_mutexLock); SF_MUTEX_DESTROY(Param_mutexLock);

View File

@ -955,7 +955,7 @@ SINT32 app_debug_signal(SINT32 argc, SF_CHAR **argv[])
} }
SINT8 nValue = 0; SINT8 nValue = 0;
SINT8 mValue = 0; int mValue = 0;
if(strstr((SF_CHAR*)argv[1], "3g")) { if(strstr((SF_CHAR*)argv[1], "3g")) {
nValue = 3; nValue = 3;
mValue = atoi((SF_CHAR*)argv[2]); mValue = atoi((SF_CHAR*)argv[2]);

View File

@ -2024,6 +2024,7 @@ void* sf_sys_do_upgrade(void *arg)
} }
else { else {
SysResetFlag(); SysResetFlag();
Save_MenuInfo();
//sync(); //sync();
} }
sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 1); sf_mcu_reg_set(SF_MCU_SOFT_UPDATE, 1);

View File

@ -1428,15 +1428,15 @@ THREAD_RETTYPE PhotoFast_FlowPreviewThread(void *arg)
UINT32 period = 0; UINT32 period = 0;
#if HUNTING_CAMERA_MCU == ENABLE #if HUNTING_CAMERA_MCU == ENABLE
if(1 == puiPara->MultiShotIntevel) if(SF_MULTISHOT_INTEVEL_1S == puiPara->MultiShotIntevel)
{ {
period = 1000;//The interval between consecutive shots of each photo is 1 second period = 1000;//The interval between consecutive shots of each photo is 1 second
} }
else if(2 == puiPara->MultiShotIntevel) { else if(SF_MULTISHOT_INTEVEL_2S == puiPara->MultiShotIntevel) {
period = 2000;//The interval between consecutive shots of each photo is 2 second period = 2000;//The interval between consecutive shots of each photo is 2 second
} }
else { else {
period = 1000 / max_cnt; period = 1000 / max_cnt;//SF_MULTISHOT_INTEVEL_0S
} }
#else #else
period = 1000 / max_cnt; period = 1000 / max_cnt;

View File

@ -2152,9 +2152,10 @@ void sf_file_thumb_cfg_sava(void)
if (pThumbFileCfg != NULL) { if (pThumbFileCfg != NULL) {
for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++) for(fileIndex = 0; fileIndex < pThumbFileCfg->filecnt; fileIndex++)
{ {
if((fileIndex == 0) || (puiPara->SendMulti == 1)) if((0 == fileIndex) || ((1 == puiPara->SendMulti))){
sf_add_file_name_to_send_list(pThumbFileCfg->stfileattr[fileIndex].thumbfileName); sf_add_file_name_to_send_list(pThumbFileCfg->stfileattr[fileIndex].thumbfileName);
printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath); printf("%s:%d thumbfileSize:%ld thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize,pThumbFileCfg->stfileattr[fileIndex].thumbfileName,pThumbFileCfg->stfileattr[fileIndex].thumbfilePath);
}
} }
//printf("%s:%d e Size:%ld\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize); //printf("%s:%d e Size:%ld\n", __FUNCTION__, __LINE__,pThumbFileCfg->stfileattr[fileIndex].thumbfileSize);
free(pThumbFileCfg); free(pThumbFileCfg);
@ -2174,6 +2175,7 @@ void sf_add_file_name_to_send_list(char *sendfname)
char sendListName[64] = {0}; char sendListName[64] = {0};
char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0}; char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
int fd = 0; int fd = 0;
static int flag = 0;
struct stat st; struct stat st;
UIMenuStoreInfo *puiPara = sf_ui_para_get(); UIMenuStoreInfo *puiPara = sf_ui_para_get();
#if SF_IQ_TEST != ENABLE #if SF_IQ_TEST != ENABLE
@ -2196,12 +2198,13 @@ void sf_add_file_name_to_send_list(char *sendfname)
//printf("Add %s to send.List\n", sendfname); //printf("Add %s to send.List\n", sendfname);
if(0 == puiPara->SendType){ if(0 == puiPara->SendType){
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO); snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
if(access(sendListName, F_OK) == 0) if((access(sendListName, F_OK) == 0) && (0 == flag))
{ {
if (FileSys_DeleteFile(sendListName) != FST_STA_OK) { if (FileSys_DeleteFile(sendListName) != FST_STA_OK) {
DBG_IND("Ignore deleting file.\r\n"); DBG_IND("Ignore deleting file.\r\n");
} }
} }
flag = 1;
}else { }else {
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST); snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);