Merge branch 'Branch_S550_Fast_Emmc' of 192.168.6.216:linux-em-group/s530-ntk into S550_Base

This commit is contained in:
xiehongyan 2024-01-17 08:53:18 +08:00
commit 901f6fb3b0
36 changed files with 996 additions and 294 deletions

View File

@ -981,6 +981,7 @@
#define SF_CAM_UP_FILE_PATH "FW98565A.bin"
#define SF_CAMERA_GPS_INFO_FILENAME "/tmp/gps.txt"
#define SF_LOW_POWER_WARN_FILENAME "/tmp/btalarm.txt"
#define SF_DAILYREPORT_FILENAME "/tmp/d.txt"
#define SF_UBOOT_UPDATA_FW ENABLE

View File

@ -218,6 +218,48 @@ INT32 sys_usrmem_init(SYS_USRMEM* usrmem)
return E_SYS;
}
INT32 sys_usrmem_write_photo(SYS_USRMEM* usrmem, UINT32 buf, UINT32 size)
{
if(usrmem == NULL){
DBG_ERR("usrmem can't be null!\n");
return E_SYS;
}
if(usrmem->addr_photo == 0){
DBG_ERR("address photo can't be null!\n");
return E_SYS;
}
if(buf == 0){
DBG_ERR("buf can't be null!\n");
return E_SYS;
}
if(size == 0){
DBG_ERR("size can't be zero!\n");
return E_SYS;
}
if(usrmem->is_init == FALSE){
DBG_ERR("usrmem is not init yet!\n");
return E_SYS;
}
memcpy((void*)usrmem->addr_photo, (void*)buf, size);
usrmem->hdr->photo_ofs = usrmem->used_size;
usrmem->hdr->photo_size = size;
usrmem->hdr->photo_sum = MemCheck_CalcCheckSum16Bit(usrmem->addr_photo, size);
usrmem->used_size += size;
hd_common_mem_flush_cache((void*)usrmem->addr, usrmem->used_size);
DBG_DUMP("photo addr:%lx, size:%lx, sum:%lx\n", usrmem->addr_photo, usrmem->hdr->photo_size, usrmem->hdr->photo_sum);
return E_OK;
}
INT32 sys_usrmem_read_photo(SYS_USRMEM* usrmem, UINT32* addr, UINT32* size)
{
if(usrmem == NULL){

View File

@ -35,6 +35,7 @@ INT32 sys_usrmem_write_photo(SYS_USRMEM* usrmem, UINT32 buf, UINT32 size);
#else
INT32 sys_usrmem_read_photo(SYS_USRMEM* usrmem, UINT32* addr, UINT32* size);
INT32 sys_usrmem_write_photo(SYS_USRMEM* usrmem, UINT32 buf, UINT32 size);
#endif

View File

@ -29,6 +29,8 @@
static UINT32 m_uiPhotoQuality = 0;
static BOOL m_bCertified = FALSE;
UINT32 Imgexp = 0,Imgiso = 0; //sun chen@20240111
static const INT32 EV_NUMERATOR[(EV_SETTING_MAX)] = {
20,
17,
@ -195,7 +197,7 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
UINT16 uiSceneCaptureType = 0;
UINT16 uiSharpness = 0;
UINT32 RecID;
HD_RESULT hd_ret;
//HD_RESULT hd_ret;
RecID = ImageApp_MovieMulti_VePort2Imglink(HandleID);
@ -269,7 +271,8 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
{
UINT32 expo = 0;
float fexpo;
AET_STATUS_INFO status = {0};
/*.............sun chen@20240111 start.................*/
//AET_STATUS_INFO status = {0};
#if 0//_TODO
AE_GetExifInfo(0, &uiISOSpeed, &expo, &uiAperture[0], &MaxAperture[0]);
#else
@ -278,8 +281,8 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
uiAperture[0] = 20;
MaxAperture[0] = 20;
#endif
status.id=RecID;
if ((hd_ret = vendor_isp_init()) != HD_OK) {
//status.id=RecID;
/*if ((hd_ret = vendor_isp_init()) != HD_OK) {
DBG_ERR("vendor_isp_init() failed(%d)\r\n", hd_ret);
}
if ((hd_ret = vendor_isp_get_ae(AET_ITEM_STATUS, &status)) != HD_OK) {
@ -287,11 +290,11 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
}
if ((hd_ret = vendor_isp_uninit()) != HD_OK) {
DBG_ERR("vendor_isp_uninit() failed(%d)\r\n", hd_ret);
}
uiISOSpeed=status.status_info.iso_gain[0];
expo=status.status_info.expotime[0];
DBG_MSG("RecID=%d, uiISOSpeed=%d, expo=%d\r\n",RecID,uiISOSpeed,expo);
}*/
uiISOSpeed= Imgiso;//status.status_info.iso_gain[0];
expo= Imgexp;//status.status_info.expotime[0];
DBG_ERR("RecID=%d, uiISOSpeed=%d, expo=%d\r\n",RecID,uiISOSpeed,expo);
/*.............sun chen@20240111 end.................*/
uiFNumber[0] = uiAperture[0];
uiAperture[0] = 20 * log2((float)uiAperture[0] / 10);

View File

@ -38,7 +38,7 @@
#include "vendor_videoout.h"
#include "IOCfg.h"
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
#define THIS_DBGLVL 6 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
///////////////////////////////////////////////////////////////////////////////
#define __MODULE__ UiAppMovie
#define __DBGLVL__ ((THIS_DBGLVL>=PRJ_DBG_LVL)?THIS_DBGLVL:PRJ_DBG_LVL)
@ -147,6 +147,7 @@ static void xUSBMakerInit_UVAC(UVAC_VEND_DEV_DESC *pUVACDevDesc)
}
#endif //#if (MOVIE_UVAC_FUNC == ENABLE)
extern UINT32 Imgexp,Imgiso;
extern void GOIO_Turn_Onoff_IRCUT(UINT8 onoff);
extern void GPIO_IRLed_Turn_Onoff(BOOL onoff);
/*
@ -344,40 +345,32 @@ INT32 Set_Cur_Day_Night_Status(BOOL OnOff, UINT8 isSnapVideo)
vendor_isp_set_iq(IQT_ITEM_NIGHT_MODE, &night_mode);
if ((hd_ret = vendor_isp_uninit()) != HD_OK) {
DBG_ERR("vendor_isp_uninit() fail(%d)\r\n", hd_ret);
}
/*.............sun chen@20240111 start.................*/
if (OnOff){
vos_util_delay_ms(1000);
}
vendor_isp_get_ae(AET_ITEM_STATUS, &ae_status_info);
if (isSnapVideo == 0) {
if ((hd_ret = vendor_isp_init()) != HD_OK) {
DBG_ERR("vendor_isp_init() fail(%d)\r\n", hd_ret);
}
Imgexp = ae_status_info.status_info.expotime[0];
Imgiso = ae_status_info.status_info.iso_gain[0];
if (OnOff){
ae_manual.manual.mode = 1;
if (puiPara->NightMode == 0) {
ae_manual.manual.expotime = 125000;//ae_status.status_info.expotime[0];
ae_manual.manual.iso_gain = ae_status_info.status_info.iso_gain[0]*ae_status_info.status_info.expotime[0]/125000;
}
else if (puiPara->NightMode == 1) {
ae_manual.manual.expotime = 66666;//ae_status.status_info.expotime[0];
ae_manual.manual.iso_gain = ae_status_info.status_info.iso_gain[0]*ae_status_info.status_info.expotime[0]/66666;
}
else {
ae_manual.manual.expotime = ae_status_info.status_info.expotime[0];
ae_manual.manual.iso_gain = ae_status_info.status_info.iso_gain[0];
}
}
else
{
ae_manual.manual.mode = 0;
}
vendor_isp_set_ae(AET_ITEM_MANUAL, &ae_manual);
}
if ((hd_ret = vendor_isp_uninit()) != HD_OK) {
DBG_ERR("vendor_isp_uninit() fail(%d)\r\n", hd_ret);
}
/*.............sun chen@20240111 end.................*/
}
return 0;
}
@ -1280,7 +1273,7 @@ static void MovieExe_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
else if(id == _CFG_CLONE_ID_1){
snprintf(thumb_current_path_clone, sizeof(thumb_current_path_clone), "%s", tmp);
}
DBG_DUMP("last send file:%s\r\n", tmp);
DBG_DUMP("id:%d last send file:%s\r\n", id, tmp);
#else
if(id == _CFG_REC_ID_1){
snprintf(thumb_current_path_main, sizeof(thumb_current_path_main), "%s", pFileName);

View File

@ -1285,6 +1285,8 @@ void MovieStamp_CombineStamp(UINT32 vid_in, UINT32 bg_color)
UINT32 lineoff[HD_VIDEO_MAX_PLANE] = {0};
UINT32 addr[HD_VIDEO_MAX_PLANE] = {0};
UIMenuStoreInfo *puiPara = sf_ui_para_get();
char name[16];
INT16 cTemper = 0;
INT16 fTemper = 0;
@ -1419,6 +1421,15 @@ void MovieStamp_CombineStamp(UINT32 vid_in, UINT32 bg_color)
padding,
&x_curr_ofs);
//camid stamp
if((puiPara->CamNameSwitch == SF_CAMID_ON) && (puiPara->CamNameStr[0] != '\0'))
{
snprintf((char *)customString, sizeof(customString), "%s", puiPara->CamNameStr);
DBG_IND("[%s:%d]customString=%s\n", __FUNCTION__, __LINE__, customString);
//sprintf(customString, "Cam1");
MovieStamp_AttachString(combined_stamp_h, &Img, customString, font, false, padding, &x_curr_ofs);
}
/*printf("[%s:%d]moon id=%d,battery id=%d\n", __FUNCTION__, __LINE__,
(LV_PLUGIN_IMG_ID_ICON_10200_MOON + moonday), (LV_PLUGIN_IMG_ID_ICON_10230_BATTERT + batValue));*/

View File

@ -40,7 +40,7 @@
#include "DCF.h"
#endif
#include "SF_SysStrgMng.h"
#include "sys_usrmem.h"
#define THIS_DBGLVL 2 // 0=FATAL, 1=ERR, 2=WRN, 3=UNIT, 4=FUNC, 5=IND, 6=MSG, 7=VALUE, 8=USER
@ -6879,14 +6879,15 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data)
extern INT32 ImageApp_Photo_WriteCB(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId);
IMG_CAP_FST_INFO FstStatus = {FST_STA_OK};
UINT32 dcf_handle = (UINT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
INT32 dcf_handle = (INT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
FstStatus.Status = ImageApp_Photo_WriteCB(
if(dcf_handle >= 0)
{
FstStatus.Status = ImageApp_Photo_WriteCB(
(UINT32)queue_ele_in->jpg_combined_addr,
queue_ele_in->jpg_combined_size,
HD_CODEC_TYPE_JPEG, dcf_handle);
{
char* file_path = ImageApp_Photo_GetLastWriteFilePath();
char tmp[256] = {'\0'};
UINT32 length = strlen(file_path);
@ -6940,6 +6941,19 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data)
}
#endif
}
else
{
DBG_WRN("filesys not ready, store data into mem\n");
SYS_USRMEM usrmem = {0};
if(sys_usrmem_init(&usrmem) == E_OK){
sys_usrmem_write_photo(
&usrmem,
(UINT32) queue_ele_in->jpg_thumb_addr,
queue_ele_in->jpg_thumb_size
);
}
}
if(PhotoCapMsgCb){
PhotoCapMsgCb(IMG_CAP_CBMSG_FSTOK, &FstStatus);

View File

@ -84,6 +84,7 @@ static lv_obj_t *g_preview_info_msgbox = NULL;
static lv_obj_t *g_preview_info_label = NULL;
static int g_preview_info_ishidden = true;
static lv_task_t* preview_info_task = NULL;
extern DCF_HANDLE System_Get_DCF_Handle(void);
static void preview_info_task_cb(lv_task_t* task)
{
static int count = 0;
@ -1894,6 +1895,7 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
{
#if HUNTING_CAMERA_MCU == ENABLE
UIMenuStoreInfo *puiPara = sf_ui_para_get();
INT32 dcf_handle = -1;
#endif
if(msg == NULL){
@ -1913,7 +1915,15 @@ void UIFlowPhoto_UpdateInfo(lv_obj_t* obj, const LV_USER_EVENT_NVTMSG_DATA* msg)
case UIAPPPHOTO_CB_CAPSTART:
#if HUNTING_CAMERA_MCU == ENABLE
sf_set_cap_statu(TRUE);
sf_set_cammode_statu(puiPara->CamMode);
dcf_handle = (INT32)System_Get_DCF_Handle(); /* 0:emmc 1:sd */
if(dcf_handle >= 0)
{
sf_set_cammode_statu(puiPara->CamMode);
}
else {
DBG_WRN("filesys not ready, CamMode SF_CAM_MODE_PHOTO\n");
sf_set_cammode_statu(SF_CAM_MODE_PHOTO);
}
#endif
if(obj == UIFlowPhoto)

View File

@ -271,6 +271,8 @@
#define DEFAULT_PIC_UP_DAILY_REPORT SF_OFF
#define DEFAULT_BLU_SWITCH SF_ON
#define DEFAULT_WIFI_SWITCH SF_ON
#define DEFAULT_UPDATEFLG_SWITCH SF_ON
#define SIFAR_FTP_IP "119.23.174.139"
#define SIFAR_FTP_PORT "21"
#define SIFAR_FTP_USERNAME "cameraftp"

View File

@ -1793,6 +1793,8 @@ void SysResetFlag(void)
puiPara->PicUpDailyReport = DEFAULT_PIC_UP_DAILY_REPORT;
puiPara->BluSwitch = DEFAULT_BLU_SWITCH;
puiPara->WifiSwitch = DEFAULT_WIFI_SWITCH;
puiPara->UpdateFlg = DEFAULT_UPDATEFLG_SWITCH;
if(puiPara->ModuleImei[0] != '\0')
{
puiPara->DailyReportTime.Hour = ((UINT16)(puiPara->ModuleImei[11]-48)*10+(puiPara->ModuleImei[12]-48))%12;

View File

@ -54,11 +54,13 @@
#define SF_LPA_PROFILE_INFO_FILENEME (UINT8 *)"B:\\UDF\\profile_info.txt"
#define SF_LPA_PROFILE_INFO_BACKUP_FILENEME (UINT8 *)"B:\\UDF\\profile_info_backup.txt"
#else
// to do: save in flash
#define SF_LPA_DOWNLOAD_PROFILE_AC_FILENEME "/tmp/download_ac.txt"
#define SF_LPA_DOWNLOAD_ENABLE_PROFILE_AC_FILENEME "/tmp/download_enable_ac.txt"
#define SF_LPA_PROFILE_INFO_FILENEME "/tmp/profile_info.txt"
#define SF_LPA_PROFILE_INFO_BACKUP_FILENEME "profile_info.txt"
#define SF_LPA_LOG_FILE_PATH "/mnt/sd/" //No use
#define SF_LPA_PROFILE_INFO_BACKUP_FILENEME "/mnt/sd/profile_info.txt"
#define SF_LPA_LOG_FILE_PATH "/mnt/sd/"
#endif
typedef struct SF_SMS_LPA_CMD_S{

View File

@ -224,7 +224,8 @@ SINT32 sf_low_power_warn_send_ftp(void);
double sf_sys_s_time_get(time_t end_time);
time_t sf_time (time_t *__timer);
SINT32 sf_gps_send_ftp(void);
SINT32 sf_test_send_file_to_ftp(void);
SINT32 sf_mem_send_file_to_ftp(void);
SINT32 sf_card_log_send_ftp(void);
SINT32 sf_ftp_lpa_log_send(void);
#endif /*_SF_FTP_H_*/

View File

@ -142,7 +142,6 @@ extern "C" {
#define SIFAR_CUSTOMER_PARAM_PATH "/misc/sfSysParm.bin"
#define SIFAR_STATISTICS_PARAM_PATH "THUMB/sfStatisticsParm.bin"
//#define SF_SEND_LIST_DIR SF_SD_ROOT"THUMB"
#define SF_DAILYREPORT_FILENAME "THUMB/d.txt"
#define SF_ERROR_CODE "THUMB/warning.txt"
#define SF_DAILYREPORT_TXT "DailyReport.txt"
#define SF_LOG_TXT "log.txt"

View File

@ -234,6 +234,20 @@ typedef struct sfPDT_PARAM_STATISTICS_S
SF_SUBSCRIBE_FILE_ATTR_S stSubscribe;
SF_OSS_S stOssCfg;
SF_PARA_TIME_S httpTime;
UINT32 TotalPicsSent;
UINT32 TotalPicsSuccess;
UINT32 TotalPicsFailed;
UINT32 TotalPicsTimeout;
UINT32 TotalTransmissionTime;
UINT32 ThumbnailTransmissionTime;
UINT32 ThumbnailPicsSent;
UINT32 ThumbnailPicsFailed;
UINT32 HDTransmissionTime;
UINT32 HDPicsSent;
UINT32 HDPicsFailed;
UINT32 VideoTransmissionTime;
UINT32 VideoSent;
UINT32 VideoFaild;
UINT32 picSendCount;
UINT32 sendThumbnailCount;

View File

@ -35,6 +35,7 @@ INT32 sys_usrmem_write_photo(SYS_USRMEM* usrmem, UINT32 buf, UINT32 size);
#else
INT32 sys_usrmem_read_photo(SYS_USRMEM* usrmem, UINT32* addr, UINT32* size);
INT32 sys_usrmem_write_photo(SYS_USRMEM* usrmem, UINT32 buf, UINT32 size);
#endif

View File

@ -3633,6 +3633,26 @@ SINT32 sf_net_regist_manual(void)
ttyData.cmp = "OK";
ttyData.len = strlen(gsmPara) + 2;
}
else if((strstr((const char *)gsmPara, "+CGREG: 0,3") != NULL))
{
if(callTime > 3)
{
ret = SF_SIM_ERROR_REG_NET_REFUSE;
printf("[%s:%d]AT+CGREG? REG_NET_REFUSE.\n", __FUNCTION__, __LINE__);
SLOGE(gsmPara);
sprintf((char *)logStr, "AT+CGREG? REG_NET_REFUSE,Error Code:0x%08X\n", ret);
SLOGE(logStr);
goto SF_NET_REG_END;
}
else
{
sprintf((char *)gsmPara, "AT+CGREG?\r");
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen((const char *)gsmPara));
SF_CHECK_RETURN(ttyRet, SF_GPRS_MODULE_ERROR_WRITE);
sf_sleep_ms(300);
}
callTime++;
}
else
{
//callTime--;

View File

@ -52,6 +52,7 @@ extern "C" {
#include "ftp_manager.h"
#include "sf_system.h"
#include "curl/curl.h"
#include "sf_4G_sms_lpa_cmd.h"
/**************************************************************************
* C O N S T A N T S *
**************************************************************************/
@ -889,6 +890,8 @@ SINT32 sf_pic_send_ftp(void)
UINT8 csqlevel = 0;
int timeout = 120000;
//SINT64 sendStartTime = 0;
UINT8 sendAlreadyFlag = 0;
UINT8 timeoutCnt = 0;
SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get();
MLOGD("start\n");
@ -962,13 +965,17 @@ SINT32 sf_pic_send_ftp(void)
if(SF_SUCCESS == ret)
{
ret = sf_ftp_send(ftpFileName[pic], filePath[pic], timeout);
pSifarPara->TotalPicsSent++;
if(SF_SUCCESS != ret)
{
pSifarPara->picSendFailCount++;
pSifarPara->sendThumbnailFailCount++;
//TIMEOUT
//pSifarPara->picSendTimeoutCount++;
if(!sf_get_pic())
{
timeoutCnt++;
}
printf("%s:%d err ftpFileName:%s filePath:%s picSendFailCount:%d sendThumbnailFailCount:%d\n", __FUNCTION__, __LINE__, ftpFileName[pic], filePath[pic],pSifarPara->picSendFailCount, pSifarPara->sendThumbnailFailCount);
SF_SPRINTF(logStr, "%x,", ret);
sf_log_error_code(logStr);
@ -976,6 +983,10 @@ SINT32 sf_pic_send_ftp(void)
else {
if(!sf_get_mode_flag()){
pSifarPara->picSendMax++;
if(!sf_get_pic())
{
sendAlreadyFlag++;
}
}
pSifarPara->picSendSucessCount++;
if((pPara->SendMaxNum == 0) || (pSifarPara->picSendMax < pPara->SendMaxNum)){
@ -998,7 +1009,11 @@ SINT32 sf_pic_send_ftp(void)
}
}
// sendEndTime = clock();
//pSifarPara->TotalPicsSent++;
pSifarPara->TotalPicsSuccess += sendAlreadyFlag;
pSifarPara->TotalPicsFailed += timeoutCnt;
pSifarPara->ThumbnailPicsSent += sendAlreadyFlag;
pSifarPara->ThumbnailPicsFailed += timeoutCnt;
//pSifarPara->picSendTimeCount +=sendEndTime - sendStartTime;
//pSifarPara->sendThumbnailTimeCount += sendEndTime - sendStartTime;
@ -1095,6 +1110,41 @@ SINT32 sf_video_send_ftp(void)
return ret;
}
SINT32 sf_ftp_lpa_log_send(void)
{
SINT32 ret = SF_SUCCESS;
//UINT8 CamNameStr[20] = { 0 };
//UINT8 uploadFname[64] = { 0 };
UINT8 lpaFile[64] = { 0 };
UINT8 filePath[64] = { 0 };
int timeout = 60000;
MLOGD("start\n");
printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath);
sprintf((char *)lpaFile, "%s", sf_sms_lpa_log_file_name_get());
sprintf((char *)filePath, "%s%s", SF_LPA_LOG_FILE_PATH, lpaFile);
ret = sf_ftp_config(0, 0, timeout);
if(SF_SUCCESS != ret)
{
printf("%s:%d upload err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
}
else
{
ret = sf_ftp_send(lpaFile, filePath, timeout);
if(SF_SUCCESS != ret)
{
printf("%s:%d err ret: [0x%08X] filePath:%s\n", __FUNCTION__, __LINE__, ret, filePath);
}
}
MLOGD(" end ret:[0x%08X]\n", ret);
return ret;
}
SINT32 sf_ftp_dailyreport_send(void)
{
SINT32 ret = SF_SUCCESS;
@ -1108,20 +1158,12 @@ SINT32 sf_ftp_dailyreport_send(void)
MLOGD("start\n");
char *dp_filename = sf_root_path_strcat(SF_DAILYREPORT_FILENAME);
if(dp_filename == NULL)
{
free(dp_filename);
return SF_FAILURE;
}
if(SUCCESS != sf_create_dailyreport_file())
{
printf("%s:%d err create dailyreport file\n", __FUNCTION__, __LINE__);
return SF_FAILURE;
}
sprintf((char *)filePath, "%s", dp_filename);
free(dp_filename);
sprintf((char *)filePath, "%s", SF_DAILYREPORT_FILENAME);
//sprintf((char *)filePath, "UFS:/%s-dr.txt", pPara->ModuleImei);
printf("%s:%d filePath:%s\n", __FUNCTION__, __LINE__, filePath);
@ -1152,6 +1194,22 @@ SINT32 sf_ftp_dailyreport_send(void)
sf_log_error_code(logStr);
}else {
DailyReportFtpSendSucess = 1;
pSifarPara->TotalPicsSent = 0;
pSifarPara->TotalPicsSuccess = 0;
pSifarPara->TotalPicsFailed = 0;
pSifarPara->TotalPicsTimeout = 0;
pSifarPara->TotalTransmissionTime = 0;
pSifarPara->ThumbnailTransmissionTime = 0;
pSifarPara->ThumbnailPicsSent = 0;
pSifarPara->ThumbnailPicsFailed = 0;
pSifarPara->HDTransmissionTime = 0;
pSifarPara->HDPicsSent = 0;
pSifarPara->HDPicsFailed = 0;
pSifarPara->VideoTransmissionTime = 0;
pSifarPara->VideoSent = 0;
pSifarPara->VideoFaild = 0;
pSifarPara->picSendCount = 0;
pSifarPara->sendThumbnailCount = 0;
pSifarPara->picSendSucessCount = 0;
@ -1327,6 +1385,9 @@ SINT32 sf_send_file_to_ftp(UINT8 mode)
//sendEndTime = clock();
time(&sendEndTime);
double elapsed_time = sf_sys_s_time_get(sendEndTime);
pSifarPara->TotalTransmissionTime += elapsed_time;
pSifarPara->ThumbnailTransmissionTime += elapsed_time;
pSifarPara->picSendTimeCount +=elapsed_time;
pSifarPara->sendThumbnailTimeCount += elapsed_time;
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
@ -1497,7 +1558,7 @@ SINT32 sf_connect_ftps_server(void)
*************************************************/
SINT32 sf_camera_ota_ftp(void)
{
char Cmd[128] = {0};
//char Cmd[128] = {0};
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
SINT32 ret = SF_SUCCESS;
FtpSslFlag ssl_flag = FTP_SSL_FLAG_END;
@ -1717,6 +1778,9 @@ SF_CONCENTRATED_END:
time(&sendEndTime);
double elapsed_time = sf_sys_s_time_get(sendEndTime);
pSifarPara->TotalTransmissionTime += elapsed_time;
pSifarPara->ThumbnailTransmissionTime += elapsed_time;
pSifarPara->picSendTimeCount +=elapsed_time;
pSifarPara->sendThumbnailTimeCount += elapsed_time;
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
@ -1738,11 +1802,18 @@ SF_CONCENTRATED_END:
if(SendFileTotal)
{
SLOGI("Concentrated Send end.\n");
pSifarPara->TotalPicsSent += (sendAlreadyFlag + timeoutCnt);
pSifarPara->TotalPicsSuccess += sendAlreadyFlag;
pSifarPara->TotalPicsFailed += timeoutCnt;
pSifarPara->TotalPicsTimeout += timeoutCnt;
pSifarPara->ThumbnailPicsSent += (piccount+1);
pSifarPara->ThumbnailPicsFailed += timeoutCnt;
pSifarPara->picSendCount += (piccount+1);
pSifarPara->sendThumbnailCount += (piccount+1);
pSifarPara->picSendSucessCount += sendAlreadyFlag;
pSifarPara->picSendFailCount += ((piccount + 1) - sendAlreadyFlag);
pSifarPara->sendThumbnailFailCount += ((piccount + 1) - sendAlreadyFlag);
pSifarPara->picSendFailCount += ((piccount + 1) - (sendAlreadyFlag + 1));
pSifarPara->sendThumbnailFailCount += ((piccount + 1) - (sendAlreadyFlag + 1));
pSifarPara->picSendTimeoutCount += timeoutCnt;
}
//printf("[%s:%d]ret1:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret1, ret2);
@ -1865,6 +1936,8 @@ SINT32 sf_hd_ftp_send(void)
sendFailFlag++;
time(&sendEndTime);
elapsed_time = sf_sys_s_time_get(sendEndTime);
pSifarPara->TotalTransmissionTime += elapsed_time;
pSifarPara->picSendTimeCount +=elapsed_time;
pSifarPara->sendThumbnailTimeCount += elapsed_time;
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
@ -1911,6 +1984,9 @@ SF_HD_END:
time(&sendEndTime);
elapsed_time = sf_sys_s_time_get(sendEndTime);
pSifarPara->TotalTransmissionTime += elapsed_time;
pSifarPara->HDTransmissionTime += elapsed_time;
pSifarPara->picSendTimeCount +=elapsed_time;
MLOGD("SendTime:%d s picSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->picSendTimeCount,pSifarPara->sendThumbnailTimeCount);
time(&sendStartTime);
@ -1931,12 +2007,19 @@ SF_HD_END:
if(SendFileTotal)
{
SLOGI("Concentrated Send end.\n");
pSifarPara->TotalPicsSent += (sendAlreadyFlag + timeoutCnt);
pSifarPara->TotalPicsTimeout += timeoutCnt;
pSifarPara->HDPicsSent += (piccount+1);
pSifarPara->HDPicsFailed += timeoutCnt;
pSifarPara->picSendCount += (piccount+1);
pSifarPara->sendThumbnailCount += (piccount+1);
pSifarPara->picSendSucessCount += sendAlreadyFlag;
pSifarPara->picSendFailCount += ((SendFileTotal + 1) - sendAlreadyFlag);
pSifarPara->picSendFailCount += ((SendFileTotal + 1) - (sendAlreadyFlag + 1));
//pSifarPara->sendThumbnailFailCount += ((piccount + 1) - sendAlreadyFlag);
pSifarPara->picSendTimeoutCount += timeoutCnt;
MLOGD("[%s:%d]TotalPicsSent:%d\n\n", pSifarPara->TotalPicsSent);
}
//printf("[%s:%d]ret1:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret1, ret2);
MLOGD(" end ret1:[0x%08X],ret2:[0x%08X]\n", ret1, ret2);
@ -2150,6 +2233,7 @@ SF_VIDEO_END:
time(&sendEndTime);
elapsed_time = sf_sys_s_time_get(sendEndTime);
pSifarPara->VideoTransmissionTime += elapsed_time;
pSifarPara->videoSendTimeCount +=elapsed_time;
MLOGD("SendTime:%d s videoSendTimeCount:%d s sendThumbnailTimeCount:%d s\n", elapsed_time, pSifarPara->videoSendTimeCount,pSifarPara->sendThumbnailTimeCount);
time(&sendStartTime);
@ -2165,8 +2249,13 @@ SF_VIDEO_END:
if(SendFileTotal)
{
SLOGI("Send end.\n");
pSifarPara->TotalPicsSent += (sendAlreadyFlag + timeoutCnt);
pSifarPara->TotalPicsTimeout += timeoutCnt;
pSifarPara->VideoSent += (sendAlreadyFlag + timeoutCnt);
pSifarPara->VideoFaild += (timeoutCnt);
pSifarPara->videoSendSucessCount += sendAlreadyFlag;
pSifarPara->videoSendFailCount += ((SendFileTotal + 1) - sendAlreadyFlag);
pSifarPara->videoSendFailCount += ((SendFileTotal + 1) - (sendAlreadyFlag + 1));
pSifarPara->picSendTimeoutCount += timeoutCnt;
}
@ -2403,14 +2492,14 @@ SINT32 sf_gps_send_ftp(void)
#if SF_NO_SD_SEND == ENABLE
/*************************************************
Function: sf_ftp_config
Function: sf_mem_ftp_config
Description: send pic to ftp
Input: N/A
Output: N/A
Return: 0 SUCCESS, 1 error
Others: N/A
*************************************************/
SINT32 sf_test_ftp_config(UINT8 ssl, UINT8 GprsMode, int timeout)
SINT32 sf_mem_ftp_config(UINT8 ssl, UINT8 GprsMode, int timeout)
{
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
SINT32 ret = SF_SUCCESS;
@ -2738,14 +2827,14 @@ SINT32 sf_test_ftp_config(UINT8 ssl, UINT8 GprsMode, int timeout)
}
/*************************************************
Function: sf_ftp_send
Function: sf_mem_ftp_send
Description: send pic to ftp
Input: N/A
Output: N/A
Return: 0 SUCCESS, 1 error
Others: N/A
*************************************************/
SINT32 sf_test_ftp_send(UINT8 *ftpFileName, UINT8 *filePath, int timeout)
SINT32 sf_mem_ftp_send(UINT8 *ftpFileName, UINT8 *filePath, int timeout)
{
#if 1
SINT32 ret = SF_SUCCESS;
@ -2870,14 +2959,14 @@ SINT32 sf_test_ftp_send(UINT8 *ftpFileName, UINT8 *filePath, int timeout)
}
/*************************************************
Function: sf_ftp_send
Description: send pic to ftp
Function: sf_mem_ftp_stop
Description: send pic to ftp stop
Input: N/A
Output: N/A
Return: 0 SUCCESS, 1 error
Others: N/A
*************************************************/
SINT32 sf_test_ftp_stop(UINT8 ssl, UINT8 GprsMode)
SINT32 sf_mem_ftp_stop(UINT8 ssl, UINT8 GprsMode)
{
#if 1
SINT32 ret = SF_SUCCESS;
@ -3050,7 +3139,7 @@ SINT32 sf_test_ftp_stop(UINT8 ssl, UINT8 GprsMode)
Return: 0:success; else:fail;
Others: N/A
*************************************************/
SINT32 sf_test_send_file_to_ftp(void)
SINT32 sf_mem_send_file_to_ftp(void)
{
SINT32 ret1 = SF_SUCCESS; //0:success; else:fail;
SINT32 ret2 = SF_SUCCESS; //0:success; else:fail;
@ -3078,7 +3167,7 @@ SINT32 sf_test_send_file_to_ftp(void)
printf("netGeneration:%dG,tempPicSize=%d,piccount=%d,pic=%d\n", sf_get_net_generation(), tempPicSize, piccount, pic);
sprintf((char *)ftpFileName, "%sMEMPHOTO.JPG", cameraID);
sprintf((char *)ftpFileName, "%sN-E1000001.JPG", cameraID);
sprintf((char *)filePath, "UFS:MEMPHOTO.JPG");
printf("%s:%d ftpFileName:%s filePath:%s \n", __FUNCTION__, __LINE__, ftpFileName, filePath);
@ -3089,16 +3178,16 @@ SINT32 sf_test_send_file_to_ftp(void)
printf("[%s:%d] ssl:%d,GprsMode:%d\n", __FUNCTION__, __LINE__, ssl, gprsMode);
ret1 = sf_test_ftp_config(ssl, gprsMode, timeout);
ret1 = sf_mem_ftp_config(ssl, gprsMode, timeout);
if(SF_SUCCESS == ret1)
{
ret1 = sf_test_ftp_send(ftpFileName, filePath, timeout);
ret1 = sf_mem_ftp_send(ftpFileName, filePath, timeout);
}
if(ret1 != SF_FTP_ERROR_TERM)
{
ret2 = sf_test_ftp_stop(ssl, gprsMode);
ret2 = sf_mem_ftp_stop(ssl, gprsMode);
}
MLOGD(" end ret1:[0x%08X],ret2:[0x%08X]\n", ret1, ret2);

View File

@ -42,6 +42,8 @@
#include "sf_fileMng.h"
#include "sf_battery.h"
#include "sf_system.h"
#include "sf_4G_sms_lpa_cmd.h"
/**************************************************************************
* C O N S T A N T S *
**************************************************************************/
@ -1282,6 +1284,159 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
return Readmmsok;
}
UINT8 sf_poweroff_check_lpa_excute_cmd(void)
{
//sf_mcu_watchdog_set(5);
sf_sms_lpa_download_command_add_to_list();
sf_sms_lpa_command_execute();
if(sf_sms_lpa_is_need_send_lpa_log() && (!sf_sms_lpa_is_need_enable_profile()))
{
sf_sms_lpa_set_send_lpa_log_flg(FALSE);
// to do: send lpa log
sf_ftp_lpa_log_send();
}
return 0;
}
UINT8 sf_poweroff_check_lpa_enable_profile(void)
{
if(sf_sms_lpa_is_need_enable_profile())
{
sf_sms_lpa_command_enable_profile_handle(sf_sms_lpa_get_enable_profile_cmd_val());
sf_sms_lpa_clean_need_enable_iccid();
if(!sf_sms_lpa_is_need_profile_switch_reboot() && sf_sms_lpa_is_need_send_lpa_log())
{
sf_sms_lpa_set_send_lpa_log_flg(FALSE);
// to do: send lpa log
sf_ftp_lpa_log_send();
printf("enter send LPA LOG\n");
}
else
{
printf("profile enable, reboot to re search net\n");
///sf_set_netsearch_step(SIM_NETSEARCH_STEP_IDLE);
//to do: poweroff 4G MODELU power off, a reboot
sf_cmd_camera_restart(1);
return 0;
}
}
}
UINT8 sf_sms_content_parse(SF_CHAR *smsStr)
{
SF_CHAR strValue[32][32]= {0};
SF_CHAR *temp = NULL;
SF_CHAR *lpaCmdStr = NULL;
UINT16 i = 0;
UINT16 smsCnt = 0;
UINT8 ret;
SF_SMS_LPA_CMD_T *pLpaCmd = NULL;
//UIMenuStoreInfo *sfParam = sf_app_ui_para_get();
//SF_PDT_PARAM_STATISTICS_S *sfStat = sf_statistics_param_get();
if(strlen(smsStr) > 0)
{
lpaCmdStr = strstr(smsStr, "$R0e*");
if(lpaCmdStr == NULL)
{
smsCnt = 0;
temp = strsep(&smsStr, "#");
while(temp != 0)
{
strcpy(strValue[smsCnt], temp);
smsCnt++;
printf("---temp%d:%s\n", smsCnt, temp);
temp = strsep(&smsStr, "#");
}
}
else
{
smsCnt = 1;
}
}
if(smsCnt > 0)
{
i = 0;
if(lpaCmdStr != NULL)
{
//printf("Error Format line-1\n", __LINE__);
//lpaCmdStr = SF_STRSTR(smsStr, "R0e*");
//printf("Error Format line\n", __LINE__);
pLpaCmd = malloc(sizeof(SF_SMS_LPA_CMD_T));
memset(pLpaCmd, 0, sizeof(SF_SMS_LPA_CMD_T));
if(pLpaCmd != NULL)
{
if(sf_sms_lpa_command_info_extract((SINT8 *)lpaCmdStr, &pLpaCmd->CmdVal, pLpaCmd->Param1Buff, pLpaCmd->Param2Buff, pLpaCmd->Param3Buff) == SF_SUCCESS)
{
if((pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DOWNLOAD_PROFILE_1) || (pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DOWNLOAD_ENABLE_PROFILE_1))
{
sf_sms_lpa_save_download_profile_activation_code(pLpaCmd->CmdVal, pLpaCmd->Param1Buff);
//sf_sms_lpa_command_log(pLpaCmd, SF_SMS_LPA_CMD_SUCCESS, LPA_NO_ERROR, SF_SMS_LPA_CMD_ERROR_SOURCE_OTHER);
}
else if((pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DOWNLOAD_PROFILE_2) || (pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DOWNLOAD_ENABLE_PROFILE_2))
{
sf_sms_lpa_command_handle(pLpaCmd);
}
else if(pLpaCmd->CmdVal == SF_SMS_LPA_CMD_ENABLE_PROFILE)
{
sf_sms_lpa_command_handle(pLpaCmd);
//sf_sms_lpa_command_enable_profile_handle(sf_sms_lpa_get_enable_profile_cmd_val());
}
else if((pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DELETE_PROFILE) || (pLpaCmd->CmdVal == SF_SMS_LPA_CMD_DELETE_PROFILE_NITIFY))
{
sf_sms_lpa_command_handle(pLpaCmd);
}
else
{
/*cmd prase fail,need send lpa log*/
//sf_sms_lpa_command_log(pLpaCmd, SF_SMS_LPA_CMD_FAIL, SF_LPA_CUSTOM_ERROR_CMD_UNKNOWN, SF_SMS_LPA_CMD_ERROR_SOURCE_OTHER);
printf("Error Parameter line:%d i=%d\n", __LINE__, i);
ret = SMS_STATUS_PARA_ERR;
}
}
else
{
/*cmd prase fail,need send lpa log*/
//sf_sms_lpa_command_log(NULL, SF_SMS_LPA_CMD_FAIL, SF_LPA_CUSTOM_ERROR_CMD_UNKNOWN, SF_SMS_LPA_CMD_ERROR_SOURCE_OTHER);
printf("Error Format line:%d i=%d\n", __LINE__, i);
ret = SMS_STATUS_FORMAT_ERR;
}
free(pLpaCmd);
}
else
{
/*cmd prase fail,need send lpa log*/
//sf_sms_lpa_command_log(NULL, SF_SMS_LPA_CMD_FAIL, SF_LPA_CUSTOM_ERROR_MEMORY, SF_SMS_LPA_CMD_ERROR_SOURCE_OTHER);
printf("Error Memory line:%d i=%d\n", __LINE__, i);
ret = SMS_STATUS_FORMAT_ERR;
}
}
else
{
printf("Error Format2 line:%d i=%d\n", __LINE__, i);
ret = SMS_STATUS_FORMAT_ERR;
}
}
else
{
printf("Error Format3 line:%d i=%d\n", __LINE__, i);
ret = SMS_STATUS_NO_RESPONSE;
}
return ret;
}
/*************************************************
Function: sf_sms_read_message
Description: read message
@ -1526,35 +1681,41 @@ SINT32 sf_sms_read_message(void)
break;
}
*/
if(strstr((const char *)gsmPara, "$"))
if(strstr((const char *)gsmPara, "$R0e*"))//lpa cmd
{
strtok((char *)gsmPara, "$");
//strcpy((char *)strok, strtok(NULL, "$"));
snprintf((char *)strok, sizeof(strok), "%s", strtok(NULL, "$"));
//printf("strok:%s\n", strok);
Readmmsok = sf_sms_content_parse(gsmPara);
}
if(strlen((const char *)strok) > 0)
else
{
mm = 0;
pStr = (char *)strok;
//printf("pStr:%s\n", pStr);
temp = (UINT8 *)strsep(&pStr, "#");
while(temp != 0)
if(strstr((const char *)gsmPara, "$"))
{
//strcpy((char *)strValue[mm], (const char *)temp);
snprintf((char *)strValue[mm], sizeof(strValue[mm]), "%s", temp);
printf("strValue[%d]:%s\n", mm, strValue[mm]);
mm++;
temp = (UINT8 *)strsep(&pStr, "#");
strtok((char *)gsmPara, "$");
//strcpy((char *)strok, strtok(NULL, "$"));
snprintf((char *)strok, sizeof(strok), "%s", strtok(NULL, "$"));
//printf("strok:%s\n", strok);
}
if(strlen((const char *)strok) > 0)
{
mm = 0;
pStr = (char *)strok;
//printf("pStr:%s\n", pStr);
temp = (UINT8 *)strsep(&pStr, "#");
while(temp != 0)
{
//strcpy((char *)strValue[mm], (const char *)temp);
snprintf((char *)strValue[mm], sizeof(strValue[mm]), "%s", temp);
printf("strValue[%d]:%s\n", mm, strValue[mm]);
mm++;
temp = (UINT8 *)strsep(&pStr, "#");
}
}
Readmmsok = sf_message_data_processing(strValue, mm, &sms_send_mode);
}
Readmmsok = sf_message_data_processing(strValue, mm, &sms_send_mode);
printf("[%s:%d] getCmdFlag:%d Readmmsok:%d\n", __FUNCTION__, __LINE__, getCmdFlag, Readmmsok);
printf("[%s:%d] getCmdFlag:%d Readmmsok:%d\n", __FUNCTION__, __LINE__, getCmdFlag, Readmmsok);
if(getCmdFlag)
{
eSmsLocation = SMS_SIM_CMGR;

View File

@ -1275,9 +1275,20 @@ static SINT32 app_file_transfer(SF_FN_PARAM_S *pfnParam) {
SINT32 sf_cardv_file_to_app_send_thread(void) {
SINT32 s32ret = 0;
SF_FN_PARAM_S stpfncallback = {0};
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
if(SF_FAILURE == sf_check_sd())
{
MLOGE("ERROR sf_check_sd\n");
#if SF_NO_SD_SEND == ENABLE
if((0 == puiPara->SendType) && (0 == sf_usr_mem_photo_ch()))
{
s32ret = sf_mem_send_file_to_ftp();
return s32ret;
}
#endif
return SF_FAILURE;
}
stpfncallback.pstParam = sf_customer_param_get();
@ -1329,9 +1340,9 @@ SINT32 sf_file_send_auto(void) {
{
MLOGE("ERROR sf_check_sd\n");
#if SF_NO_SD_SEND == ENABLE
if( 0 == sf_usr_mem_photo_ch())
if((0 == puiPara->SendType) && (0 == sf_usr_mem_photo_ch()))
{
s32ret = sf_test_send_file_to_ftp();
s32ret = sf_mem_send_file_to_ftp();
return s32ret;
}
#endif
@ -1496,6 +1507,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
usleep(100*1000);
}
//to do: 首次升级之后需要删除LPA log
if(!sf_is_esim_card() || pCustomerParam->UpdateFlg)
{
if(pCustomerParam->UpdateFlg)
@ -1503,7 +1515,6 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
pCustomerParam->UpdateFlg = 0;
//sf_set_param_save_flag();
}
sf_sms_lpa_delete_lpa_log();
}
@ -1757,6 +1768,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
usleep(100*1000);
}
//to do:首次烧录后删除lpa log
if(!sf_is_esim_card() || pCustomerParam->UpdateFlg)
{
if(pCustomerParam->UpdateFlg)
@ -1806,6 +1818,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
snprintf((char *)pCustomerParam->SimIccidV, sizeof(pCustomerParam->SimIccidV), (char *)simIccidTmp[0]);
snprintf((char *)pCustomerParam->SimIccidA, sizeof(pCustomerParam->SimIccidA), (char *)simIccidTmp[1]);
// to do: 注网收到0,3的返回时返回SF_SIM_ERROR_REG_NET_REFUSE
s32ret = sf_4G_register_net_manual(pfnParam);
if(pCustomerParam->ProfileSwitchFlg)
@ -1839,7 +1852,7 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
if(s32ret == SF_SUCCESS)
sf_sms_lpa_set_send_lpa_log_flg(1);
// switch prlfile reboot in A reg net, reg 0,1 or reg 0,2, not need reboot again
// switch profile reboot in A reg net, reg 0,1 or reg 0,2, not need reboot again
pCustomerParam->NetWorkNeedSearch = 0;
}
}
@ -1874,6 +1887,12 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
}
}
//sf_share_mem_customer_down(1);
//to do :profile,reboot regnet,than send lpa log;log is exist
if(sf_sms_lpa_is_need_send_lpa_log())
{
sf_ftp_lpa_log_send();
}
break;
case SF_MCU_STARTUP_SYN_PARAM:
@ -1899,6 +1918,9 @@ static SINT32 app_Register_Net_startup_mode(SF_FN_PARAM_S *pfnParam)
set_at_parament();
sf_USB_net_init();
//to do : send lpa direct
sf_ftp_lpa_log_send();
if ((SF_ON == pCustomerParam->GpsSwitch) || (pCustomerParam->FristSendDailyAndGps))
{
const int KEEP_SERACHING_TIMEOUT_MS = 2000;
@ -2093,6 +2115,7 @@ SINT32 sf_app_to_cardv_hd_ture(void) {
return s32ret;
}
int sf_check_eth0(void)
{
FILE *fp;
@ -2110,7 +2133,16 @@ int sf_check_eth0(void)
free(output);
return 1;
}
fgets(output, len, fp);
// Check if fgets was successful
if (fgets(output, len, fp) == NULL) {
MLOGE("Error reading from ifconfig output\n");
pclose(fp);
free(output);
return 1;
}
// Check if usb0 exists
if (strstr(output, "eth0") == NULL) {
MLOGI("The network card does not exist\n");
pclose(fp);
@ -2118,7 +2150,15 @@ int sf_check_eth0(void)
return 1;
}
fgets(output, len, fp);
// Read the second line
if (fgets(output, len, fp) == NULL) {
MLOGE("Error reading from ifconfig output\n");
pclose(fp);
free(output);
return 1;
}
// Check if an IP address is assigned
if (strstr(output, "inet ") == NULL) {
MLOGI("The network card exists, but no IP address has been assigned\n");
pclose(fp);
@ -2126,11 +2166,17 @@ int sf_check_eth0(void)
return 1;
}
// Extract IP address
char *ip_address_start = strstr(output, "inet ") + strlen("inet ");
char *ip_address_end = strchr(ip_address_start, ' ');
*ip_address_end = '\0';
MLOGI("IP address of network card eth0: %s\n", ip_address_start);
// Check if ip_address_end is NULL before dereferencing
if (ip_address_end != NULL) {
*ip_address_end = '\0';
MLOGI("IP address of network card eth0: %s\n", ip_address_start);
} else {
MLOGE("Error extracting IP address\n");
}
pclose(fp);
free(output);
@ -2153,7 +2199,16 @@ int sf_check_usb0(void)
free(output);
return 1;
}
fgets(output, len, fp);
// Check if fgets was successful
if (fgets(output, len, fp) == NULL) {
MLOGE("Error reading from ifconfig output\n");
pclose(fp);
free(output);
return 1;
}
// Check if usb0 exists
if (strstr(output, "usb0") == NULL) {
MLOGI("The network card does not exist\n");
pclose(fp);
@ -2161,7 +2216,15 @@ int sf_check_usb0(void)
return 1;
}
fgets(output, len, fp);
// Read the second line
if (fgets(output, len, fp) == NULL) {
MLOGE("Error reading from ifconfig output\n");
pclose(fp);
free(output);
return 1;
}
// Check if an IP address is assigned
if (strstr(output, "inet ") == NULL) {
MLOGI("The network card exists, but no IP address has been assigned\n");
pclose(fp);
@ -2169,11 +2232,17 @@ int sf_check_usb0(void)
return 1;
}
// Extract IP address
char *ip_address_start = strstr(output, "inet ") + strlen("inet ");
char *ip_address_end = strchr(ip_address_start, ' ');
*ip_address_end = '\0';
MLOGI("IP address of network card usb0: %s\n", ip_address_start);
// Check if ip_address_end is NULL before dereferencing
if (ip_address_end != NULL) {
*ip_address_end = '\0';
MLOGI("IP address of network card usb0: %s\n", ip_address_start);
} else {
MLOGE("Error extracting IP address\n");
}
pclose(fp);
free(output);

View File

@ -942,26 +942,6 @@ UINT32 sf_create_dailyreport_file(void)
char imageSize = 0;
char videoSize = 0;
/*Avoid New Card*/
char *thumb_dir = sf_root_path_strcat(SF_THUMB_DIR);
if(thumb_dir == NULL)
{
free(thumb_dir);
return SF_FAILURE;
}
if (access(thumb_dir, F_OK) == -1) {
printf("%s directory does not exist. Creating...\n", thumb_dir);
if (mkdir(thumb_dir, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) == -1) {
perror("mkdir() error");
} else {
printf("%s directory created.\n", thumb_dir);
}
} else {
printf("%s directory exists.\n", thumb_dir);
}
free(thumb_dir);
//sf_create_thumb_dir();
if(SF_CAMID_ON == pPara->CamNameSwitch)
{
@ -1052,7 +1032,7 @@ UINT32 sf_create_dailyreport_file(void)
pPara->SimIccid, \
pSifarPara->TirgNum, \
pSifarPara->NewFlieCount, \
pSifarPara->picSendCount + pSifarPara->videoSendCount);
pSifarPara->TotalPicsSent);
sf_versionGet(localver,localfea);
temp = sf_battery_type_get();
@ -1085,13 +1065,13 @@ UINT32 sf_create_dailyreport_file(void)
"Thumbnail Transmission Time:%ld\r\n"
"Thumbnail Pics Sent:%ld\r\n"
"Thumbnail Pics Failed:%ld\r\n", \
pSifarPara->picSendSucessCount + (pSifarPara->videoSendCount - pSifarPara->videoSendFailCount), \
pSifarPara->picSendFailCount + pSifarPara->videoSendFailCount, \
pSifarPara->picSendTimeoutCount, \
pSifarPara->picSendTimeCount + pSifarPara->videoSendTimeCount, \
pSifarPara->sendThumbnailTimeCount, \
pSifarPara->sendThumbnailCount, \
pSifarPara->sendThumbnailFailCount);
pSifarPara->TotalPicsSuccess, \
pSifarPara->TotalPicsFailed, \
pSifarPara->TotalPicsTimeout, \
pSifarPara->TotalTransmissionTime, \
pSifarPara->ThumbnailTransmissionTime, \
pSifarPara->ThumbnailPicsSent, \
pSifarPara->ThumbnailPicsFailed);
sprintf((char *)szTmp2, "HD Transmission Time:%ld\r\n"
"HD Pics Sent:%ld\r\n"
@ -1103,12 +1083,12 @@ UINT32 sf_create_dailyreport_file(void)
"FW Ver:%s\r\n"
"Mod:%s\r\n"
"Power Type:%s\r\n", \
pSifarPara->picSendTimeCount - pSifarPara->sendThumbnailTimeCount, \
pSifarPara->picSendCount - pSifarPara->sendThumbnailCount,
pSifarPara->picSendFailCount - pSifarPara->sendThumbnailFailCount,\
pSifarPara->videoSendTimeCount, \
pSifarPara->videoSendCount, \
pSifarPara->videoSendFailCount, \
pSifarPara->HDTransmissionTime, \
pSifarPara->HDPicsSent,
pSifarPara->HDPicsFailed,\
pSifarPara->VideoTransmissionTime, \
pSifarPara->VideoSent, \
pSifarPara->VideoFaild, \
localfea, \
localver, \
pPara->ModuleSubver, \
@ -1287,20 +1267,14 @@ UINT32 sf_create_dailyreport_file(void)
printf("szTmp2=%s\n",szTmp2);
printf("cfgTmp:%s\n", cfgTmp);
char *dailyrp_file = sf_root_path_strcat(SF_DAILYREPORT_FILENAME);
if(dailyrp_file == NULL)
{
free(dailyrp_file);
return SF_FAILURE;
}
if(sf_file_IsExsit(dailyrp_file) == SF_TRUE){
sf_file_remove(dailyrp_file);
if(sf_file_IsExsit(SF_DAILYREPORT_FILENAME) == SF_TRUE){
sf_file_remove(SF_DAILYREPORT_FILENAME);
}
fd = open(dailyrp_file, O_APPEND | O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
fd = open(SF_DAILYREPORT_FILENAME, O_APPEND | O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
if(fd)
{
free(dailyrp_file);
szTmpsize=SF_STRLEN(szTmp);
//printf("szTmpsize=%d\n",szTmpsize);
write(fd, szTmp, szTmpsize);
@ -1786,15 +1760,14 @@ BOOL sf_check_auto_thumb_file(VOID)
fileCfg->filecnt = SendFileTotal;
for(fileIndex = 0; fileIndex < SendFileTotal; fileIndex++)
{
EmmcfileIndex--;
if((SF_CAM_MODE_PHOTO_VIDEO == (SendFileList[EmmcfileIndex][0] - '0')) || (SF_CAM_MODE_VIDEO2 == (SendFileList[EmmcfileIndex][0] - '0'))){
if((SF_CAM_MODE_PHOTO_VIDEO == (SendFileList[fileIndex][0] - '0')) || (SF_CAM_MODE_VIDEO2 == (SendFileList[fileIndex][0] - '0'))){
fileCfg->stfileattr[fileIndex].enFileTye = SF_FILE_TYPE_PIC_VIDEO;
}else if(SF_CAM_MODE_PHOTO == (SendFileList[EmmcfileIndex][0] - '0')){
}else if(SF_CAM_MODE_PHOTO == (SendFileList[fileIndex][0] - '0')){
fileCfg->stfileattr[fileIndex].enFileTye = SF_FILE_TYPE_PIC_SMALL;
}
snprintf(fileCfg->stfileattr[fileIndex].thumbfileName, sizeof(fileCfg->stfileattr[fileIndex].thumbfileName), "%s", &SendFileList[EmmcfileIndex][1]);
snprintf(fileCfg->stfileattr[fileIndex].thumbfileName, sizeof(fileCfg->stfileattr[fileIndex].thumbfileName), "%s", &SendFileList[fileIndex][1]);
snprintf(fileCfg->stfileattr[fileIndex].thumbfilePath, sizeof(fileCfg->stfileattr[fileIndex].thumbfilePath), "%s%s%s", SF_EMMC_ROOT, SF_SEND_LIST_DIR,
&SendFileList[EmmcfileIndex][1]);
&SendFileList[fileIndex][1]);
printf("%s:%d thumbfileSize:%d thumbfileName:%s thumbfilePath:%s\n", __FUNCTION__, __LINE__,
fileCfg->stfileattr[fileIndex].thumbfileSize,fileCfg->stfileattr[fileIndex].thumbfileName,fileCfg->stfileattr[fileIndex].thumbfilePath);
}

View File

@ -1242,6 +1242,21 @@ void sf_statistics_param_reset(SF_PDT_PARAM_STATISTICS_S *pSfPara)
pSfPara->SmsFlag = 0;
pSfPara->SmsNumber = 0;
pSfPara->TotalPicsSent = 0;
pSfPara->TotalPicsSuccess = 0;
pSfPara->TotalPicsFailed = 0;
pSfPara->TotalPicsTimeout = 0;
pSfPara->TotalTransmissionTime = 0;
pSfPara->ThumbnailTransmissionTime = 0;
pSfPara->ThumbnailPicsSent = 0;
pSfPara->ThumbnailPicsFailed = 0;
pSfPara->HDTransmissionTime = 0;
pSfPara->HDPicsSent = 0;
pSfPara->HDPicsFailed = 0;
pSfPara->VideoTransmissionTime = 0;
pSfPara->VideoSent = 0;
pSfPara->VideoFaild = 0;
memset(pSfPara->SmsStr, '\0', sizeof(pSfPara->SmsStr));
#ifdef SF_VERSION_RELEASE

View File

@ -951,7 +951,7 @@ int sf_app_sd_loop(void)
}
}
sprintf(cFileTmp,"%s%s/W%c%03d%04d.JPG", SF_EMMC_ROOT, SF_DCF_THM_DIR_NAME, SF_EMMC_DCF_HANDLE, nDirKey, nFileKey);
sprintf(cFileTmp,"%s%s/W%c%02d%04d.JPG", SF_EMMC_ROOT, SF_DCF_THM_DIR_NAME, SF_EMMC_DCF_HANDLE, nDirKey%100, nFileKey);
//MLOGD("Thumb Filename:%s\n", cFileTmp);
if(access(cFileTmp,R_OK) == 0)
{
@ -959,7 +959,7 @@ int sf_app_sd_loop(void)
remove(cFileTmp);
}
sprintf(cFileTmp,"%s%s/S%c%03d%04d.JPG", SF_EMMC_ROOT, SF_DCF_THM_DIR_NAME, SF_EMMC_DCF_HANDLE, nDirKey, nFileKey);
sprintf(cFileTmp,"%s%s/S%c%02d%04d.JPG", SF_EMMC_ROOT, SF_DCF_THM_DIR_NAME, SF_EMMC_DCF_HANDLE, nDirKey%100, nFileKey);
//MLOGD("Thumb Filename:%s\n", cFileTmp);
if(access(cFileTmp,R_OK) == 0)
{

View File

@ -442,7 +442,7 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
SF_PARA_TIME_S date = { 0 };
UINT8 PowerOnMode = sf_poweron_type_get();
SINT32 isUsb = sf_usb_IsInsert();
SINT32 isCard = sf_in_card_exist();
SINT32 isCard = 1;//sf_in_card_exist();
SINT32 isCardFull = sf_is_card_full();
//CameraBootSetting_t* pCameraBootSetting = CameraBootSettingGetHandle();
sf_set_sim_insert(1);//Remove hardware detection SIM card

View File

@ -1314,8 +1314,11 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.getThumbList.fileName);
if((pMsgStruct->msgBuf.getThumbList.diskType) && (Disk != pMsgStruct->msgBuf.getThumbList.diskType))
{
if(Disk)
{
memset(fileName,'\0', sizeof(fileName));
}
Disk = pMsgStruct->msgBuf.getThumbList.diskType;
memset(fileName,'\0', sizeof(fileName));
}
MLOGI("[WIFI_GET_CAMERA_THUMB_LIST],fileName:%s diskType:%d\n",fileName,pMsgStruct->msgBuf.getThumbList.diskType);
appCreatThumbList(fileName,pMsgStruct->msgBuf.getThumbList.diskType);

View File

@ -102,6 +102,7 @@ static void sen_set_cur_fps_os05b10(CTL_SEN_ID id, UINT32 fps);
static UINT32 sen_get_cur_fps_os05b10(CTL_SEN_ID id);
static void sen_set_chgmode_fps_os05b10(CTL_SEN_ID id, UINT32 fps);
static UINT32 sen_get_chgmode_fps_os05b10(CTL_SEN_ID id);
BOOL ae_preset_flag = FALSE; //sun chen@20240111
//=============================================================================
// global variable
//=============================================================================
@ -1472,8 +1473,16 @@ static ER sen_open_os05b10(CTL_SEN_ID id)
#if defined(__KERNEL__)
sen_i2c_reg_cb(sen_load_cfg_from_compatible_os05b10);
#endif
/*.............sun chen@20240111 start.................*/
if (ae_preset_flag == FALSE){
preset_ctrl[id].mode = ISP_SENSOR_PRESET_DEFAULT;
ae_preset_flag = TRUE;
}else {
preset_ctrl[id].mode = ISP_SENSOR_PRESET_CHGMODE;
}
/*.............sun chen@20240111 end.................*/
i2c_valid[id] = TRUE;
if ((!is_fastboot[id]) || (fastboot_i2c_id[id] != sen_i2c[id].id) || (fastboot_i2c_addr[id] != sen_i2c[id].addr)) {
rt = sen_i2c_init_driver(id, &sen_i2c[id]);

View File

@ -1181,12 +1181,12 @@ static UINT32 ae_adc_tbl[57][3] = {
{695, 333, 1000},
{694, 423, 1000},
{693, 539, 1000},
{691, 964, 1000},
{691, 806, 1000}, //sun chen@20240111 start
{689, 1082, 1000},
{687, 3606, 1000},
{684, 4038, 1000},//8333, 2150},
{681, 5755, 1000},//8333, 2550},
{679, 6187, 1000},
{687, 4038, 1000},
{684, 5755, 1000},//8333, 2150},
{681, 6187, 1000},//8333, 2550},
{679, 8333, 1000},//sun chen@20240111 end
{669, 8333, 1000},
{645, 8333, 1000},
{617, 8333, 1000},
@ -1200,11 +1200,11 @@ static UINT32 ae_adc_tbl[57][3] = {
{446, 16666, 2720},
{422, 16666, 2890},
{399, 16666, 3000},
{376, 16666, 3000},
{353, 16666, 3000},
{330, 16666, 3000},
{308, 16666, 3950},// 12190},
{286, 16666, 4210},// 26600},
{376, 16666, 2050},
{353, 16666, 1130},
{330, 16666, 1130},
{308, 16666, 2050},// 12190},
{286, 16666, 3000},// 26600},
{264, 16666, 4500}, //45770},
{242, 16666, 4740},
{220, 16666, 5100},

View File

@ -120,7 +120,7 @@ void sf_log_confgs(void)
{
#if (LOGFILE_FUNC==ENABLE)
UIMenuStoreInfo *puiPara = sf_ui_para_get();
if(puiPara->AutoLogSwitch)
if(puiPara->AutoLogSwitch && (!sf_is_usb_flag()))
{
DBG_WRN("SwTimer_Init\n");
SwTimer_Init(); // sw timer
@ -258,7 +258,7 @@ static void insmod_system(void)
#endif
}
sf_log_confgs();
vos_perf_list_mark("b_sys", __LINE__, 1);
}
@ -447,7 +447,7 @@ static void mcu_task(void)
vos_util_delay_ms(5);
sf_mcu_power_on_para_get(SF_MCU_POWERON);
sf_mcu_wdg_set(5);
//sf_mcu_wdg_set(5);
sf_mcu_reg_set(SF_MCU_CTRL_MODULE_PIR, 1);
//sf_battery_check_init();
sf_led_init();

View File

@ -27,7 +27,7 @@
#define MAX_OPENED_FILE_NUM 10
static THREAD_HANDLE task_hdl, task_hdl2;
int FileInitFalg = 0;
static void card_insert_job(void)
{
UINT32 uiPoolAddr;
@ -53,9 +53,16 @@ static void card_insert_job(void)
strncpy(Param.FSParam.szMountPath, "/mnt/sd", sizeof(Param.FSParam.szMountPath) - 1); //only used by FsLinux
Param.FSParam.szMountPath[sizeof(Param.FSParam.szMountPath) - 1] = '\0';
Param.FSParam.MaxOpenedFileNum = MAX_OPENED_FILE_NUM;
if (FST_STA_OK != FileSys_Init(FileSys_GetOPS_uITRON())) {
DBG_WRN("FileSys_Init failed\r\n");
}
if(!FileInitFalg)
{
if (FST_STA_OK != FileSys_Init(FileSys_GetOPS_uITRON())) {
DBG_WRN("FileSys_Init failed\r\n");
}
else {
FileInitFalg = 0;
}
}
ret = FileSys_OpenEx('A', StrgDXH, &Param);
if (FST_STA_OK != ret) {
DBG_WRN("FileSys_Open err %d\r\n", ret);
@ -67,17 +74,8 @@ static void card_insert_job(void)
SF_RtosStrgRegister(0, ret);
#endif
#if HUNTING_CAMERA_MCU == ENABLE
if(TRUE == sf_check_card_full())
{
DBG_WRN("ERR card full\r\n");
fastboot_set_done(BOOT_INIT_FILESYSOK);
}
else
{
fastboot_set_done(BOOT_INIT_FILESYSOK);
//sf_log_confg();
//sf_log_open();
}
sf_check_card_full();
fastboot_set_done(BOOT_INIT_FILESYSOK);
#endif
printf("filesys_init e\r\n");
@ -115,6 +113,15 @@ static void card_insert_job2(void)
strncpy(Param.FSParam.szMountPath, "/mnt/sd2", sizeof(Param.FSParam.szMountPath) - 1); //only used by FsLinux
Param.FSParam.szMountPath[sizeof(Param.FSParam.szMountPath) - 1] = '\0';
Param.FSParam.MaxOpenedFileNum = MAX_OPENED_FILE_NUM;
if(!FileInitFalg)
{
if (FST_STA_OK != FileSys_Init(FileSys_GetOPS_uITRON())) {
DBG_WRN("FileSys_Init failed\r\n");
}
else {
FileInitFalg = 0;
}
}
DBG_WRN("Open B:\n");
ret = FileSys_OpenEx('B', StrgDXH2, &Param);
if (FST_STA_OK != ret) {

View File

@ -45,6 +45,8 @@ static const INT32 EV_NUMERATOR[(EV_SETTING_MAX)] = {
-20//
};
UINT32 jpgexifiso=0,jpgexifexp=0;//sun chen@20240111
typedef struct {
UINT32 MakerNoteCheckID;
UINT16 TestData1;
@ -199,10 +201,10 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
UINT32 uiDzoomRatio[2] = {100, 100};
UINT16 uiSceneCaptureType = 0;
UINT16 uiSharpness = 0;
UINT32 RecID;
HD_RESULT hd_ret;
//UINT32 RecID;
//HD_RESULT hd_ret;
RecID = HandleID;//ImageApp_MovieMulti_VePort2Imglink(HandleID);
//RecID = HandleID;//ImageApp_MovieMulti_VePort2Imglink(HandleID);
//sprintf(UserComment, "EXIF_HDL_ID_%d", HandleID+1);
snprintf(UserComment, sizeof(UserComment), "EXIF_HDL_ID_%d", HandleID + 1);
@ -270,12 +272,12 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
// }
DBG_DUMP("uiPixelXDimension=%d, uiPixelYDimension=%d\r\n", uiPixelXDimension, uiPixelYDimension);
/*.............sun chen@20240111 start.................*/
/************** AE info **************/
{
UINT32 expo = 0;
float fexpo;
AET_STATUS_INFO status = {0};
//AET_STATUS_INFO status = {0};
#if 0//_TODO
AE_GetExifInfo(0, &uiISOSpeed, &expo, &uiAperture[0], &MaxAperture[0]);
#else
@ -284,6 +286,7 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
uiAperture[0] = 20;
MaxAperture[0] = 20;
#endif
/*
status.id=RecID;
if ((hd_ret = vendor_isp_init()) != HD_OK) {
DBG_ERR("vendor_isp_init() failed(%d)\r\n", hd_ret);
@ -293,11 +296,11 @@ void ExifVendor_WriteExifIFD(EXIF_HANDLE_ID HandleID)
}
if ((hd_ret = vendor_isp_uninit()) != HD_OK) {
DBG_ERR("vendor_isp_uninit() failed(%d)\r\n", hd_ret);
}
uiISOSpeed=status.status_info.iso_gain[0];
expo=status.status_info.expotime[0];
DBG_MSG("RecID=%d, uiISOSpeed=%d, expo=%d\r\n",RecID,uiISOSpeed,expo);
}*/
uiISOSpeed= jpgexifiso;//status.status_info.iso_gain[0];
expo=jpgexifexp;//status.status_info.expotime[0];
//DBG_MSG("RecID=%d, uiISOSpeed=%d, expo=%d\r\n",RecID,uiISOSpeed,expo);
/*.............sun chen@20240111 end.................*/
uiFNumber[0] = uiAperture[0];
uiAperture[0] = 20 * log2((float)uiAperture[0] / 10);

View File

@ -326,7 +326,10 @@ static void MovieFast_ShutDown(void)
}
#endif
//DBG_DUMP("wait filesys close ...\n");
FileSys_Close(FST_TIME_INFINITE);
//FileSys_Close(FST_TIME_INFINITE);
FileSys_CloseEx('A', FST_TIME_INFINITE);
FileSys_CloseEx('B', FST_TIME_INFINITE);
#if SF_IQ_TEST != ENABLE
if(sf_get_power_off_flag()){
sf_mcu_reg_set(SF_MCU_POWEROFF,0);
@ -914,15 +917,22 @@ INT32 MovieFast_Wait_FileSys(UINT32 timeout_ms)
// DBG_ERR("boot_init = BOOT_INIT_INVALID\n");
// return E_SYS;
// }
INT32 ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, timeout_ms);
INT32 ret = E_SYS;
if(gpio_getPin(GPIO_CARD_DETECT) == 0)
{
ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, timeout_ms);
}
INT32 ret2 = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK_2, timeout_ms);
// E_OK
if(ret == E_OK && ret2 == E_OK)
if(ret == E_OK || ret2 == E_OK)
{
return E_OK;
}
else {
fastboot_msg_en(ENABLE);
DBG_ERR("boot_init = BOOT_INIT_INVALID\n");
return E_SYS;
}
@ -932,7 +942,6 @@ INT32 MovieFast_Wait_FileNaming(UINT32 timeout_ms)
{
DCF_HANDLE handle = MovieFast_Get_DCF_Handle();
BOOT_INIT boot_init = BOOT_INIT_INVALID;
if(handle == g_dcf_hdl){
boot_init = BOOT_INIT_FILENAMINGOK;
}
@ -943,7 +952,9 @@ INT32 MovieFast_Wait_FileNaming(UINT32 timeout_ms)
#endif
if(boot_init != BOOT_INIT_INVALID)
{
return fastboot_wait_done_timeout(boot_init, timeout_ms);
}
else{
DBG_ERR("boot_init = BOOT_INIT_INVALID\n");
return E_SYS;
@ -1016,8 +1027,8 @@ static void MovieFast_FileNamingCB(MOVIE_CFG_REC_ID id, char *pFileName)
}
}
}
char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
//char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
DCF_MakeObjPathEx(handle, nextFolderID, nextFileID, DCF_FILE_TYPE_MP4, pFileName);
DCF_AddDBfileEx(handle, pFileName);
DBG_DUMP("%s added to DCF\r\n", pFileName);
@ -1049,11 +1060,20 @@ static void MovieFast_Manual_Raw_Task(void* arg)
HD_PATH_ID vprc_path = ImageApp_MovieMulti_GetVprcInPort(_CFG_REC_ID_1);
HD_RESULT ret;
HD_VIDEO_FRAME frame;
VOS_TICK t1, t2;
g_is_manual_raw_tsk_running = TRUE;
vos_perf_mark(&t1);
while(g_manual_raw_tsk_running)
{
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("failed timeout\n");
break;
}
ret = hd_videocap_pull_out_buf(vcap_path, &frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS);
if(ret != HD_OK){
DBG_ERR("hd_videocap_pull_out_buf failed!(%d)\n", ret);
@ -1074,9 +1094,17 @@ static void MovieFast_Manual_Raw_Task(void* arg)
continue;
}
}
vos_perf_mark(&t1);
while(1)
{
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (30*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("failed timeout\n");
break;
}
ret = hd_videocap_pull_out_buf(vcap_path, &frame, PHOTOFAST_HD_PUSH_PULL_TIMEOUT_MS);
if(ret != HD_OK){
DBG_ERR("hd_videocap_pull_out_buf failed!(%d)\n", ret);
@ -1285,6 +1313,8 @@ static void MovieFast_UserEventCb(UINT32 id, MOVIE_USER_CB_EVENT event_id, UINT3
MovieFast_FileNamingCB(id, pFileName);
}
else{
fastboot_msg_en(ENABLE);
DBG_ERR(" MovieFast_Wait_FileNaming err TIMEOUT\n");
vos_flag_set(MOVIEFAST_FLG_ID, FLGMOVIEFAST_SHUTDOWN);
}
}
@ -1311,7 +1341,7 @@ int MovieFast_GetWaterLogoSource(const UINT32 recWidth,WATERLOGO_BUFFER *waterSr
return E_OK;
}
static void MovieFast_FileNaming_Init(void)
static void MovieFast_FileNaming_Init(MMC_DEV_TYPE dev_type)
{
static UINT8 is_init = 0;
@ -1343,7 +1373,7 @@ static void MovieFast_FileNaming_Init(void)
DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV);
DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO);
DCF_SetDirFreeChars(DCF_DIR_NAME);
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, (dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME));
}
THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg)
@ -1355,40 +1385,57 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread(void *arg)
.WorkbuffAddr = mempool_dcf,
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
DCF_OPEN_PARM dcfParm2 = {
.Drive = 'B',
.WorkbuffAddr = mempool_dcf + POOL_SIZE_DCF_BUFFER,
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
//fastboot_wait_done(BOOT_INIT_FILESYSOK);
if(fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK)
INT32 ret = E_SYS;
if(gpio_getPin(GPIO_CARD_DETECT) == 0)
{
ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS);
}
INT32 ret2 = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK_2, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS);
if((TRUE != sf_is_emmc_full()) && (ret2 == E_OK))
{
MovieFast_FileNaming_Init(MMC_DEV_EMMC);
if(g_dcf_hdl2 == -1){
g_dcf_hdl2 = DCF_Open(&dcfParm2);
DCF_ScanObjEx(g_dcf_hdl2);
}
else{
DBG_WRN("dcf handle1 is already opened\n");
}
fastboot_set_done(BOOT_INIT_FILENAMINGOK_2);
}
else if((TRUE != sf_is_card_full()) && (ret == E_OK))
{
MovieFast_FileNaming_Init(MMC_DEV_SD);
if(g_dcf_hdl == -1){
g_dcf_hdl = DCF_Open(&dcfParm);
DCF_ScanObjEx(g_dcf_hdl);
}
else{
DBG_WRN("dcf handle1 is already opened\n");
}
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
}
else
{
fastboot_msg_en(ENABLE);
DBG_ERR(" FILESYS TIMEOUT failed\r\n");
THREAD_RETURN(1);
}
MovieFast_FileNaming_Init();
if(g_dcf_hdl == -1){
g_dcf_hdl = DCF_Open(&dcfParm);
DCF_ScanObjEx(g_dcf_hdl);
}
else{
DBG_WRN("dcf handle1 is already opened\n");
}
#if HUNTING_CAMERA_MCU == ENABLE
if(TRUE != sf_is_card_full())
#endif
{
#if USE_RTOS_MMC_CHECK
//SF_RtosStrgSetDcfHandle(MMC_DEV_EMMC, g_dcf_hdl);
#endif
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
}
}
}
THREAD_RETURN(0);
}
THREAD_RETTYPE MovieFast_InitFileNamingThread2(void *arg)
{
#if 0
if(DrvGPIO_GetPhotoMovieModeFromMonitor() != DX_HUNTING_MODE_PHOTO_MOVIE ){
#if (FS_MULTI_STRG_FUNC)
@ -1404,7 +1451,11 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread2(void *arg)
{
fastboot_msg_en(ENABLE);
DBG_ERR(" BOOT_INIT_FILESYSOK_2 TIMEOUT failed\r\n");
THREAD_RETURN(1);
if(fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK_2, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK)
{
DBG_ERR(" BOOT_INIT_FILESYSOK_2 TIMEOUT failed 2\r\n");
}
//THREAD_RETURN(1);
}
MovieFast_FileNaming_Init();
@ -1432,7 +1483,7 @@ THREAD_RETTYPE MovieFast_InitFileNamingThread2(void *arg)
}
#endif
}
#endif
THREAD_RETURN(0);
}
@ -1465,18 +1516,21 @@ static void MovieFast_Load_Sen_Cfg(MOVIEFAST_IQ_CFG cfg)
System_GetSensorInfo(i, SENSOR_IQ_SHADING_PATH, &(sen_cfg.iq_shading_path));
System_GetSensorInfo(i, SENSOR_IQ_DPC_PATH, &(sen_cfg.iq_dpc_path));
System_GetSensorInfo(i, SENSOR_IQ_LDC_PATH, &(sen_cfg.iq_ldc_path));
/*.............sun chen@20240111 start.................*/
if(cfg == MOVIEFAST_IQ_VIDEO){
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0_vid", size);
}
else{ /* MOVIEFAST_IQ_PHOTO */
if(sf_is_night_mode(0) ==TRUE)
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0", size);
if(sf_is_night_mode(1) ==TRUE)
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0_vid", size);
else
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0_cap", size);
}
else{ /* MOVIEFAST_IQ_PHOTO */
if(sf_is_night_mode(1) ==TRUE)
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0_vid", size);
else
strncpy(pSenCfg->iq_path.path, "/isp/iq/os05b10_iq_0_cap", size);
}
/*.............sun chen@20240111 end.................*/
ImageApp_MovieMulti_Config(MOVIE_CONFIG_SENSOR_INFO, (UINT32)&sen_cfg);
}
}
@ -1608,7 +1662,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
// UINT32 rec_type = MovieMapping_GetRecType(UI_GetData(FL_MOVIE_SIZE));
Movie_CommPoolInit();
/*.............sun chen@20240111 start.................*/
/*
if(DrvGPIO_GetPhotoMovieModeFromMonitor() == DX_HUNTING_MODE_MOVIE2){
//UI_SetData(FL_MOVIE_SIZE, MOVIE_SIZE_CLONE_1920x1080P30_1280x720P30);
@ -1619,7 +1674,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
Set_NIGHTMODE(0, 1);
//Set_AEMODE(0);
}
*/
/*.............sun chen@20240111 end.................*/
MovieFast_SetRecInfoByUISetting();
#if (_PACKAGE_DISPLAY_)
@ -1814,8 +1870,33 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
}
MovieFast_InstallID();
DBG_WRN(">>>>>>>>>>>>>>> movie thread <<<<<<<<<<\r\n");
// nvt_cmdsys_runcmd("ae set_speed 0 128 700 400 200 "); // dgain mode /dgain th/down speed/up speed1/up speed2
/*.............sun chen@20240111 end.................*/
{
AET_EXTEND_PARAM ext_param = {0};
ext_param.id = 0;
ext_param.ext_param.dgain_th = 128;
ext_param.ext_param.dgain_mode = 0;
ext_param.ext_param.down_speed = 970;
ext_param.ext_param.up_speed1 = 965;
ext_param.ext_param.up_speed2 = 800;
ext_param.ext_param.hdr_ev = 0;
ext_param.ext_param.fast_ae = 1;
vendor_isp_set_ae(AET_ITEM_EXT_PARAM, &ext_param);
}
{
AET_CONVERGENCE convergence = {0};
convergence.id = 0;
vendor_isp_get_ae(AET_ITEM_CONVERGENCE, &convergence);
// DBG_DUMP("==============to : %d %d \r\n", convergence.convergence.range_conv.h, convergence.convergence.range_conv.l);
convergence.convergence.skip_frame = 3;
vendor_isp_set_ae(AET_ITEM_CONVERGENCE, &convergence);
}
/*.............sun chen@20240111 end.................*/
nvt_cmdsys_runcmd("ae set_speed 0 128 700 700 100 ");
//nvt_cmdsys_runcmd("ae dbg 0 256 1 ");
HD_VIDEO_FRAME frame_capture = {0};
@ -1849,7 +1930,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
vprc_frm_cnt_ae_preset = vprc_frm_cnt;
DBG_DUMP("ae preset vprc frame cnt = %lu\n", vprc_frm_cnt_ae_preset);
Set_AEMODE(0);
//setet_preset_param();
//Set_NIGHTMODE(0, 0);
setet_preset_param(); //sun chen@20240111
}
}
@ -1878,14 +1960,22 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
DBG_DUMP("count = %llu, timestamp = %llu\n", frame.count, frame.timestamp);
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("failed timeout\n");
goto EXIT;
}
if( vcap_frm_cnt >= PHOTOFAST_START_CAP_FRAME_CNT ||
(ae_preset_flag == TRUE && vprc_frm_cnt >= (vprc_frm_cnt_ae_preset + 3))){
(ae_preset_flag == TRUE && vprc_frm_cnt >= (vprc_frm_cnt_ae_preset + 5))){
if(vcap_frm_cnt >= PHOTOFAST_START_CAP_FRAME_CNT){
DBG_DUMP("triggered by PHOTOFAST_START_CAP_FRAME_CNT\n");
}
else if(ae_preset_flag == TRUE && vprc_frm_cnt >= (vprc_frm_cnt_ae_preset + 3)){
else if(ae_preset_flag == TRUE && vprc_frm_cnt >= (vprc_frm_cnt_ae_preset + 5)){
DBG_DUMP("triggered by AE preset\n");
}
@ -1898,13 +1988,6 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
hd_videoproc_release_out_buf(alg_path, &frame);
}
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("failed timeout\n");
goto EXIT;
}
} while(1);
vos_perf_mark(&g_alg_end_time);
@ -1929,8 +2012,6 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
vos_task_resume(g_moviefast_raw_tsk_id);
}
vos_flag_set(MOVIEFAST_FLG_ID, FLGMOVIEFAST_RECSTART);
vos_perf_mark(&t1);
#if 1
@ -1942,7 +2023,15 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
UINT32 yuv_size = 0;
HD_PATH_ID alg_path = ImageApp_MovieMulti_GetAlgDataPort(_CFG_REC_ID_1, _CFG_ALG_PATH3);
UINT32 max_cnt , duration;
vos_perf_mark(&t2);
#if HUNTING_CAMERA_MCU == ENABLE
UIMenuStoreInfo *puiPara = sf_ui_para_get();
UINT32 led_delay = 170;
BOOL led_flag = FALSE;
BOOL ViewPullFlag = TRUE;
UINT32 period = 0;
VOS_TICK t3, t4;
#endif
MovieFast_fdt_get_info(&fdt_info);
if(MovieFast_fdt_get_tmp_buf(&fdt_info, &tmp_buf, &tmp_buf_size) != E_OK){
@ -1958,6 +2047,8 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
yuv_size = VDO_YUV_BUFSIZE(sensor_info->sSize.w, sensor_info->sSize.h , HD_VIDEO_PXLFMT_YUV420);
do {
vos_perf_mark(&t3);
if((tmp_buf + yuv_size) > (tmp_buf + tmp_buf_size)){
DBG_ERR("tmp buffer overflow!!\n");
goto EXIT;
@ -1980,7 +2071,15 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
tmp_buf += yuv_size;
hd_videoproc_release_out_buf(alg_path, &frame_capture);
#if HUNTING_CAMERA_MCU == ENABLE
sf_set_date_time_make_ymdhms();
led_flag = FALSE;
ViewPullFlag = TRUE;
if((SF_MULTISHOT_INTEVEL_0S != puiPara->MultiShotIntevel) && (sf_is_night_mode(0) ==TRUE)){
sf_ir_led_set(0, 0, 0, 0);
}
#endif
if(++cnt >= max_cnt)
break;
vos_perf_mark(&t2);
@ -1990,20 +2089,69 @@ THREAD_RETTYPE MovieFast_InitMovieModeThread(void *arg)
DBG_ERR("failed timeout\n");
goto EXIT;
}
vos_util_delay_ms(duration);
} while(1);
#if HUNTING_CAMERA_MCU == ENABLE
while(ViewPullFlag) {
if(TRUE == flow_preview_get_stop_flag()){
DBG_WRN("detected stop signal, power off ...\n");
goto EXIT;
}
vos_perf_mark(&t4);
period = vos_perf_duration(t3, t4) / 1000;
/**************************************************
* IR LED , 60 fps, 16.66 = 17
**************************************************/
if((period >= duration) ||((duration - period) <= (led_delay + 17))
){
if((SF_MULTISHOT_INTEVEL_0S != puiPara->MultiShotIntevel) && (FALSE == led_flag) && (sf_is_night_mode(0) ==TRUE)){
led_flag = TRUE;
sf_ir_led_set(((2 == puiPara->NightMode) ? 2 : 1),puiPara->FlashLed, puiPara->NightMode,0);
}
}
if(period >= (duration - 17))
{
ViewPullFlag = FALSE;
break;
}
else
{
vos_util_delay_ms(5);
continue;
}
}
#endif
} while(TRUE != flow_preview_get_stop_flag());
#endif
vos_perf_mark(&t2);
#if HUNTING_CAMERA_MCU == ENABLE
if(sf_is_night_mode(0) ==TRUE)
{
if((SF_MULTISHOT_INTEVEL_0S == puiPara->MultiShotIntevel)){
sf_ir_led_set(0, 0, 0, 0);
}
sf_ir_led_set(((2 == puiPara->NightMode) ? 2 : 1),puiPara->FlashLed, puiPara->NightMode, 1);
}
#endif
vos_flag_set(MOVIEFAST_FLG_ID, FLGMOVIEFAST_RECSTART);
Set_AEMODE(0); //sun chen@20240111
#if FIX_RECORD_NOISE == ENABLE
UINT32 elapse_time_ms = ((t2 - t1) / 1000);
// UINT32 elapse_time_ms = ((t2 - t1) / 1000);
CHKPNT;
if(elapse_time_ms < 300)
vos_util_delay_ms(300 - elapse_time_ms);
vos_util_delay_ms(300);
// if(elapse_time_ms < 300)
// vos_util_delay_ms(300 - elapse_time_ms);
ImageApp_MovieMulti_SetParam(0, MOVIEMULTI_PARAM_AUD_MUTE_ENC, FALSE);
#endif
@ -2119,13 +2267,13 @@ static void MovieFast_Close(void)
break;
}
else{
vos_util_delay_ms(1);
vos_util_delay_ms(5);
}
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("failed timeout\n");
DBG_ERR("failed es timeout\n");
goto EXIT;
}
}
@ -2142,10 +2290,15 @@ static void MovieFast_Close(void)
EXIT:
DCF_Close(g_dcf_hdl);
if(g_dcf_hdl >= 0){
DCF_Close(g_dcf_hdl);
g_dcf_hdl = -1;
}
#if (FS_MULTI_STRG_FUNC)
DCF_Close(g_dcf_hdl2);
if(g_dcf_hdl2 >= 0){
DCF_Close(g_dcf_hdl2);
g_dcf_hdl2 = -1;
}
#endif
DCF_UnInstallID();

