1.wifi预览缩略图更改
This commit is contained in:
parent
4aac98fa1e
commit
c6a6f96575
|
@ -553,12 +553,15 @@ void appsvr_getFileList(UINT8 *dirPath, UINT8 *startFileKey)
|
||||||
// printf("[appsvr_getFileList]open \n",nFileNums,idx);
|
// printf("[appsvr_getFileList]open \n",nFileNums,idx);
|
||||||
//printf("[appsvr_getFileList]nFileNums:%d, idx:%d, %s %d\n",nFileNums,idx,fname,gDevFileListNums);
|
//printf("[appsvr_getFileList]nFileNums:%d, idx:%d, %s %d\n",nFileNums,idx,fname,gDevFileListNums);
|
||||||
// printf("[appsvr_getFileList]nFileNums:%d, %d\n",nFileNums,gDevFileListNums);
|
// printf("[appsvr_getFileList]nFileNums:%d, %d\n",nFileNums,gDevFileListNums);
|
||||||
|
//MLOGI("name:%s.\n", ptr->d_name);
|
||||||
if(strstr((char *)ptr->d_name, SF_DCF_EXT_MOV) || strstr((char *)ptr->d_name, SF_DCF_EXT_PHOTO))
|
if(strstr((char *)ptr->d_name, SF_DCF_EXT_MOV) || strstr((char *)ptr->d_name, SF_DCF_EXT_PHOTO))
|
||||||
{
|
{
|
||||||
strcpy((char *)gDevFileList[nFileNums + gDevFileListNums].fileNameString, (char *)ptr->d_name);
|
snprintf((char *)gDevFileList[nFileNums + gDevFileListNums].fileNameString, sizeof(gDevFileList[nFileNums + gDevFileListNums].fileNameString), "%s", (char *)ptr->d_name);
|
||||||
|
//strcpy((char *)gDevFileList[nFileNums + gDevFileListNums].fileNameString, (char *)ptr->d_name);
|
||||||
gDevFileList[nFileNums + gDevFileListNums].srcFileType = (ptr->d_name[0] == 'W' ? 0 : (ptr->d_name[0] == 'S' ? 1 : 1));//ptr->d_name[3] - '0';
|
gDevFileList[nFileNums + gDevFileListNums].srcFileType = (ptr->d_name[0] == 'W' ? 0 : (ptr->d_name[0] == 'S' ? 1 : 1));//ptr->d_name[3] - '0';
|
||||||
//printf("%s\n", g3g75DevFileList[nFileNums - idx + gDevFileListNums].fileName);
|
//printf("%s\n", g3g75DevFileList[nFileNums - idx + gDevFileListNums].fileName);
|
||||||
nFileNums ++ ;
|
nFileNums ++ ;
|
||||||
|
//MLOGI("fileNameString:%s.\n", gDevFileList[nFileNums + gDevFileListNums].fileNameString);
|
||||||
}
|
}
|
||||||
//printf("[appsvr_getFileList]%d,%s\n",nFileNums - idx, gDevFileList[nFileNums - idx].fileName);
|
//printf("[appsvr_getFileList]%d,%s\n",nFileNums - idx, gDevFileList[nFileNums - idx].fileName);
|
||||||
}
|
}
|
||||||
|
@ -699,16 +702,17 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MLOGI("fileName3:%s\n",fileName);
|
MLOGI("fileName3:%s\n",fileName);
|
||||||
startDirKey[0] = '\0';
|
//startDirKey[0] = '\0';
|
||||||
startFileKey[0] = '\0';
|
//startFileKey[0] = '\0';
|
||||||
//strncpy((char *)startDirKey, "100", 3);
|
strncpy((char *)startDirKey, "100", 3);
|
||||||
//strncpy((char *)startFileKey, "0001", 4);
|
strncpy((char *)startFileKey, "0001", 4);
|
||||||
}
|
}
|
||||||
|
//MLOGI("startDirKey:%s startFileKey:%s sizeof:%d\n",startDirKey,startFileKey, FILE_LIST_NUM_MAX*(sizeof(MSG_DEV_THUMB_LIST_Get_Data_Rsp_T)));
|
||||||
memset(gDevFileList, 0, sizeof(gDevFileList));
|
//memset(gDevFileList, 0, FILE_LIST_NUM_MAX*(sizeof(MSG_DEV_THUMB_LIST_Get_Data_Rsp_T)));
|
||||||
gDevFileListNums = 0;
|
gDevFileListNums = 0;
|
||||||
//printf("get dir s\n");
|
//printf("get dir s\n");
|
||||||
sprintf((char *)dirPath, "%s/", THUMB_PATH);
|
//sprintf((char *)dirPath, "%s/", THUMB_PATH);
|
||||||
|
snprintf((char *)dirPath, sizeof(dirPath), "%s", (char *)THUMB_PATH);
|
||||||
|
|
||||||
appsvr_getFileList(dirPath, startFileKey);
|
appsvr_getFileList(dirPath, startFileKey);
|
||||||
// appsvr_getDirList(dirPath, startDirKey);
|
// appsvr_getDirList(dirPath, startDirKey);
|
||||||
|
@ -1215,9 +1219,9 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
case WIFI_GET_CAMERA_THUMB_LIST: //o
|
case WIFI_GET_CAMERA_THUMB_LIST: //o
|
||||||
strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.getThumbList.fileName);
|
strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.getThumbList.fileName);
|
||||||
MLOGI("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName);
|
MLOGI("[WIFI_GET_CAMERA_THUMB_LIST],fileName:%s\n",fileName);
|
||||||
appCreatThumbList(fileName);
|
appCreatThumbList(fileName);
|
||||||
MLOGI("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName);
|
MLOGI("[WIFI_GET_CAMERA_THUMB_LIST],fileName:%s\n",fileName);
|
||||||
|
|
||||||
memset((void *)&msgParse, 0, sizeof(msgParse));
|
memset((void *)&msgParse, 0, sizeof(msgParse));
|
||||||
msgParse.magicNum = htons(MSG_PRE_FIX);
|
msgParse.magicNum = htons(MSG_PRE_FIX);
|
||||||
|
@ -1848,42 +1852,44 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
memset((void *)&msgParse, 0, sizeof(msgParse));
|
memset((void *)&msgParse, 0, sizeof(msgParse));
|
||||||
// printf("Send File:%s,addr:%x\n",fileName,(U32)&msgParse.msgBuf.rctrlFileTransferInfo.fileName[0]);
|
// printf("Send File:%s,addr:%x\n",fileName,(U32)&msgParse.msgBuf.rctrlFileTransferInfo.fileName[0]);
|
||||||
|
|
||||||
if(fileName[0] != '\0')
|
|
||||||
{
|
|
||||||
memcpy((char *)&msgParse.msgBuf.rctrlFileTransferInfo.fileName[0], (char *)fileName+strlen((char *)fileName)-12, 12);
|
|
||||||
memcpy((char *)&msgParse.msgBuf.rctrlFileTransferInfo.filePath[0], (char *)fileName, strlen((char *)fileName)-12);
|
|
||||||
//msgParse.msgBuf.rctrlFileTransferInfo.fileName[13]=0;
|
|
||||||
// msgParse.msgBuf.rctrlFileTransferInfo.filePath[13]=0;
|
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.type = (tempbuf[0] == 'W' ? 0 : (tempbuf[0] == 'S' ? 1 : 1));
|
|
||||||
}
|
|
||||||
//printf("Send File:%s,function:%d,len:%d\n",msgParse.msgBuf.rctrlFileTransferInfo.fileName,function,strlen((char *)msgParse.msgBuf.rctrlFileTransferInfo.fileName));
|
//printf("Send File:%s,function:%d,len:%d\n",msgParse.msgBuf.rctrlFileTransferInfo.fileName,function,strlen((char *)msgParse.msgBuf.rctrlFileTransferInfo.fileName));
|
||||||
if(function == 2)//download
|
if(function == 2)//download
|
||||||
{
|
{
|
||||||
fileFd = open((char *)fileName, O_RDONLY);
|
if(fileName[0] != '\0')
|
||||||
if(fileFd > 0)
|
|
||||||
{
|
{
|
||||||
fSize = sp5kFsFileSizeGet((char *)fileName);
|
memcpy((char *)&msgParse.msgBuf.rctrlFileTransferInfo.fileName[0], (char *)fileName+strlen((char *)fileName)-12, 12);
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.fileSize = htonl(fSize);
|
memcpy((char *)&msgParse.msgBuf.rctrlFileTransferInfo.filePath[0], (char *)fileName, strlen((char *)fileName)-12);
|
||||||
// printf("fileSize = %d\n", fSize);
|
//msgParse.msgBuf.rctrlFileTransferInfo.fileName[13]=0;
|
||||||
|
// msgParse.msgBuf.rctrlFileTransferInfo.filePath[13]=0;
|
||||||
|
msgParse.msgBuf.rctrlFileTransferInfo.type = (tempbuf[0] == 'W' ? 0 : (tempbuf[0] == 'S' ? 1 : 1));
|
||||||
|
fileFd = open((char *)fileName, O_RDONLY);
|
||||||
|
if(fileFd > 0)
|
||||||
|
{
|
||||||
|
fSize = sp5kFsFileSizeGet((char *)fileName);
|
||||||
|
msgParse.msgBuf.rctrlFileTransferInfo.fileSize = htonl(fSize);
|
||||||
|
// printf("fileSize = %d\n", fSize);
|
||||||
|
|
||||||
stat( fileName, &fstat);
|
stat( fileName, &fstat);
|
||||||
mtime = localtime((time_t *)&fstat.st_mtime);
|
mtime = localtime((time_t *)&fstat.st_mtime);
|
||||||
|
|
||||||
//forbuild sp5kFsFileTimeGet(fileName, &atime, &mtime, &ctime);
|
//forbuild sp5kFsFileTimeGet(fileName, &atime, &mtime, &ctime);
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.year = htons(mtime->tm_year);
|
msgParse.msgBuf.rctrlFileTransferInfo.year = htons(mtime->tm_year);
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.month = mtime->tm_mon;
|
msgParse.msgBuf.rctrlFileTransferInfo.month = mtime->tm_mon;
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.day = mtime->tm_mday;
|
msgParse.msgBuf.rctrlFileTransferInfo.day = mtime->tm_mday;
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.hour = mtime->tm_hour;
|
msgParse.msgBuf.rctrlFileTransferInfo.hour = mtime->tm_hour;
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.minute = mtime->tm_min;
|
msgParse.msgBuf.rctrlFileTransferInfo.minute = mtime->tm_min;
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.second = mtime->tm_sec;
|
msgParse.msgBuf.rctrlFileTransferInfo.second = mtime->tm_sec;
|
||||||
|
|
||||||
close(fileFd);
|
close(fileFd);
|
||||||
ret = sf_DataMapSet(keyMap, function, fileName, fSize);
|
ret = sf_DataMapSet(keyMap, function, fileName, fSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ret = DATA_CMD_OPEN_FILE_FAIL;/*fileOpen fail*/
|
ret = DATA_CMD_OPEN_FILE_FAIL;/*fileOpen fail*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(function == 1)//upload
|
else if(function == 1)//upload
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user