From 022af3dd8cd588b7f21087916169ad4bc67b01e3 Mon Sep 17 00:00:00 2001 From: payton Date: Thu, 31 Aug 2023 16:50:50 +0800 Subject: [PATCH] =?UTF-8?q?1.cameraID=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../source/sf_app/code/source/wifi/sf_wifi_svr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 452d1a884..9af3c5830 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -688,13 +688,15 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG MLOGI("fileName:%s\n",fileName); - if(fileName != NULL && fileName[0] != '\0' && fileName[0] != '0') + if(fileName != NULL && fileName[0] != '\0' && fileName[0] != '0' && (strstr((char *)fileName, SF_DCF_EXT_MOV) || strstr((char *)fileName, SF_DCF_EXT_PHOTO))) { + MLOGI("fileName2:%s\n",fileName); strncpy((char *)startDirKey, (char *)fileName, 3); strncpy((char *)startFileKey, (char *)fileName+4, 4); } else { + MLOGI("fileName3:%s\n",fileName); startDirKey[0] = '\0'; startFileKey[0] = '\0'; //strncpy((char *)startDirKey, "100", 3); @@ -963,7 +965,7 @@ void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara) CamPara->batType = puiPara->BatteryType; - CamPara->cameraID = puiPara->CamNameSwitch == 0 ? 1:0; + CamPara->cameraID = puiPara->CamNameSwitch == SF_CAMID_OFF ? 0:1; strcpy((char *)CamPara->cameraIDstr, (char *)puiPara->CamNameStr); CamPara->dateTimeAuto = puiPara->DateAuto; @@ -1208,6 +1210,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.getThumbList.fileName); MLOGI("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName); appCreatThumbList(fileName); + MLOGI("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName); memset((void *)&msgParse, 0, sizeof(msgParse)); msgParse.magicNum = htons(MSG_PRE_FIX); @@ -1650,7 +1653,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) case WIFI_SET_CAMERA_CameraID: //O MLOGI("[WIFI_SET_CAMERA_CameraID],cameraID:%d\n",pMsgStruct->msgBuf.setCameraID.cameraID); - puiPara->CamNameSwitch = pMsgStruct->msgBuf.setCameraID.cameraID ? 0 : 1; + puiPara->CamNameSwitch = pMsgStruct->msgBuf.setCameraID.cameraID == 0 ? SF_CAMID_OFF : SF_CAMID_ON; strncpy(puiPara->CamNameStr, (char *)pMsgStruct->msgBuf.setCameraID.cameraIDstr, 4); //Use SF_STRNCPY to avoid that APP has not send '\0'. sf_camera_name_check(puiPara->CamNameStr); puiPara->CamNameStr[4] = '\0';