View File

@ -1271,6 +1271,7 @@ void MovieStamp_CombineStamp(UINT32 vid_in, UINT32 bg_color)
HD_VIDEO_FRAME Img = {0};
UINT32 lineoff[HD_VIDEO_MAX_PLANE] = {0};
UINT32 addr[HD_VIDEO_MAX_PLANE] = {0};
UIMenuStoreInfo *puiPara = sf_ui_para_get();
char name[16];
INT16 cTemper = 0;
@ -1413,6 +1414,15 @@ void MovieStamp_CombineStamp(UINT32 vid_in, UINT32 bg_color)
padding,
&x_curr_ofs);
//camid stamp
if((puiPara->CamNameSwitch == SF_CAMID_ON) && (puiPara->CamNameStr[0] != '\0'))
{
snprintf((char *)customString, sizeof(customString), "%s", puiPara->CamNameStr);
DBG_IND("[%s:%d]customString=%s\n", __FUNCTION__, __LINE__, customString);
//sprintf(customString, "Cam1");
MovieStamp_AttachString(combined_stamp_h, &Img, customString, font, false, padding, &x_curr_ofs);
}
/*printf("[%s:%d]moon id=%d,battery id=%d\n", __FUNCTION__, __LINE__,
(LV_PLUGIN_IMG_ID_ICON_10200_MOON + moonday), (LV_PLUGIN_IMG_ID_ICON_10230_BATTERT + batValue));*/

View File

@ -41,8 +41,9 @@
#if HUNTING_CAMERA_MCU == ENABLE
#include <sf_mcu.h>
#include "sf_led.h"
#endif
#include "IOCfg.h"
#include "sf_sd_common.h"
#endif
#if POWERON_FAST_SLICE_ENC == ENABLE
@ -715,7 +716,7 @@ HD_RESULT PhotoFast_get_hd_common_buf(PPHOTOFAST_HD_COM_BUF p_hd_comm_buf)
return HD_OK;
}
static void PhotoFast_FileNaming_Init(void)
static void PhotoFast_FileNaming_Init(MMC_DEV_TYPE dev_type)
{
static UINT8 is_init = 0;
@ -730,7 +731,7 @@ static void PhotoFast_FileNaming_Init(void)
DCF_SetParm(DCF_PRMID_SET_VALID_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_MP4|DCF_FILE_TYPE_MOV);
DCF_SetParm(DCF_PRMID_SET_DEP_FILE_FMT, DCF_FILE_TYPE_JPG|DCF_FILE_TYPE_WAV|DCF_FILE_TYPE_MPO);
DCF_SetDirFreeChars(DCF_DIR_NAME);
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, DCF_FILE_NAME);
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, (dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME));
}
INT32 PhotoFast_FileNaming_Open(void)
@ -741,7 +742,7 @@ INT32 PhotoFast_FileNaming_Open(void)
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
PhotoFast_FileNaming_Init();
PhotoFast_FileNaming_Init(MMC_DEV_SD);
if(g_dcf_hdl == -1){
g_dcf_hdl = DCF_Open(&dcfParm);
@ -771,7 +772,7 @@ INT32 PhotoFast_FileNaming_Open2(void)
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
PhotoFast_FileNaming_Init();
PhotoFast_FileNaming_Init(MMC_DEV_EMMC);
if(g_dcf_hdl2 == -1){
g_dcf_hdl2 = DCF_Open(&dcfParm);
@ -980,11 +981,16 @@ INT32 PhotoFast_Wait_FileSys(UINT32 timeout_ms)
// boot_init = BOOT_INIT_FILESYSOK_2;
// }
// #endif
INT32 ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, timeout_ms);
INT32 ret = E_SYS;
if(gpio_getPin(GPIO_CARD_DETECT) == 0)
{
ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, timeout_ms);
}
INT32 ret2 = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK_2, timeout_ms);
// E_OK
if(ret == E_OK && ret2 == E_OK)
if(ret == E_OK || ret2 == E_OK)
{
return E_OK;
}
@ -1085,8 +1091,8 @@ INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId,
}
}
}
char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
//char *dcf_file = mmc_dev->dev_type == MMC_DEV_EMMC ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME;
//DCF_SetFileFreeChars(DCF_FILE_TYPE_ANYFORMAT, dcf_file);
DCF_MakeObjPathEx(handle, nextFolderID, nextFileID, fileType, FilePath);
DCF_AddDBfileEx(handle, FilePath);
DBG_DUMP("%s added to DCF\r\n", FilePath);
@ -1592,20 +1598,64 @@ static void PhotoFast_CaptureStart(HD_VIDEO_FRAME *p_video_frame)
THREAD_RETTYPE PhotoFast_InitFileNamingThread(void *arg)
{
DCF_OPEN_PARM dcfParm = {
.Drive = 'A',
.WorkbuffAddr = mempool_dcf,
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
DCF_OPEN_PARM dcfParm2 = {
.Drive = 'B',
.WorkbuffAddr = mempool_dcf + POOL_SIZE_DCF_BUFFER,
.WorkbuffSize = POOL_SIZE_DCF_BUFFER,
};
fastboot_wait_done(BOOT_INIT_FILESYSOK);
PhotoFast_FileNaming_Open();
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
INT32 ret = E_SYS;
if(gpio_getPin(GPIO_CARD_DETECT) == 0)
{
ret = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS);
}
INT32 ret2 = fastboot_wait_done_timeout(BOOT_INIT_FILESYSOK_2, FASTBOOT_WAIT_FILESYS_TIMEOUT_MS);
if((TRUE != sf_is_emmc_full()) && (ret2 == E_OK))
{
PhotoFast_FileNaming_Init(MMC_DEV_EMMC);
if(g_dcf_hdl2 == -1){
g_dcf_hdl2 = DCF_Open(&dcfParm2);
DCF_ScanObjEx(g_dcf_hdl2);
}
else{
DBG_WRN("dcf handle1 is already opened\n");
}
fastboot_set_done(BOOT_INIT_FILENAMINGOK_2);
}
else if((TRUE != sf_is_card_full()) && (ret == E_OK))
{
PhotoFast_FileNaming_Init(MMC_DEV_SD);
if(g_dcf_hdl == -1){
g_dcf_hdl = DCF_Open(&dcfParm);
DCF_ScanObjEx(g_dcf_hdl);
}
else{
DBG_WRN("dcf handle1 is already opened\n");
}
fastboot_set_done(BOOT_INIT_FILENAMINGOK);
}
else
{
fastboot_msg_en(ENABLE);
DBG_ERR(" FILESYS TIMEOUT failed\r\n");
}
THREAD_RETURN(0);
}
THREAD_RETTYPE PhotoFast_InitFileNamingThread2(void *arg)
{
fastboot_wait_done(BOOT_INIT_FILESYSOK_2);
PhotoFast_FileNaming_Open2();
fastboot_set_done(BOOT_INIT_FILENAMINGOK_2);
// fastboot_wait_done(BOOT_INIT_FILESYSOK_2);
// PhotoFast_FileNaming_Open2();
// fastboot_set_done(BOOT_INIT_FILENAMINGOK_2);
THREAD_RETURN(0);
}
@ -2210,7 +2260,9 @@ static void PhotoFast_ShutDown(void)
LogFile_Close();
}
#endif
FileSys_Close(FST_TIME_INFINITE);
// FileSys_Close(FST_TIME_INFINITE);
FileSys_CloseEx('A', FST_TIME_INFINITE);
FileSys_CloseEx('B', FST_TIME_INFINITE);
#if SF_IQ_TEST != ENABLE
if(sf_get_power_off_flag()){
sf_mcu_reg_set(SF_MCU_POWEROFF,0);

View File

@ -1924,6 +1924,7 @@ static lfqueue_t queue23 = {0};
INT32 PhotoFast_Sliceencode2_Enq_Frame(const HD_VIDEO_FRAME* video_frame)
{
static int cnt = 0;
if(lfqueue_size(&queue12) >= PHOTOFAST_SLICE_ENC_QUEUE12_MAX_SIZE){
return E_SYS;
}
@ -1935,6 +1936,12 @@ INT32 PhotoFast_Sliceencode2_Enq_Frame(const HD_VIDEO_FRAME* video_frame)
while (lfqueue_enq(&queue12, (void*) queue_ele_out) == -1)
{
cnt++;
if(cnt > 3)
{
fastboot_msg_en(ENABLE);
DBG_ERR("cnt%d timeout\n",cnt);
}
vos_util_delay_ms(1);
DBG_ERR("ENQ Full ?\r\n");
}
@ -1944,6 +1951,7 @@ INT32 PhotoFast_Sliceencode2_Enq_Frame(const HD_VIDEO_FRAME* video_frame)
INT32 PhotoFast_Sliceencode2_Stop(void)
{
static int cnt = 0;
PhotoFast_SliceEncode_Queue12_Param* queue_ele_out = NULL;
queue_ele_out = (PhotoFast_SliceEncode_Queue12_Param*) malloc(sizeof(PhotoFast_SliceEncode_Queue12_Param));
memset(queue_ele_out, 0, sizeof(PhotoFast_SliceEncode_Queue12_Param));
@ -1951,6 +1959,12 @@ INT32 PhotoFast_Sliceencode2_Stop(void)
while (lfqueue_enq(&queue12, (void*) queue_ele_out) == -1)
{
cnt++;
if(cnt > 3)
{
fastboot_msg_en(ENABLE);
DBG_ERR("cnt%d timeout\n",cnt);
}
vos_util_delay_ms(1);
DBG_ERR("ENQ Full ?\r\n");
}
@ -1978,6 +1992,7 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
UINT32 enc_accum_size = 0;
static UINT8 primary_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_PRIMARY;
static UINT8 screennail_quality = CFG_PHOTOFAST_SLICE_ENC_INIT_QUALITY_SCREENNAIL;
VOS_TICK t1, t2;
if(!user_data){
DBG_ERR("user_data can't be null!\n");
@ -2034,8 +2049,17 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
if(PhotoFast_SliceEncode_Alloc_Buffer(&exif_mem_info, "slice_enc_exif") != E_OK)
goto EXIT;
vos_perf_mark(&t1);
do{
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (30*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("sfailed timeout\n");
goto EXIT;
}
queue_ele_in = (PhotoFast_SliceEncode_Queue12_Param*)lfqueue_deq(param->queue12);
if(queue_ele_in == NULL){
vos_util_delay_ms(1);
@ -2214,9 +2238,16 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
DCF_AddDBfile(queue_ele_out->file_path);
DBG_DUMP("%s added to DCF\r\n", queue_ele_out->file_path);
#endif
vos_perf_mark(&t1);
while(1)
{
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("2failed timeout\n");
goto EXIT;
}
if(lfqueue_size(param->queue23) >= PHOTOFAST_SLICE_ENC_QUEUE23_MAX_SIZE){
vos_util_delay_ms(1);
continue;
@ -2224,6 +2255,13 @@ INT32 PhotoFast_SliceEncode_CB2(void* user_data)
else{
while (lfqueue_enq(param->queue23, (void*) queue_ele_out) == -1)
{
vos_perf_mark(&t2);
if((vos_perf_duration(t1, t2) / 1000) > (20*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("23failed timeout\n");
goto EXIT;
}
DBG_ERR("ENQ Full ?\r\n");
vos_util_delay_ms(5);
}
@ -2291,6 +2329,7 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
PhotoFast_SliceEncode_CB3_Param* param = NULL;
PhotoFast_SliceEncode_Queue23_Param* queue_ele_in = NULL;
VOS_TICK t1, t2, t3, t4;
VOS_TICK t5, t6;
if(!user_data){
DBG_ERR("user_data can't be null!\n");
@ -2301,8 +2340,16 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
param = (PhotoFast_SliceEncode_CB3_Param*) user_data;
param->cnt = 0;
do{
vos_perf_mark(&t5);
do{
vos_perf_mark(&t6);
if((vos_perf_duration(t5, t6) / 1000) > (30*1000))
{
fastboot_msg_en(ENABLE);
DBG_ERR("erfailed timeout\n");
goto EXIT;
}
queue_ele_in = (PhotoFast_SliceEncode_Queue23_Param*)lfqueue_deq(param->queue23);
if(queue_ele_in == NULL){
vos_util_delay_ms(1);
@ -2320,19 +2367,10 @@ INT32 PhotoFast_SliceEncode_CB3(void* user_data)
* Output jpg file
******************************************************************/
extern INT32 PhotoFast_WriteFile(UINT32 Addr, UINT32 Size, UINT32 Fmt, UINT32 uiPathId, char* Path);
INT32 waitFalg = 0;
#if SF_NO_SD_SEND == ENABLE
// if(
// PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK &&
// PhotoFast_Wait_FileNaming(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK)
if(PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK){
if(PhotoFast_Wait_FileNaming(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK){
waitFalg = 1;
}
}
if(waitFalg)
if(
PhotoFast_Wait_FileSys(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK &&
PhotoFast_Wait_FileNaming(FASTBOOT_WAIT_FILESYS_TIMEOUT_MS) != E_OK)
{
DBG_WRN("filesys not ready, store data into mem\n");

View File

@ -1422,7 +1422,7 @@ UINT8 sf_mcu_reg_set(MCUParam_t attrId, UINT8 val)
if(attrId != SF_MCU_CTRL_MODULE_PIR)//AND LDS SECTION_01 loading order.
{
isUsb = sf_is_usb_flag();
isCard = sf_in_card_exist();
isCard = 1;//sf_in_card_exist();
isCardFull = sf_is_card_full();
PowerOnMode = sf_get_power_on_mode();
if(APP_POWER_OFF_BATT_EMPTY == sf_get_power_off_flag())
@ -1769,6 +1769,10 @@ UINT8 sf_mcu_reg_set(MCUParam_t attrId, UINT8 val)
mcuReg[i] = DAILY_SEND4_MINUTE;
mcuData[i++] = puiPara->TimeSend4.Min;
}else if(attrId == SF_MCU_CTRL_MODULE_PIR){
mcuReg[i] = WDT_TIME;
mcuData[i++] = 5;//sf_mcu_wdg_set(5);
mcuReg[i] = ANALOG_PIR_SENSITIVITY;
temp = (puiPara->PirSensitivity);//sf_mcu_analog_pir_sen_convert(SysGetFlag(DigPirSensitivity));

View File

@ -234,8 +234,8 @@ typedef struct _AE_EXTEND_PARAM {
UINT32 down_speed;
UINT32 up_speed1;
UINT32 up_speed2;
UINT32 reserved2;
UINT32 reserved3;
UINT32 hdr_ev;
BOOL fast_ae;
UINT32 reserved4[AEALG_DYNAMIC_LV_NUM];
UINT32 reserved5[AEALG_DYNAMIC_LV_NUM];
UINT32 reserved6[AEALG_DYNAMIC_LV_NUM];