1.修改4G业务;2.更新iq;3.调整关机流程
This commit is contained in:
parent
64d84d3e45
commit
5ba773299f
|
@ -23,7 +23,9 @@
|
||||||
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass
|
#define __DBGFLT__ "*" //*=All, [mark]=CustomClass
|
||||||
#include <kwrap/debug.h>
|
#include <kwrap/debug.h>
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
#include "sf_mcu.h"
|
||||||
|
#endif
|
||||||
extern VControl SystemObjCtrl;
|
extern VControl SystemObjCtrl;
|
||||||
extern VControl UISetupObjCtrl;
|
extern VControl UISetupObjCtrl;
|
||||||
extern VControl *gUxCtrlTypeList[];
|
extern VControl *gUxCtrlTypeList[];
|
||||||
|
@ -147,19 +149,25 @@ INT32 System_GetBootFirstMode(void)
|
||||||
#if !UI_SENSOR
|
#if !UI_SENSOR
|
||||||
|
|
||||||
#if HUNTING_CAMERA_MCU == ENABLE
|
#if HUNTING_CAMERA_MCU == ENABLE
|
||||||
|
UINT8 PowerOnMode = sf_cardv_convert_power_on_mode();
|
||||||
|
|
||||||
printf("%s:%d CamMode :%d\n", __FUNCTION__, __LINE__,puiPara->CamMode);
|
printf("%s:%d CamMode :%d\n", __FUNCTION__, __LINE__,puiPara->CamMode);
|
||||||
if(SF_CAM_MODE_PHOTO == puiPara->CamMode)
|
if(PWR_ON_SETUP != PowerOnMode)
|
||||||
{
|
{
|
||||||
return PRIMARY_MODE_PHOTO;
|
return PRIMARY_MODE_TRANSCODE;
|
||||||
}
|
}
|
||||||
else if(SF_CAM_MODE_VIDEO == puiPara->CamMode)
|
else if(SF_CAM_MODE_PHOTO == puiPara->CamMode)
|
||||||
{
|
{
|
||||||
return PRIMARY_MODE_MOVIE;
|
return PRIMARY_MODE_PHOTO;
|
||||||
}
|
}
|
||||||
else
|
else if(SF_CAM_MODE_VIDEO == puiPara->CamMode)
|
||||||
{
|
{
|
||||||
return PRIMARY_MODE_PHOTO;//PRIMARY_MODE_MOVIE;
|
return PRIMARY_MODE_MOVIE;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return PRIMARY_MODE_PHOTO;//PRIMARY_MODE_MOVIE;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
printf("%s:%d CamMode :%d\n", __FUNCTION__, __LINE__,SysGetFlag(CamMode));
|
printf("%s:%d CamMode :%d\n", __FUNCTION__, __LINE__,SysGetFlag(CamMode));
|
||||||
if(SF_CAM_MODE_PHOTO == SysGetFlag(CamMode))
|
if(SF_CAM_MODE_PHOTO == SysGetFlag(CamMode))
|
||||||
|
|
|
@ -39,13 +39,14 @@ static char* usb_host_drivers[] = {
|
||||||
"kernel/drivers/usb/host/ehci-hcd.ko",
|
"kernel/drivers/usb/host/ehci-hcd.ko",
|
||||||
"kernel/drivers/net/mii.ko",
|
"kernel/drivers/net/mii.ko",
|
||||||
"kernel/drivers/net/usb/usbnet.ko",
|
"kernel/drivers/net/usb/usbnet.ko",
|
||||||
|
"extra/net/GobiNet/drv_gobi_net.ko",
|
||||||
|
"kernel/drivers/net/usb/cdc_ether.ko",
|
||||||
|
"kernel/drivers/net/usb/rndis_host.ko",
|
||||||
"kernel/drivers/usb/serial/usbserial.ko",
|
"kernel/drivers/usb/serial/usbserial.ko",
|
||||||
"kernel/drivers/usb/serial/usb_wwan.ko",
|
"kernel/drivers/usb/serial/usb_wwan.ko",
|
||||||
"kernel/drivers/usb/serial/option.ko",
|
"kernel/drivers/usb/serial/option.ko",
|
||||||
"kernel/drivers/net/usb/cdc_ether.ko",
|
|
||||||
"kernel/drivers/usb/class/cdc-wdm.ko",
|
"kernel/drivers/usb/class/cdc-wdm.ko",
|
||||||
"kernel/drivers/net/usb/qmi_wwan.ko",
|
"kernel/drivers/net/usb/qmi_wwan.ko",
|
||||||
"extra/net/GobiNet/drv_gobi_net.ko",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2464,7 +2464,7 @@ INT32 PhotoExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray)
|
||||||
// g_photo_ImageRatioSize = IMAGERATIO_SIZE[4];
|
// g_photo_ImageRatioSize = IMAGERATIO_SIZE[4];
|
||||||
FileSys_MakeDir(PHOTO_THUMB_PATH);
|
FileSys_MakeDir(PHOTO_THUMB_PATH);
|
||||||
#if SF_IQ_TEST != ENABLE
|
#if SF_IQ_TEST != ENABLE
|
||||||
FileSys_SetAttrib(PHOTO_THUMB_PATH, FST_ATTRIB_HIDDEN | FST_ATTRIB_SYSTEM, TRUE);
|
FileSys_SetAttrib(PHOTO_THUMB_PATH, FST_ATTRIB_HIDDEN/* | FST_ATTRIB_SYSTEM*/, TRUE);
|
||||||
#endif
|
#endif
|
||||||
GOIO_Turn_Onoff_IRCUT(1);
|
GOIO_Turn_Onoff_IRCUT(1);
|
||||||
|
|
||||||
|
|
|
@ -189,7 +189,7 @@
|
||||||
#define DEFAULT_NET_WORK_NEED_SEARCH SF_ON
|
#define DEFAULT_NET_WORK_NEED_SEARCH SF_ON
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_GPRS_SWITCH SF_OFF
|
#define DEFAULT_GPRS_SWITCH SF_ON
|
||||||
#define DEFAULT_BATTERY_TYPE SF_BATT_ALKALINE
|
#define DEFAULT_BATTERY_TYPE SF_BATT_ALKALINE
|
||||||
#define DEFAULT_WORKTIME_SWITCH SF_OFF
|
#define DEFAULT_WORKTIME_SWITCH SF_OFF
|
||||||
#define DEFAULT_SIM_AUTO_SWITCH SF_SIM_SWITCH_AUTO
|
#define DEFAULT_SIM_AUTO_SWITCH SF_SIM_SWITCH_AUTO
|
||||||
|
|
|
@ -377,6 +377,8 @@ UINT8 sf_get_fw_update(void);
|
||||||
void sf_set_fw_update(UINT8 flag);
|
void sf_set_fw_update(UINT8 flag);
|
||||||
void sf_set_gprs_errno(SINT32 value);
|
void sf_set_gprs_errno(SINT32 value);
|
||||||
SINT32 sf_get_gprs_errno(void);
|
SINT32 sf_get_gprs_errno(void);
|
||||||
|
BOOL sf_get_signal_ready_flag(void);
|
||||||
|
void sf_set_signal_ready_flag(BOOL Flag);
|
||||||
extern unsigned short TrigType;
|
extern unsigned short TrigType;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -266,7 +266,7 @@ void sf_gprs_init(UINT32 param);
|
||||||
|
|
||||||
void sf_4g_module_sleep(void);
|
void sf_4g_module_sleep(void);
|
||||||
|
|
||||||
void sf_4g_set_module_minimun_fun(void);
|
SINT32 sf_4g_set_module_minimun_fun(void);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
|
|
|
@ -33,6 +33,9 @@ BOOL sf_is_enough_power_to_update(void);
|
||||||
|
|
||||||
BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname);
|
BOOL sf_is_4g_module_usb_update_file_exist(UINT8 *updateFname);
|
||||||
|
|
||||||
|
void sf_set_del_flag(BOOL flag);
|
||||||
|
|
||||||
|
BOOL sf_get_del_flag(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ SINT32 sf_file_size_get(SF_CHAR *filePath,UINT32 *pFileSize);
|
||||||
|
|
||||||
BOOL sf_check_auto_thumb_file(VOID);
|
BOOL sf_check_auto_thumb_file(VOID);
|
||||||
UINT8 sf_get_send_file_list(char *sendfileList, UINT8 *fileTotal);
|
UINT8 sf_get_send_file_list(char *sendfileList, UINT8 *fileTotal);
|
||||||
|
UINT8 sf_get_send_file_total(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -214,5 +214,6 @@ SINT32 sf_simcom_ftp_send(UINT8 mode);
|
||||||
SINT32 sf_4g_module_ota_ftp(void);
|
SINT32 sf_4g_module_ota_ftp(void);
|
||||||
UINT32 sf_connect_ftps_server(void);
|
UINT32 sf_connect_ftps_server(void);
|
||||||
UINT32 sf_camera_ota_ftp(void);
|
UINT32 sf_camera_ota_ftp(void);
|
||||||
|
SINT32 sf_concentrated_ftp_send(void);
|
||||||
#endif /*_SF_FTP_H_*/
|
#endif /*_SF_FTP_H_*/
|
||||||
|
|
||||||
|
|
|
@ -483,7 +483,7 @@ typedef enum sf_WIFI_MESSAGE_TYPE_E
|
||||||
SF_WIFI_CMD_START = 0x1A00,
|
SF_WIFI_CMD_START = 0x1A00,
|
||||||
SF_WIFI_CMD_STOP = 0x1B00,
|
SF_WIFI_CMD_STOP = 0x1B00,
|
||||||
SF_WIFI_CMD_RESTART = 0x1C00,
|
SF_WIFI_CMD_RESTART = 0x1C00,
|
||||||
|
SF_WIFI_CMD_CAPTURE = 0x1D00,
|
||||||
|
|
||||||
}SF_WIFI_MESSAGE_TYPE_E;
|
}SF_WIFI_MESSAGE_TYPE_E;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ SINT32 app_file_subscrible_check(SF_REPORT_FILE_ATTR_S *pDtsReportFileAttr,SF_RE
|
||||||
SINT32 app_RegisterNet_start(void);
|
SINT32 app_RegisterNet_start(void);
|
||||||
void app_FileSend_start(void);
|
void app_FileSend_start(void);
|
||||||
SINT32 app_t110(void);
|
SINT32 app_t110(void);
|
||||||
|
SINT32 sf_app_to_cardv_capture(void);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,5 +259,6 @@ SINT32 sf_power_off_check_fw_update(void);
|
||||||
SINT32 sf_power_off_check_module_sleep(void);
|
SINT32 sf_power_off_check_module_sleep(void);
|
||||||
SINT32 sf_power_off_check_camera_restart(void);
|
SINT32 sf_power_off_check_camera_restart(void);
|
||||||
SINT32 sf_power_off_check_ui_para_sava(void);
|
SINT32 sf_power_off_check_ui_para_sava(void);
|
||||||
|
UINT8 sf_sms_check_send(void);
|
||||||
#endif /*_SF_SMS_H_*/
|
#endif /*_SF_SMS_H_*/
|
||||||
|
|
||||||
|
|
|
@ -4070,7 +4070,7 @@ UINT32 sf_sim_qsclk(UINT8 mode) //mode = 2, gprsmode = 1
|
||||||
|
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
if(SUCCESS != app_ttyusb_IsOpen())
|
/*if(SUCCESS != app_ttyusb_IsOpen())
|
||||||
{
|
{
|
||||||
printf("%s:%d tty usb err", __FUNCTION__, __LINE__);
|
printf("%s:%d tty usb err", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
|
@ -4078,9 +4078,7 @@ UINT32 sf_sim_qsclk(UINT8 mode) //mode = 2, gprsmode = 1
|
||||||
{
|
{
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
sf_gsm_para_buff_clear();
|
|
||||||
|
|
||||||
while(sf_app_while_flag())
|
while(sf_app_while_flag())
|
||||||
{
|
{
|
||||||
|
@ -4190,45 +4188,95 @@ void sf_4g_module_sleep(void)
|
||||||
Return: N/A
|
Return: N/A
|
||||||
Others: N/A
|
Others: N/A
|
||||||
*************************************************/
|
*************************************************/
|
||||||
void sf_4g_set_module_minimun_fun(void)
|
SINT32 sf_4g_set_module_minimun_fun(void)
|
||||||
{
|
{
|
||||||
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
SINT32 ret = 0; //0:start; 1:success; 2:timeout; 3:fail;
|
||||||
UINT8 time = 25;
|
UINT8 time = 0;
|
||||||
UINT8 responseOk = 0;
|
UINT8 calltime = 0;
|
||||||
|
SF_SIM_E eSmsLocation = SMS_SIM_INIT_DTRUP;
|
||||||
|
int ttyRet = 0;
|
||||||
|
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||||
|
|
||||||
printf("%s", __FUNCTION__);
|
printf("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
if(/*(pPara->GpsSwitch) && */(pPara->NeedTimeSyncStartUp == 1) || pPara->FristSendDailyAndGps)
|
if(/*(pPara->GpsSwitch) && */(pPara->NeedTimeSyncStartUp == 1) || pPara->FristSendDailyAndGps)
|
||||||
{
|
{
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
SF_STRCPY(gsmPara, "AT+CGATT=0\r");
|
|
||||||
sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
|
||||||
|
|
||||||
while(time--)
|
sf_gsm_para_buff_clear();
|
||||||
|
|
||||||
|
strcpy((char *)gsmPara, "AT+CGATT=0\r");
|
||||||
|
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
||||||
|
|
||||||
|
while(sf_app_while_flag())
|
||||||
{
|
{
|
||||||
sf_hal_ttyusb2_read(gsmPara, 200);
|
time++;
|
||||||
|
|
||||||
if(SF_STRSTR(gsmPara, "OK"))
|
if(time >= 100)
|
||||||
{
|
{
|
||||||
printf("set CGATT=%s\n", gsmPara);
|
ret = SF_SIM_ERROR_AT_TIMEOUT;
|
||||||
responseOk = 1;
|
sprintf((char *)logStr, "ReadMsg Wait Init Timeout.\n[ERROR]eSmsLocation=%d", eSmsLocation);
|
||||||
break;
|
SLOGE(logStr);
|
||||||
|
time = 0;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
sf_gsm_para_buff_clear();
|
||||||
|
|
||||||
|
sf_hal_ttyusb2_read(gsmPara, 200);
|
||||||
|
if(gsmPara[0] != '\0')
|
||||||
|
{
|
||||||
|
printf("[%s:%d]eSmsLocation:%d\ngsmPara:%s\n", __FUNCTION__, __LINE__, eSmsLocation, gsmPara);
|
||||||
|
}
|
||||||
|
switch(eSmsLocation)
|
||||||
|
{
|
||||||
|
case SMS_SIM_INIT_DTRUP:
|
||||||
|
|
||||||
|
if(strstr((const char *)gsmPara, "OK"))
|
||||||
|
{
|
||||||
|
strcpy((char *)gsmPara, "AT+CFUN=0\r"); //sleep
|
||||||
|
ttyRet = sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
||||||
|
SF_CHECK_RETURN(ttyRet, SF_SIM_ERROR_AT_TIMEOUT);
|
||||||
|
eSmsLocation = SMS_SIM_INIT_EXIT;
|
||||||
|
}
|
||||||
|
else if(strstr((const char *)gsmPara, "ERROR"))
|
||||||
|
{
|
||||||
|
goto SF_FUN_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case SMS_SIM_INIT_EXIT:
|
||||||
|
|
||||||
|
if(strstr((const char *)gsmPara, "OK"))
|
||||||
|
{
|
||||||
|
goto SF_FUN_RETURN;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
calltime++;
|
||||||
|
|
||||||
|
if(calltime > 20)
|
||||||
|
{
|
||||||
|
ret = SF_SIM_ERROR_AT_TIMEOUT;
|
||||||
|
sprintf((char *)logStr, "[%s:%d]ErrorCode=0x%08x,AT+QSCLK Timeout.", __FUNCTION__, __LINE__, ret);
|
||||||
|
SLOGE(logStr);
|
||||||
|
goto SF_FUN_RETURN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(responseOk)
|
SF_FUN_RETURN:
|
||||||
{
|
|
||||||
SF_STRCPY(gsmPara, "AT+CFUN=0\r");
|
printf("[%s:%d] ret:%d\n", __FUNCTION__, __LINE__, ret);
|
||||||
sf_hal_ttyusb2_write(gsmPara, strlen(gsmPara));
|
return ret;
|
||||||
sf_hal_ttyusb2_read(gsmPara, 200);
|
|
||||||
printf("set minimun_fun=%s\n", gsmPara);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("AT+CGATT timeout\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ extern "C" {
|
||||||
#include "sf_ftp.h"
|
#include "sf_ftp.h"
|
||||||
#include "sf_fileMng.h"
|
#include "sf_fileMng.h"
|
||||||
#include "sf_file.h"
|
#include "sf_file.h"
|
||||||
|
#include "sf_storeMng.h"
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* C O N S T A N T S *
|
* C O N S T A N T S *
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
@ -3295,6 +3295,130 @@ UINT32 sf_camera_ota_ftp(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
Function: sf_concentrated_ftp_send
|
||||||
|
Description: ftp send.
|
||||||
|
Input: 1:send pic/video. 2:send dr.
|
||||||
|
Output: N/A
|
||||||
|
Return: 0:success; else:fail;
|
||||||
|
Others: N/A
|
||||||
|
*************************************************/
|
||||||
|
SINT32 sf_concentrated_ftp_send(void)
|
||||||
|
{
|
||||||
|
SINT32 ret1 = SF_SUCCESS; //0:success; else:fail;
|
||||||
|
SINT32 ret2 = SF_SUCCESS; //0:success; else:fail;
|
||||||
|
UINT8 ssl = 0;
|
||||||
|
UINT8 gprsMode = 0;
|
||||||
|
UINT8 timeout = 100;
|
||||||
|
UINT8 piccount = 0;
|
||||||
|
UINT8 SendFileTotal = 0;
|
||||||
|
UINT8 battery = 0;
|
||||||
|
UIMenuStoreInfo *pPara = sf_app_ui_para_get();
|
||||||
|
SF_PDT_PARAM_STATISTICS_S *pSifarPara = sf_statistics_param_get();
|
||||||
|
|
||||||
|
SF_SRCFILE_ATTR_S *pThumbFileCfg = sf_file_thumb_cfg_get();
|
||||||
|
|
||||||
|
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
|
SendFileTotal = sf_get_send_file_total();
|
||||||
|
ssl = ((2 == pPara->FtpSwitch) ? 1 : 0);
|
||||||
|
gprsMode = 0;//puiPara->GprsMode;
|
||||||
|
printf("[%s:%d] ssl:%d,GprsMode:%d SendFileTotal:%d\n", __FUNCTION__, __LINE__, ssl, gprsMode, SendFileTotal);
|
||||||
|
|
||||||
|
UINT8 ftpFileName[64] = { 0 };
|
||||||
|
UINT8 filePath[64] = { 0 };
|
||||||
|
UINT8 CamNameStr[64] = {0};
|
||||||
|
char cameraID[64] = { 0 };
|
||||||
|
|
||||||
|
SINT32 ret = SF_SUCCESS;
|
||||||
|
|
||||||
|
UINT8 csqlevel = 0;
|
||||||
|
|
||||||
|
|
||||||
|
sf_custom_str_get(CamNameStr);
|
||||||
|
sf_4G_signal_level_get(pPara->NetGeneration,sf_get_cq_signal(),&csqlevel);
|
||||||
|
|
||||||
|
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
||||||
|
|
||||||
|
if(SF_SUCCESS == ret1)
|
||||||
|
{
|
||||||
|
while((sf_app_while_flag()) && (((piccount+1) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
||||||
|
{
|
||||||
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%s", pThumbFileCfg->stfileattr[piccount].thumbfileName);
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "%s", pThumbFileCfg->stfileattr[piccount].thumbfilePath);
|
||||||
|
|
||||||
|
sf_set_del_flag(FALSE);
|
||||||
|
ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName);
|
||||||
|
|
||||||
|
if(SF_UPLOAD_ERROR_RETRY == ret1)
|
||||||
|
{
|
||||||
|
printf("[%s:%d] PIC SF_UPLOAD_ERROR_RETRY\n", __FUNCTION__, __LINE__);
|
||||||
|
ret1 = sf_ftp_config(ssl, gprsMode, timeout);
|
||||||
|
|
||||||
|
if(ret1 == SF_SUCCESS)
|
||||||
|
{
|
||||||
|
ret1 = sf_quectel_upload_file_to_module(filePath, ftpFileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
battery = sf_app_get_battery();
|
||||||
|
memset(cameraID, '\0', sizeof(cameraID));
|
||||||
|
memset(ftpFileName, '\0', sizeof(ftpFileName));
|
||||||
|
memset(filePath, '\0', sizeof(filePath));
|
||||||
|
|
||||||
|
snprintf(cameraID, sizeof(cameraID), "%s-%d-%d-%s-", pPara->ModuleImei, battery, csqlevel, CamNameStr);
|
||||||
|
if(SF_FILE_TYPE_PIC_VIDEO == pThumbFileCfg->stfileattr[piccount].enFileTye){
|
||||||
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%sV-%s", cameraID, pThumbFileCfg->stfileattr[piccount].thumbfileName);
|
||||||
|
}else{
|
||||||
|
snprintf((char *)ftpFileName, sizeof(ftpFileName), "%s%s", cameraID, pThumbFileCfg->stfileattr[piccount].thumbfileName);
|
||||||
|
}
|
||||||
|
snprintf((char *)filePath, sizeof(filePath), "UFS:/%s", pThumbFileCfg->stfileattr[piccount].thumbfileName);
|
||||||
|
|
||||||
|
printf("%s:%d ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ftpFileName, filePath);
|
||||||
|
|
||||||
|
if(ret1 == SF_SUCCESS)
|
||||||
|
{
|
||||||
|
ret1 = sf_ftp_send(ftpFileName, filePath, timeout);
|
||||||
|
if(SF_SUCCESS != ret1)
|
||||||
|
{
|
||||||
|
printf("%s:%d err ret: [0x%08X] ftpFileName:%s filePath:%s\n", __FUNCTION__, __LINE__, ret, ftpFileName, filePath);
|
||||||
|
goto SF_CONCENTRATED_END;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
piccount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(battery <= 0)
|
||||||
|
{
|
||||||
|
goto SF_CONCENTRATED_END;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SF_CONCENTRATED_END:
|
||||||
|
if(!(((piccount+1) <= SendFileTotal) && ((pSifarPara->picSendMax < pPara->SendMaxNum) || (pPara->SendMaxNum == 0))))
|
||||||
|
{
|
||||||
|
sf_delete_send_flie_list();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ret1 != SF_FTP_ERROR_TERM)
|
||||||
|
{
|
||||||
|
ret2 = sf_ftp_stop(ssl, gprsMode);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if SF_TEST_ERROR_CODE
|
||||||
|
sf_set_code_err_flag(0);
|
||||||
|
#endif
|
||||||
|
printf("[%s:%d]ret1:[0x%08X],ret2:[0x%08X]\n\n", __FUNCTION__, __LINE__, ret1, ret2);
|
||||||
|
|
||||||
|
if(ret1 != SF_SUCCESS)
|
||||||
|
{
|
||||||
|
return ret1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return ret2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -1752,11 +1752,11 @@ SINT32 sf_check_message(void)
|
||||||
|
|
||||||
if(SUCCESS != app_ttyusb_IsOpen())
|
if(SUCCESS != app_ttyusb_IsOpen())
|
||||||
{
|
{
|
||||||
printf("%s:%d tty usb err", __FUNCTION__, __LINE__);
|
printf("%s:%d tty usb err\n", __FUNCTION__, __LINE__);
|
||||||
|
|
||||||
if(sf_ttyusb_restart() != SUCCESS)
|
if(sf_ttyusb_restart() != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("%s:%d restart tty usb err", __FUNCTION__, __LINE__);
|
printf("%s:%d restart tty usb err\n", __FUNCTION__, __LINE__);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1787,13 +1787,13 @@ SINT32 sf_check_message(void)
|
||||||
|
|
||||||
if(gsmPara[0] != '\0')
|
if(gsmPara[0] != '\0')
|
||||||
{
|
{
|
||||||
SLOGI("gsmPara:%s", gsmPara);
|
SLOGI("gsmPara:%s\n", gsmPara);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(strstr((const char *)gsmPara, "ERROR"))
|
if(strstr((const char *)gsmPara, "ERROR"))
|
||||||
{
|
{
|
||||||
SLOGE(gsmPara);
|
SLOGE(gsmPara);
|
||||||
sprintf(logStr, "[ERROR] ReadMsg MMC_location=%d ", location);
|
sprintf(logStr, "[ERROR] ReadMsg MMC_location=%d \n", location);
|
||||||
SLOGE(logStr);
|
SLOGE(logStr);
|
||||||
errcode++;
|
errcode++;
|
||||||
time = 0;
|
time = 0;
|
||||||
|
@ -2216,7 +2216,7 @@ SINT32 sf_simcom_check_need_send(void)
|
||||||
printf("[%s:%d]sf_get_pic()=%d,puiPara->NetGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_pic(), puiPara->NetGeneration);
|
printf("[%s:%d]sf_get_pic()=%d,puiPara->NetGeneration=%d\n", __FUNCTION__, __LINE__, sf_get_pic(), puiPara->NetGeneration);
|
||||||
|
|
||||||
if((sf_get_sim_insert()) && ((sf_get_mode_flag() == 1) || (PowerOnMode == PWR_ON_PIR) || (PowerOnMode == PWR_ON_TIMELAPSE) || (sf_get_pic() == SF_TRUE))
|
if((sf_get_sim_insert()) && ((sf_get_mode_flag() == 1) || (PowerOnMode == PWR_ON_PIR) || (PowerOnMode == PWR_ON_TIMELAPSE) || (sf_get_pic() == SF_TRUE))
|
||||||
&& (((puiPara->CamMode == SF_CAM_MODE_VIDEO) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4))))
|
&& ((puiPara->SendPhotoSwitch == 1) || ((puiPara->CamMode == SF_CAM_MODE_VIDEO) && (puiPara->SendVideoSwitch == 1) && (puiPara->NetGeneration == 4))))
|
||||||
{
|
{
|
||||||
if((sf_check_ftp_send(1) == SF_SUCCESS))
|
if((sf_check_ftp_send(1) == SF_SUCCESS))
|
||||||
{
|
{
|
||||||
|
@ -2242,7 +2242,7 @@ SINT32 sf_power_off_check_sms(void)
|
||||||
SINT32 sendFlag = SF_FAILURE;
|
SINT32 sendFlag = SF_FAILURE;
|
||||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||||
/*instant, hybrid mode*/
|
/*instant, hybrid mode*/
|
||||||
if((sf_get_signal_ready()) && (sf_get_sim_insert()) && (sf_app_while_flag()))
|
if((!sf_get_signal_ready_flag()) && (sf_get_sim_insert()) && (sf_app_while_flag()))
|
||||||
{
|
{
|
||||||
if(puiPara->GprsMode)
|
if(puiPara->GprsMode)
|
||||||
{
|
{
|
||||||
|
@ -2675,3 +2675,19 @@ SINT32 sf_power_off_check_ui_para_sava(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
Function: sf_power_off_check_camera_restart
|
||||||
|
Description: sf power off .
|
||||||
|
Input: N/A
|
||||||
|
Output: N/A
|
||||||
|
Return: 0:SUCCESS, errcode:FAIL
|
||||||
|
Others: N/A
|
||||||
|
*************************************************/
|
||||||
|
UINT8 sf_sms_check_send(void)
|
||||||
|
{
|
||||||
|
if((CameraCmd.getLog) ||(CameraCmd.sendVideo) || (CameraCmd.sendHD) || sf_get_pic())
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -58,13 +58,14 @@ static char* usb_host_drivers[] = {
|
||||||
"kernel/drivers/usb/host/ehci-hcd.ko",
|
"kernel/drivers/usb/host/ehci-hcd.ko",
|
||||||
"kernel/drivers/net/mii.ko",
|
"kernel/drivers/net/mii.ko",
|
||||||
"kernel/drivers/net/usb/usbnet.ko",
|
"kernel/drivers/net/usb/usbnet.ko",
|
||||||
|
"extra/net/GobiNet/drv_gobi_net.ko",
|
||||||
|
"kernel/drivers/net/usb/cdc_ether.ko",
|
||||||
|
"kernel/drivers/net/usb/rndis_host.ko",
|
||||||
"kernel/drivers/usb/serial/usbserial.ko",
|
"kernel/drivers/usb/serial/usbserial.ko",
|
||||||
"kernel/drivers/usb/serial/usb_wwan.ko",
|
"kernel/drivers/usb/serial/usb_wwan.ko",
|
||||||
"kernel/drivers/usb/serial/option.ko",
|
"kernel/drivers/usb/serial/option.ko",
|
||||||
"kernel/drivers/net/usb/cdc_ether.ko",
|
|
||||||
"kernel/drivers/usb/class/cdc-wdm.ko",
|
"kernel/drivers/usb/class/cdc-wdm.ko",
|
||||||
"kernel/drivers/net/usb/qmi_wwan.ko",
|
"kernel/drivers/net/usb/qmi_wwan.ko",
|
||||||
"extra/net/GobiNet/drv_gobi_net.ko",
|
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -680,7 +680,18 @@ SINT32 app_system_param_update(void)
|
||||||
|
|
||||||
SINT32 app_system_poweroff(SF_POWEROFF_TYPE_E enType )
|
SINT32 app_system_poweroff(SF_POWEROFF_TYPE_E enType )
|
||||||
{
|
{
|
||||||
|
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||||
|
|
||||||
sf_poweroff_type_set(enType);
|
sf_poweroff_type_set(enType);
|
||||||
|
#if SF_QLOG_ENABLE
|
||||||
|
if(puiPara->QLogSwitch)
|
||||||
|
{
|
||||||
|
system("killall qlog");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if((puiPara->DebugMode) || (puiPara->QLogSwitch)){
|
||||||
|
sync();
|
||||||
|
}
|
||||||
sf_mcu_reg_set(SF_MCU_POWEROFF,sf_poweroff_type_get());
|
sf_mcu_reg_set(SF_MCU_POWEROFF,sf_poweroff_type_get());
|
||||||
/*
|
/*
|
||||||
SF_STORE_ATTR_S storeattrs = {0};
|
SF_STORE_ATTR_S storeattrs = {0};
|
||||||
|
@ -914,7 +925,7 @@ void sf_power_off(void)
|
||||||
sf_power_off_check_module_sleep();
|
sf_power_off_check_module_sleep();
|
||||||
|
|
||||||
sf_power_off_check_camera_restart();
|
sf_power_off_check_camera_restart();
|
||||||
|
|
||||||
sf_power_off_check_ui_para_sava();
|
sf_power_off_check_ui_para_sava();
|
||||||
sf_statistics_param_save(psfPara);
|
sf_statistics_param_save(psfPara);
|
||||||
|
|
||||||
|
@ -923,6 +934,7 @@ void sf_power_off(void)
|
||||||
stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK;
|
stMessageBuf.arg1 = SF_EVENT_KEY_SHORT_CLICK;
|
||||||
stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff
|
stMessageBuf.arg2 = SF_KEY_PIN_AOTU_MODE_POWOFF;//auto mode powoff
|
||||||
sf_com_message_send_to_cardv(&stMessageBuf);
|
sf_com_message_send_to_cardv(&stMessageBuf);
|
||||||
|
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -584,7 +584,7 @@ void sf_sys_status_led_set(LedSysState_t ledSysStateId)
|
||||||
{
|
{
|
||||||
if((SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()))
|
if((SF_MCU_STARTUP_ONKEY != sf_poweron_type_get()))
|
||||||
return;
|
return;
|
||||||
if((ledSysStateId != SF_LED_SYS_STATE_PIR_DETECT) && (ledSysStateId != SF_LED_SYS_STATE_PIR_NOT_DETECT))
|
//if((ledSysStateId != SF_LED_SYS_STATE_PIR_DETECT) && (ledSysStateId != SF_LED_SYS_STATE_PIR_NOT_DETECT))
|
||||||
printf("SYS LED SET %d\n", ledSysStateId);
|
printf("SYS LED SET %d\n", ledSysStateId);
|
||||||
switch(ledSysStateId)
|
switch(ledSysStateId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -296,7 +296,7 @@ SINT32 sf_quectel_upload_file_to_module(UINT8 *fileAbsolutePath, UINT8 *uploadFn
|
||||||
//UINT8 sdFname[64] = {0};
|
//UINT8 sdFname[64] = {0};
|
||||||
//UINT8 gsmPara[GPRS_INFO_LINE_MAX] = {0};
|
//UINT8 gsmPara[GPRS_INFO_LINE_MAX] = {0};
|
||||||
SF_QUECTEL_UPLOAD_E enUploadLocation = QUECTEL_UPLOAD_FRIST;
|
SF_QUECTEL_UPLOAD_E enUploadLocation = QUECTEL_UPLOAD_FRIST;
|
||||||
|
sf_set_upload_to_module_flag(0); // test
|
||||||
if(sf_get_del_flag() == FALSE)
|
if(sf_get_del_flag() == FALSE)
|
||||||
{
|
{
|
||||||
sf_set_del_flag(TRUE);
|
sf_set_del_flag(TRUE);
|
||||||
|
|
|
@ -670,6 +670,11 @@ void sf_file_thumb_cfg_clear(void)
|
||||||
pThumbFileCfg->filecnt = 0;
|
pThumbFileCfg->filecnt = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT8 sf_get_send_file_total(void)
|
||||||
|
{
|
||||||
|
return SendFileTotal;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL sf_check_auto_thumb_file(VOID)
|
BOOL sf_check_auto_thumb_file(VOID)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -789,7 +794,7 @@ UINT8 sf_get_send_file_list(char *sendfileList, UINT8 *fileTotal)
|
||||||
//oldFileKey = 1000003; //for debug
|
//oldFileKey = 1000003; //for debug
|
||||||
if((oldFileKey >= 1000001) && (oldFileKey <= 9999999)) //W1000001.JPG W9999999.JPG
|
if((oldFileKey >= 1000001) && (oldFileKey <= 9999999)) //W1000001.JPG W9999999.JPG
|
||||||
{
|
{
|
||||||
sprintf(oldFileName, "W%ld.JPG", oldFileKey);
|
snprintf(oldFileName, sizeof(oldFileName), "W%ld.JPG", oldFileKey);
|
||||||
printf("last send file:%s\n", oldFileName);
|
printf("last send file:%s\n", oldFileName);
|
||||||
pFileHasSend = strstr(sendfileList, oldFileName); //MAX spend time <= 310ms
|
pFileHasSend = strstr(sendfileList, oldFileName); //MAX spend time <= 310ms
|
||||||
if(pFileHasSend != NULL)
|
if(pFileHasSend != NULL)
|
||||||
|
|
|
@ -67,6 +67,7 @@ static UINT8 drNoResetTimeSync = SF_FALSE; //0:reset; 1:no reset;
|
||||||
static UINT8 SetMcuRtcFlag = 0;
|
static UINT8 SetMcuRtcFlag = 0;
|
||||||
static UINT8 ModuleUpdating = 0;
|
static UINT8 ModuleUpdating = 0;
|
||||||
static UINT8 FwUpdate = 0;
|
static UINT8 FwUpdate = 0;
|
||||||
|
static BOOL SignalReadyFlag = FALSE;
|
||||||
|
|
||||||
|
|
||||||
UINT8 sf_mcu_read(UINT32 reg, UINT8 *data)
|
UINT8 sf_mcu_read(UINT32 reg, UINT8 *data)
|
||||||
|
@ -384,12 +385,10 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
|
||||||
{
|
{
|
||||||
paraSyncFlag = 1;
|
paraSyncFlag = 1;
|
||||||
}
|
}
|
||||||
|
sf_sys_rtc_time_get(&date);
|
||||||
if(SetMcuRtcFlag)
|
if(SetMcuRtcFlag)
|
||||||
{
|
{
|
||||||
sf_sys_rtc_time_get(&date);
|
MLOGI("set mcu rtc: %04d/%02d/%02d %02d:%02d:%02d\n", date.Year, date.Mon, date.Day, date.Hour, date.Min, date.Sec);
|
||||||
MLOGI("set mcu rtc: %04d/%02d/%02d %02d:%02d:%02d\n",
|
|
||||||
date.Year, date.Mon, date.Day, date.Hour, date.Min, date.Sec);
|
|
||||||
mcuReg[i] = SF_RTC_YEAR;
|
mcuReg[i] = SF_RTC_YEAR;
|
||||||
mcuData[i++] = date.Year-2000;
|
mcuData[i++] = date.Year-2000;
|
||||||
mcuReg[i] = SF_RTC_MONTH;
|
mcuReg[i] = SF_RTC_MONTH;
|
||||||
|
@ -710,7 +709,7 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
|
||||||
temp |= 0x40;
|
temp |= 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((puiPara->GprsMode) && (val == 1))
|
if((puiPara->GprsSwitch) && (val == 1))
|
||||||
{
|
{
|
||||||
temp |= 0x80;
|
temp |= 0x80;
|
||||||
}
|
}
|
||||||
|
@ -751,7 +750,7 @@ unsigned char sf_mcu_reg_set(MCUParam_t attrId, unsigned char val)
|
||||||
temp |= 0x40;
|
temp |= 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((puiPara->GprsMode) && (simCardInsert))
|
if((puiPara->GprsSwitch) && (simCardInsert))
|
||||||
{
|
{
|
||||||
temp |= 0x80;
|
temp |= 0x80;
|
||||||
}
|
}
|
||||||
|
@ -1373,6 +1372,33 @@ SINT32 sf_get_gprs_errno(void)
|
||||||
{
|
{
|
||||||
return GPRS_ERRNO;
|
return GPRS_ERRNO;
|
||||||
}
|
}
|
||||||
|
/*************************************************
|
||||||
|
Function: sf_get_signal_ready_flag
|
||||||
|
Description:
|
||||||
|
Input: N/A
|
||||||
|
Output: N/A
|
||||||
|
Return: N/A
|
||||||
|
Others: N/A
|
||||||
|
*************************************************/
|
||||||
|
BOOL sf_get_signal_ready_flag(void)
|
||||||
|
{
|
||||||
|
printf("%s:%d SignalReadyFlag:%d\n", __FUNCTION__, __LINE__, SignalReadyFlag);
|
||||||
|
return SignalReadyFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*************************************************
|
||||||
|
Function: sf_set_signal_ready_flag
|
||||||
|
Description:
|
||||||
|
Input: N/A
|
||||||
|
Output: N/A
|
||||||
|
Return: N/A
|
||||||
|
Others: N/A
|
||||||
|
*************************************************/
|
||||||
|
void sf_set_signal_ready_flag(BOOL Flag)
|
||||||
|
{
|
||||||
|
SignalReadyFlag = Flag;
|
||||||
|
printf("%s:%d SignalReadyFlag:%d\n", __FUNCTION__, __LINE__, SignalReadyFlag);
|
||||||
|
}
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#if __cplusplus
|
#if __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -335,7 +335,7 @@ SINT32 sf_hal_ttyusb2_init(void)
|
||||||
SINT32 ret = SF_FAILURE;
|
SINT32 ret = SF_FAILURE;
|
||||||
if(TtyUSB2Fd > 0)
|
if(TtyUSB2Fd > 0)
|
||||||
{
|
{
|
||||||
MLOGE("[/dev/ttyUSB2] has already inited !!!\n");
|
MLOGI("[/dev/ttyUSB2] has already inited !!!\n");
|
||||||
return SF_SUCCESS;
|
return SF_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@
|
||||||
#include "sf_data_transfer.h"
|
#include "sf_data_transfer.h"
|
||||||
#include "sf_svr_send.h"
|
#include "sf_svr_send.h"
|
||||||
#include "sf_system.h"
|
#include "sf_system.h"
|
||||||
#include "sf_common.h"
|
#include "sf_common.h"
|
||||||
|
#include "sf_log.h"
|
||||||
//#include "sf_customer_app.h"
|
//#include "sf_customer_app.h"
|
||||||
//#include "sf_4g_common.h"
|
//#include "sf_4g_common.h"
|
||||||
|
|
||||||
|
@ -183,7 +183,7 @@ static clientContext_t* DeleteClientContext( clientContext_t **ppClientHead,
|
||||||
|
|
||||||
static clientContext_t* AddClientContextToList( clientContext_t *pClientHead, clientContext_t *pClient)
|
static clientContext_t* AddClientContextToList( clientContext_t *pClientHead, clientContext_t *pClient)
|
||||||
{
|
{
|
||||||
printf("data client add \n");
|
MLOGI("data client add \n");
|
||||||
|
|
||||||
pthread_mutex_lock(&gAppDataSvrMutex);
|
pthread_mutex_lock(&gAppDataSvrMutex);
|
||||||
//printf("data client add m\n");
|
//printf("data client add m\n");
|
||||||
|
@ -201,7 +201,7 @@ void dataClientListPrint(void)
|
||||||
clientContext_t *pClient = pDataClientHead;
|
clientContext_t *pClient = pDataClientHead;
|
||||||
while ( pClient != NULL )
|
while ( pClient != NULL )
|
||||||
{
|
{
|
||||||
printf("data key:%d,fun:%d, fd:%d, %s\n",pClient->map.key,pClient->map.function,pClient->map.fd,pClient->map.fileName);
|
MLOGI("data key:%d,fun:%d, fd:%d, %s\n",pClient->map.key,pClient->map.function,pClient->map.fd,pClient->map.fileName);
|
||||||
pClient = pClient->p_next;
|
pClient = pClient->p_next;
|
||||||
}
|
}
|
||||||
//printf("list end\n");
|
//printf("list end\n");
|
||||||
|
@ -245,7 +245,7 @@ U8 dataTransErrCodeSet(U32 port, U8 errCode)
|
||||||
p = p->pNext;
|
p = p->pNext;
|
||||||
if(p->errCode != CMD_SUCCESS)
|
if(p->errCode != CMD_SUCCESS)
|
||||||
{
|
{
|
||||||
printf("port:%d,errCode:%d\n",p->port,p->errCode);
|
MLOGI("port:%d,errCode:%d\n",p->port,p->errCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -318,7 +318,7 @@ U8 sf_DataMapSet(U32 key, U8 function, S8 *fileName, U32 FileSize)
|
||||||
U32 err;
|
U32 err;
|
||||||
U32 i = 0;
|
U32 i = 0;
|
||||||
|
|
||||||
printf("[sf_DataMapSet],key:%d,fileName:%s\n",key,fileName);
|
MLOGI(" key:%d,fileName:%s\n",key,fileName);
|
||||||
|
|
||||||
if(fileName == NULL)
|
if(fileName == NULL)
|
||||||
return CMD_ERR;
|
return CMD_ERR;
|
||||||
|
@ -331,7 +331,7 @@ U8 sf_DataMapSet(U32 key, U8 function, S8 *fileName, U32 FileSize)
|
||||||
err = pthread_mutex_lock(&gAppDataSvrMutex);
|
err = pthread_mutex_lock(&gAppDataSvrMutex);
|
||||||
if(err != SUCCESS)
|
if(err != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("Map set error!\n");
|
MLOGE("Map set error!\n");
|
||||||
return DATA_CMD_ADD_TO_FLOW_ERR;
|
return DATA_CMD_ADD_TO_FLOW_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ U8 sf_DataMapSet(U32 key, U8 function, S8 *fileName, U32 FileSize)
|
||||||
{
|
{
|
||||||
if((pClient->map.function == 1 || pClient->map.function == 2) && (function))
|
if((pClient->map.function == 1 || pClient->map.function == 2) && (function))
|
||||||
{
|
{
|
||||||
printf("[ERROR]file data is still transfer!\n");
|
MLOGE("[ERROR]file data is still transfer!\n");
|
||||||
pthread_mutex_unlock(&gAppDataSvrMutex);
|
pthread_mutex_unlock(&gAppDataSvrMutex);
|
||||||
return DATA_CMD_PORT_IS_USED;
|
return DATA_CMD_PORT_IS_USED;
|
||||||
}
|
}
|
||||||
|
@ -364,7 +364,7 @@ U8 sf_DataMapSet(U32 key, U8 function, S8 *fileName, U32 FileSize)
|
||||||
{
|
{
|
||||||
usleep(20*1000);
|
usleep(20*1000);
|
||||||
i++;
|
i++;
|
||||||
printf("function2=%d\n",pClient->map.function);
|
MLOGI("function2=%d\n",pClient->map.function);
|
||||||
if(i >= 50)
|
if(i >= 50)
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&gAppDataSvrMutex);
|
pthread_mutex_unlock(&gAppDataSvrMutex);
|
||||||
|
@ -407,7 +407,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
U32 sendSizeTemp = 0;
|
U32 sendSizeTemp = 0;
|
||||||
//U32 i = 0;;
|
//U32 i = 0;;
|
||||||
/*U8 tmpbuf[100];*/
|
/*U8 tmpbuf[100];*/
|
||||||
printf("new data thread = %p\n",addr);
|
MLOGI("new data thread = %p\n",addr);
|
||||||
if(addr == 0)
|
if(addr == 0)
|
||||||
{
|
{
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
@ -428,7 +428,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
//printf("[Error][sf_DataSvrTransferThread] Error: %d,socket:%d.\n",nErr,pClient->socket );
|
//printf("[Error][sf_DataSvrTransferThread] Error: %d,socket:%d.\n",nErr,pClient->socket );
|
||||||
if(nErr != 11)//EAGAIN/EINTR
|
if(nErr != 11)//EAGAIN/EINTR
|
||||||
{
|
{
|
||||||
printf("Socket:%d, errno: %d,key:%d,fd:%d\n",pClient->socket,errno,pClient->map.key,pClient->map.fd );
|
MLOGE("Socket:%d, errno: %d,key:%d,fd:%d\n",pClient->socket,errno,pClient->map.key,pClient->map.fd );
|
||||||
perror("Error:");
|
perror("Error:");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
//fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
//fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
||||||
|
@ -438,7 +438,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
//pDataClientHead = NULL ;
|
//pDataClientHead = NULL ;
|
||||||
}
|
}
|
||||||
dataClientListPrint();
|
dataClientListPrint();
|
||||||
printf("[Error][thread_destroy] end\n");
|
MLOGE("[Error] end\n");
|
||||||
//forbuild sp5kHostMsgSend(APP_UI_MSG_DATA_THREAD_DEL, pthread);
|
//forbuild sp5kHostMsgSend(APP_UI_MSG_DATA_THREAD_DEL, pthread);
|
||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
}
|
}
|
||||||
|
@ -447,7 +447,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
}
|
}
|
||||||
else if(nbytes == 0)
|
else if(nbytes == 0)
|
||||||
{
|
{
|
||||||
printf("client close socket:%d, key:%d, errno: %d.\n",pClient->socket,pClient->map.key , errno );
|
MLOGI("client close socket:%d, key:%d, errno: %d.\n",pClient->socket,pClient->map.key , errno );
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
pClient = DeleteClientContext(&pDataClientHead,pClient);
|
pClient = DeleteClientContext(&pDataClientHead,pClient);
|
||||||
dataClientListPrint();
|
dataClientListPrint();
|
||||||
|
@ -459,7 +459,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
|
|
||||||
if(pClient->map.function != 3)
|
if(pClient->map.function != 3)
|
||||||
{
|
{
|
||||||
printf("function=%d,name=%s\n",pClient->map.function,pClient->map.fileName);
|
MLOGI("function=%d,name=%s\n",pClient->map.function,pClient->map.fileName);
|
||||||
//printf("socket=%d,key=%d,C_port=%d\n",pClient->socket,pClient->map.key,ntohs(pClient->ClientAddr.sin_port));
|
//printf("socket=%d,key=%d,C_port=%d\n",pClient->socket,pClient->map.key,ntohs(pClient->ClientAddr.sin_port));
|
||||||
}
|
}
|
||||||
//pClient->map.fileName[47]=0;
|
//pClient->map.fileName[47]=0;
|
||||||
|
@ -486,18 +486,18 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
if(pClient->map.fd == 0)
|
if(pClient->map.fd == 0)
|
||||||
{
|
{
|
||||||
//creat file failed.
|
//creat file failed.
|
||||||
printf("fd=0\n");
|
//printf("fd=0\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
dataTransErrCodeSet(pClient->map.key, DATA_UP_CREAT_FILE_FAIL);
|
dataTransErrCodeSet(pClient->map.key, DATA_UP_CREAT_FILE_FAIL);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
//pClient->map.fileSize = sp5kFsFileSizeGet(pClient->map.fd);
|
//pClient->map.fileSize = sp5kFsFileSizeGet(pClient->map.fd);
|
||||||
//pClient->map.transferSize = 0;
|
//pClient->map.transferSize = 0;
|
||||||
printf("data filesize=%d\n",pClient->map.fileSize);
|
MLOGI("data filesize=%d\n",pClient->map.fileSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("err\n");
|
MLOGE("err\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
dataTransErrCodeSet(pClient->map.key, DATA_UP_NO_FILE_NAME);
|
dataTransErrCodeSet(pClient->map.key, DATA_UP_NO_FILE_NAME);
|
||||||
continue;
|
continue;
|
||||||
|
@ -515,7 +515,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
else if(oldTime != CurrTime)
|
else if(oldTime != CurrTime)
|
||||||
{
|
{
|
||||||
countByte += nbytes;
|
countByte += nbytes;
|
||||||
printf("receive speed=% 3dKB/s, %d\n",countByte/1024,countByte);
|
MLOGI("receive speed=% 3dKB/s, %d\n",countByte/1024,countByte);
|
||||||
countByte = 0;
|
countByte = 0;
|
||||||
oldTime = CurrTime;
|
oldTime = CurrTime;
|
||||||
}
|
}
|
||||||
|
@ -532,7 +532,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
usleep(25*1000); /* ms */
|
usleep(25*1000); /* ms */
|
||||||
if(pClient->map.count > 200)
|
if(pClient->map.count > 200)
|
||||||
{
|
{
|
||||||
printf("receive time out\n");
|
MLOGE("receive time out\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
dataTransErrCodeSet(pClient->map.key, DATA_UP_TIME_OUT);
|
dataTransErrCodeSet(pClient->map.key, DATA_UP_TIME_OUT);
|
||||||
}
|
}
|
||||||
|
@ -546,7 +546,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
ret = write(pClient->map.fd, pClient->szBuffer, nbytes);
|
ret = write(pClient->map.fd, pClient->szBuffer, nbytes);
|
||||||
if(ret <= 0)
|
if(ret <= 0)
|
||||||
{
|
{
|
||||||
printf("wirte error ! ret=%d\n",ret);
|
MLOGE("wirte error ! ret=%d\n",ret);
|
||||||
usleep(25*1000); /* ms */
|
usleep(25*1000); /* ms */
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
dataTransErrCodeSet(pClient->map.key, DATA_UP_WRITE_FILE_ERR);
|
dataTransErrCodeSet(pClient->map.key, DATA_UP_WRITE_FILE_ERR);
|
||||||
|
@ -555,7 +555,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
pClient->map.transferSize += ret;
|
pClient->map.transferSize += ret;
|
||||||
if(pClient->map.transferSize >= pClient->map.fileSize)
|
if(pClient->map.transferSize >= pClient->map.fileSize)
|
||||||
{
|
{
|
||||||
printf("receive success! Tsize=%d,Fsize=%d\n", pClient->map.transferSize,pClient->map.fileSize);
|
MLOGI("receive success! Tsize=%d,Fsize=%d\n", pClient->map.transferSize,pClient->map.fileSize);
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
dataTransErrCodeSet(pClient->map.key, CMD_SUCCESS);
|
dataTransErrCodeSet(pClient->map.key, CMD_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -584,7 +584,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("ssdfeef\n");
|
//printf("ssdfeef\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_NO_FILE_NAME);//remove,because APP not use
|
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_NO_FILE_NAME);//remove,because APP not use
|
||||||
continue;
|
continue;
|
||||||
|
@ -612,7 +612,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
}
|
}
|
||||||
else if(writedsize > readSize)
|
else if(writedsize > readSize)
|
||||||
{
|
{
|
||||||
printf("[ERROR] send size > read size\n");
|
MLOGE("[ERROR] send size > read size\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_SEND_DATA_ERR);//remove,because APP not use
|
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_SEND_DATA_ERR);//remove,because APP not use
|
||||||
}
|
}
|
||||||
|
@ -625,7 +625,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
{
|
{
|
||||||
readSize -= writedsize;
|
readSize -= writedsize;
|
||||||
sendSizeTemp += writedsize;
|
sendSizeTemp += writedsize;
|
||||||
printf("send left =%d,index:%d\n",readSize,sendSizeTemp);
|
MLOGI("send left =%d,index:%d\n",readSize,sendSizeTemp);
|
||||||
usleep(30*1000); /* ms */
|
usleep(30*1000); /* ms */
|
||||||
//sp5kFsFileSeek(pClient->map.fd, ret-readSize, SP5K_FS_SEEK_CUR); seek function has a bug
|
//sp5kFsFileSeek(pClient->map.fd, ret-readSize, SP5K_FS_SEEK_CUR); seek function has a bug
|
||||||
}
|
}
|
||||||
|
@ -653,7 +653,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
else if(oldTime != CurrTime)
|
else if(oldTime != CurrTime)
|
||||||
{
|
{
|
||||||
countByte += writedsize;
|
countByte += writedsize;
|
||||||
printf("send speed=% 3dKB/s, %d\n",countByte/1024,countByte);
|
MLOGI("send speed=% 3dKB/s, %d\n",countByte/1024,countByte);
|
||||||
countByte = 0;
|
countByte = 0;
|
||||||
oldTime = CurrTime;
|
oldTime = CurrTime;
|
||||||
}
|
}
|
||||||
|
@ -668,7 +668,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
sendSizeTemp = 0;
|
sendSizeTemp = 0;
|
||||||
//send time out.
|
//send time out.
|
||||||
//printf("time out == 30\n");
|
//printf("time out == 30\n");
|
||||||
printf("timeOut sendSize=%d,filesize=%d\n",pClient->map.transferSize,pClient->map.fileSize);
|
MLOGI("timeOut sendSize=%d,filesize=%d\n",pClient->map.transferSize,pClient->map.fileSize);
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_TIME_OUT);//remove,because APP not use
|
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_TIME_OUT);//remove,because APP not use
|
||||||
}
|
}
|
||||||
|
@ -677,7 +677,7 @@ void *sf_DataSvrTransferThread(void *addr)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("[ERROR] read size = 0\n");
|
MLOGE("[ERROR] read size = 0\n");
|
||||||
sf_DataMapClear(pClient);
|
sf_DataMapClear(pClient);
|
||||||
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_READ_FILE_ERR);//remove,because APP not use
|
//dataTransErrCodeSet(pClient->map.key, DATA_DOWN_READ_FILE_ERR);//remove,because APP not use
|
||||||
}
|
}
|
||||||
|
@ -717,10 +717,10 @@ void *sf_DataSvrThread(void *p)
|
||||||
appDataSvrSocket = socket(AF_INET, SOCK_STREAM, 0);
|
appDataSvrSocket = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if (appDataSvrSocket < 0)
|
if (appDataSvrSocket < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread] socket,ret:%x\n",appDataSvrSocket);
|
MLOGI("[Error] socket,ret:%x\n",appDataSvrSocket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
printf("[sf_DataSvrThread],gAppSvrSocket:%d\n",appDataSvrSocket);
|
MLOGI(" gAppSvrSocket:%d\n",appDataSvrSocket);
|
||||||
|
|
||||||
pthread_mutex_init(&gAppDataSvrMutex,NULL);
|
pthread_mutex_init(&gAppDataSvrMutex,NULL);
|
||||||
pthread_mutex_init(&gDataErrCodeMutex,NULL);
|
pthread_mutex_init(&gDataErrCodeMutex,NULL);
|
||||||
|
@ -731,14 +731,14 @@ void *sf_DataSvrThread(void *p)
|
||||||
ret = setsockopt(appDataSvrSocket, IPPROTO_TCP, SO_KEEPALIVE, &on, sizeof(on));
|
ret = setsockopt(appDataSvrSocket, IPPROTO_TCP, SO_KEEPALIVE, &on, sizeof(on));
|
||||||
if ( ret < 0 )
|
if ( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread] setsockopt,ret:%x\n",ret);
|
MLOGE("[Error] setsockopt,ret:%x\n",ret);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = setsockopt( appDataSvrSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) );
|
ret = setsockopt( appDataSvrSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) );
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread] SO_REUSEADDR,ret:%d \n",ret);
|
MLOGE("[Error] SO_REUSEADDR,ret:%d \n",ret);
|
||||||
//return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
int opt = 512*1024;
|
int opt = 512*1024;
|
||||||
|
@ -752,14 +752,14 @@ void *sf_DataSvrThread(void *p)
|
||||||
ret = bind(appDataSvrSocket, (struct sockaddr*)&addrSend, sizeof(addrSend));
|
ret = bind(appDataSvrSocket, (struct sockaddr*)&addrSend, sizeof(addrSend));
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread] bind:%d \n",ret);
|
MLOGE("[Error] bind:%d \n",ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret =listen(appDataSvrSocket, LISTEN_PARAM);
|
ret =listen(appDataSvrSocket, LISTEN_PARAM);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread]listen:%d\n",ret);
|
MLOGE("[Error] listen:%d\n",ret);
|
||||||
close(appDataSvrSocket);
|
close(appDataSvrSocket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -784,17 +784,17 @@ void *sf_DataSvrThread(void *p)
|
||||||
//printf("[sf_DataSvrThread]select,rdfds:%d,errfds:%d\n",rdfds,errfds);
|
//printf("[sf_DataSvrThread]select,rdfds:%d,errfds:%d\n",rdfds,errfds);
|
||||||
//if (FD_ISSET(appDataSvrSocket, &rdfds))
|
//if (FD_ISSET(appDataSvrSocket, &rdfds))
|
||||||
{
|
{
|
||||||
printf("data accept wait\n");
|
MLOGI("data accept wait\n");
|
||||||
new_fd = accept(appDataSvrSocket, (struct sockaddr *) &cliAddr, &clientLength);
|
new_fd = accept(appDataSvrSocket, (struct sockaddr *) &cliAddr, &clientLength);
|
||||||
if (new_fd < 0)
|
if (new_fd < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread]accept:%d\n",new_fd);
|
MLOGE("[Error]accept:%d\n",new_fd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("\n\n[Port:8855]new data channel socket:%d --------oliver\n", new_fd);
|
MLOGI("\n\n[Port:8855]new data channel socket:%d --------oliver\n", new_fd);
|
||||||
printf("data channel.IP:%s, Port:%d\n\n\n", inet_ntoa(cliAddr.sin_addr), htons(cliAddr.sin_port));
|
MLOGI("data channel.IP:%s, Port:%d\n\n\n", inet_ntoa(cliAddr.sin_addr), htons(cliAddr.sin_port));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(SF_SUCCESS != sf_is_ip_in_list(inet_ntoa(cliAddr.sin_addr)))
|
if(SF_SUCCESS != sf_is_ip_in_list(inet_ntoa(cliAddr.sin_addr)))
|
||||||
|
@ -836,7 +836,7 @@ void *sf_DataSvrThread(void *p)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("[Error][sf_DataSvrThread]nbytes %d,lwip_close\n", nbytes );
|
MLOGE("[Error]nbytes %d,lwip_close\n", nbytes );
|
||||||
pClient = pDataClientHead ;
|
pClient = pDataClientHead ;
|
||||||
while (pClient != NULL)
|
while (pClient != NULL)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "sf_wifi_svr.h"
|
#include "sf_wifi_svr.h"
|
||||||
#include "sf_led.h"
|
#include "sf_led.h"
|
||||||
|
#include "sf_log.h"
|
||||||
int iw_debug = 0;
|
int iw_debug = 0;
|
||||||
static int (*registered_handler)(struct nl_msg *, void *);
|
static int (*registered_handler)(struct nl_msg *, void *);
|
||||||
static void *registered_handler_data;
|
static void *registered_handler_data;
|
||||||
|
@ -282,26 +283,26 @@ static int print_event(struct nl_msg *msg, void *arg)
|
||||||
if (tb[NL80211_ATTR_IFINDEX] && tb[NL80211_ATTR_WIPHY]) {
|
if (tb[NL80211_ATTR_IFINDEX] && tb[NL80211_ATTR_WIPHY]) {
|
||||||
/* if_indextoname may fails on delete interface/wiphy event */
|
/* if_indextoname may fails on delete interface/wiphy event */
|
||||||
if (if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname))
|
if (if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname))
|
||||||
printf("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
MLOGI("%s (phy #%d): ", ifname, nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
||||||
else
|
else
|
||||||
printf("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
MLOGI("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
||||||
} else if (tb[NL80211_ATTR_WDEV] && tb[NL80211_ATTR_WIPHY]) {
|
} else if (tb[NL80211_ATTR_WDEV] && tb[NL80211_ATTR_WIPHY]) {
|
||||||
printf("wdev 0x%llx (phy #%d): ",
|
printf("wdev 0x%llx (phy #%d): ",
|
||||||
(unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]),
|
(unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]),
|
||||||
nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
||||||
} else if (tb[NL80211_ATTR_IFINDEX]) {
|
} else if (tb[NL80211_ATTR_IFINDEX]) {
|
||||||
if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname);
|
if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), ifname);
|
||||||
printf("%s: ", ifname);
|
MLOGI("%s: ", ifname);
|
||||||
} else if (tb[NL80211_ATTR_WDEV]) {
|
} else if (tb[NL80211_ATTR_WDEV]) {
|
||||||
printf("wdev 0x%llx: ", (unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]));
|
MLOGI("wdev 0x%llx: ", (unsigned long long)nla_get_u64(tb[NL80211_ATTR_WDEV]));
|
||||||
} else if (tb[NL80211_ATTR_WIPHY]) {
|
} else if (tb[NL80211_ATTR_WIPHY]) {
|
||||||
printf("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
MLOGI("phy #%d: ", nla_get_u32(tb[NL80211_ATTR_WIPHY]));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (gnlh->cmd) {
|
switch (gnlh->cmd) {
|
||||||
case NL80211_CMD_NEW_STATION:
|
case NL80211_CMD_NEW_STATION:
|
||||||
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
||||||
printf("new station %s\n", macbuf);
|
MLOGI("new station %s\n", macbuf);
|
||||||
connectNum++;
|
connectNum++;
|
||||||
if(connectNum == 1)
|
if(connectNum == 1)
|
||||||
{
|
{
|
||||||
|
@ -313,7 +314,7 @@ static int print_event(struct nl_msg *msg, void *arg)
|
||||||
break;
|
break;
|
||||||
case NL80211_CMD_DEL_STATION:
|
case NL80211_CMD_DEL_STATION:
|
||||||
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
|
||||||
printf("del station %s\n", macbuf);
|
MLOGI("del station %s\n", macbuf);
|
||||||
connectNum--;
|
connectNum--;
|
||||||
if(connectNum < 0)
|
if(connectNum < 0)
|
||||||
connectNum = 0;
|
connectNum = 0;
|
||||||
|
@ -328,7 +329,7 @@ static int print_event(struct nl_msg *msg, void *arg)
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
printf("unknown event %d\n",
|
MLOGE("unknown event %d\n",
|
||||||
gnlh->cmd);
|
gnlh->cmd);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
#include "sf_wifi_svr.h"
|
#include "sf_wifi_svr.h"
|
||||||
#include "sf_data_transfer.h"
|
#include "sf_data_transfer.h"
|
||||||
#include "sf_svr_send.h"
|
#include "sf_svr_send.h"
|
||||||
|
#include "sf_log.h"
|
||||||
//#include "sf_para.h"
|
//#include "sf_para.h"
|
||||||
|
|
||||||
//#define TIME_MAP_PATH "/app/sd/timemap"
|
//#define TIME_MAP_PATH "/app/sd/timemap"
|
||||||
|
@ -54,7 +55,7 @@ extern sysMsg_t sendMsg;
|
||||||
|
|
||||||
void appSvrStopSendFile(void)
|
void appSvrStopSendFile(void)
|
||||||
{
|
{
|
||||||
printf("stop send file\n");
|
MLOGI("stop send file\n");
|
||||||
if(SendingFile == 1)
|
if(SendingFile == 1)
|
||||||
{
|
{
|
||||||
StopSendFile = 1;
|
StopSendFile = 1;
|
||||||
|
@ -67,7 +68,7 @@ char *find_file_name(const char *name)
|
||||||
int sep = '/';
|
int sep = '/';
|
||||||
if (NULL == name)
|
if (NULL == name)
|
||||||
{
|
{
|
||||||
printf("the path name is NULL\n");
|
MLOGE("the path name is NULL\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
name_start = strrchr(name, sep);
|
name_start = strrchr(name, sep);
|
||||||
|
@ -92,11 +93,11 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
struct tm mtime = {0};//, atime = {0}, ctime = {0};
|
struct tm mtime = {0};//, atime = {0}, ctime = {0};
|
||||||
APP_SVR_PACKET_T msgParse;
|
APP_SVR_PACKET_T msgParse;
|
||||||
|
|
||||||
printf("[SEND FILE oliver]file:%s\n", fname);
|
MLOGI("[SEND FILE oliver]file:%s\n", fname);
|
||||||
SendingFile = 1;
|
SendingFile = 1;
|
||||||
if((socket == 0) || (fname == NULL))
|
if((socket == 0) || (fname == NULL))
|
||||||
{
|
{
|
||||||
printf("appSvrSendFile param ERROR!\n");
|
MLOGE(" param ERROR!\n");
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -111,7 +112,7 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
fd = open((char *)fname, O_RDONLY /*SP5K_FS_OPEN_RDONLY*/);
|
fd = open((char *)fname, O_RDONLY /*SP5K_FS_OPEN_RDONLY*/);
|
||||||
if(fd == -1)
|
if(fd == -1)
|
||||||
{
|
{
|
||||||
printf("open file error: %s!", fname);
|
MLOGE("open file error: %s!", fname);
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -123,7 +124,7 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
//size = statbuff.st
|
//size = statbuff.st
|
||||||
//forbuild sp5kFsFileTimeGet(fname, &atime, &mtime, &ctime);
|
//forbuild sp5kFsFileTimeGet(fname, &atime, &mtime, &ctime);
|
||||||
//sp5kFsFileAttrGet();
|
//sp5kFsFileAttrGet();
|
||||||
printf("sp5kFsFileSizeGet:%d\n",size);
|
MLOGI("sp5kFsFileSizeGet:%d\n",size);
|
||||||
/**********get file name and path***********/
|
/**********get file name and path***********/
|
||||||
strcpy((char *)tempName, (char *)fname);
|
strcpy((char *)tempName, (char *)fname);
|
||||||
length = strlen((char *)tempName);
|
length = strlen((char *)tempName);
|
||||||
|
@ -140,7 +141,7 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("bufsize=%d,",PACKET_MAX_LEN);
|
MLOGI("bufsize=%d,",PACKET_MAX_LEN);
|
||||||
|
|
||||||
/*******send file respons cmd********/
|
/*******send file respons cmd********/
|
||||||
memset((void *)&msgParse, 0, sizeof(msgParse));
|
memset((void *)&msgParse, 0, sizeof(msgParse));
|
||||||
|
@ -165,7 +166,7 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
msgParse.msgBuf.rctrlFileTransferInfo.suffix = htons(MSG_END_FIX);
|
msgParse.msgBuf.rctrlFileTransferInfo.suffix = htons(MSG_END_FIX);
|
||||||
/* add the magic + len total 2*2 bytes; */
|
/* add the magic + len total 2*2 bytes; */
|
||||||
temp = ntohs(msgParse.msglen);
|
temp = ntohs(msgParse.msglen);
|
||||||
printf("send file:");
|
MLOGI("send file:");
|
||||||
//memdump((&msgParse), (temp + sizeof(UINT16)*2));
|
//memdump((&msgParse), (temp + sizeof(UINT16)*2));
|
||||||
send( socket,(void *)(&msgParse), (temp + sizeof(UINT16)*2), 0);
|
send( socket,(void *)(&msgParse), (temp + sizeof(UINT16)*2), 0);
|
||||||
//printf("send cmd = 0\n", htons(msgParse.cmd));
|
//printf("send cmd = 0\n", htons(msgParse.cmd));
|
||||||
|
@ -173,7 +174,7 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
|
|
||||||
if(ret != SUCCESS)
|
if(ret != SUCCESS)
|
||||||
{
|
{
|
||||||
printf("info error send fail!\n");
|
MLOGE("info error send fail!\n");
|
||||||
StopSendFile = 0;
|
StopSendFile = 0;
|
||||||
SendingFile = 0;
|
SendingFile = 0;
|
||||||
free(buff);
|
free(buff);
|
||||||
|
@ -196,11 +197,11 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
memset(buff, 0, PACKET_MAX_LEN);
|
memset(buff, 0, PACKET_MAX_LEN);
|
||||||
size = read(fd, buff, PACKET_MAX_LEN);
|
size = read(fd, buff, PACKET_MAX_LEN);
|
||||||
sendsize = send(socket, (void *)(buff), size, 0);
|
sendsize = send(socket, (void *)(buff), size, 0);
|
||||||
printf("writesize=%d,readsize=%d, i=%d-----",sendsize, size, i);
|
MLOGI("writesize=%d,readsize=%d, i=%d-----",sendsize, size, i);
|
||||||
|
|
||||||
if(sendsize < 1)
|
if(sendsize < 1)
|
||||||
{
|
{
|
||||||
printf("send error");
|
MLOGE("send error");
|
||||||
//forbuild sp5kFsFileSeek(fd, -size, SP5K_FS_SEEK_CUR);
|
//forbuild sp5kFsFileSeek(fd, -size, SP5K_FS_SEEK_CUR);
|
||||||
usleep(50*1000);
|
usleep(50*1000);
|
||||||
count++;
|
count++;
|
||||||
|
@ -234,17 +235,17 @@ UINT8 appSvrSendFile(UINT32 socket, const UINT8 *fname)
|
||||||
SendingFile = 0;
|
SendingFile = 0;
|
||||||
|
|
||||||
//appTimeDelayMs(10000);
|
//appTimeDelayMs(10000);
|
||||||
printf("fSize=%d,len=%d cnt=%d",fileTotalSize,length,count);
|
MLOGI("fSize=%d,len=%d cnt=%d",fileTotalSize,length,count);
|
||||||
printf("send end,fSize=%d,len=%d\n",fileTotalSize,length);
|
MLOGI("send end,fSize=%d,len=%d\n",fileTotalSize,length);
|
||||||
#if 1
|
#if 1
|
||||||
printf("count=%d,size=%d,stopflag=%d\n", count, size, StopSendFile);
|
MLOGI("count=%d,size=%d,stopflag=%d\n", count, size, StopSendFile);
|
||||||
if(length == fileTotalSize)
|
if(length == fileTotalSize)
|
||||||
{
|
{
|
||||||
printf("send file SUCCESS\n" );
|
MLOGI("send file SUCCESS\n" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("send file failed!\n");
|
MLOGE("send file failed!\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
@ -265,13 +266,13 @@ void *appSvrSendThread(void *p)
|
||||||
|
|
||||||
if(sendMsg.cmd == SEND_THUMB)
|
if(sendMsg.cmd == SEND_THUMB)
|
||||||
{
|
{
|
||||||
printf("cmd: SEND_THUMB\n");
|
MLOGI("cmd: SEND_THUMB\n");
|
||||||
socket = sendMsg.param;
|
socket = sendMsg.param;
|
||||||
appSvrSendFile(socket, (UINT8 *)"D:\\DCIM\\100MEDIA\\DCAM0001.JPG");
|
appSvrSendFile(socket, (UINT8 *)"D:\\DCIM\\100MEDIA\\DCAM0001.JPG");
|
||||||
}
|
}
|
||||||
else if(sendMsg.cmd == SEND_TIME_MAP)
|
else if(sendMsg.cmd == SEND_TIME_MAP)
|
||||||
{
|
{
|
||||||
printf("cmd: SEND_TIME_MAP\n");
|
MLOGI("cmd: SEND_TIME_MAP\n");
|
||||||
socket = sendMsg.param;
|
socket = sendMsg.param;
|
||||||
#if 0
|
#if 0
|
||||||
sprintf((char *)fileName, "%s/%04d%02d%02d.txt", TIME_MAP_PATH, puiPara->timeMapToday.year,
|
sprintf((char *)fileName, "%s/%04d%02d%02d.txt", TIME_MAP_PATH, puiPara->timeMapToday.year,
|
||||||
|
@ -282,13 +283,13 @@ void *appSvrSendThread(void *p)
|
||||||
else if(sendMsg.cmd == SEND_FILE)
|
else if(sendMsg.cmd == SEND_FILE)
|
||||||
{
|
{
|
||||||
extern UINT8 gFileName[];
|
extern UINT8 gFileName[];
|
||||||
printf("cmd: SEND_FILE->%s\n",gFileName);
|
MLOGI("cmd: SEND_FILE->%s\n",gFileName);
|
||||||
socket = sendMsg.param;
|
socket = sendMsg.param;
|
||||||
appSvrSendFile(socket, gFileName);
|
appSvrSendFile(socket, gFileName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("cmd: send other\n");
|
MLOGI("cmd: send other\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -300,7 +301,7 @@ SINT32 appSvrSendInit(void)
|
||||||
s32Ret = sem_init(&gAppSvrSendQueue, 0, 0);
|
s32Ret = sem_init(&gAppSvrSendQueue, 0, 0);
|
||||||
if ( s32Ret != 0 /*ROS_SUCCESS*/)
|
if ( s32Ret != 0 /*ROS_SUCCESS*/)
|
||||||
{
|
{
|
||||||
printf("[appSvrSendInit]Line %d, ret=0x%x\n", __LINE__, s32Ret);
|
MLOGI(" ret=0x%x\n", s32Ret);
|
||||||
//HOST_ASSERT(0);
|
//HOST_ASSERT(0);
|
||||||
return s32Ret;
|
return s32Ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@
|
||||||
#include "NvtUser/NvtUser.h"
|
#include "NvtUser/NvtUser.h"
|
||||||
#include "Mode/UIModePhoto.h"
|
#include "Mode/UIModePhoto.h"
|
||||||
#include "Mode/UIModeMovie.h"
|
#include "Mode/UIModeMovie.h"
|
||||||
|
#include "sf_log.h"
|
||||||
#if SF_LPA_SDK
|
#if SF_LPA_SDK
|
||||||
#include "lpasdk/api/lpasdk_api.h"
|
#include "lpasdk/api/lpasdk_api.h"
|
||||||
#include "sf_4g_lpa.h"
|
#include "sf_4g_lpa.h"
|
||||||
|
@ -220,9 +220,9 @@ static S32 sf_get_sd_info(UINT32 *pSDStatus, UINT32 *pSDFree, UINT32 *pSDTotalSi
|
||||||
*pSDTotalSize = 0;
|
*pSDTotalSize = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("pSDStatus = %d\n", *pSDStatus);
|
MLOGI("pSDStatus = %d\n", *pSDStatus);
|
||||||
printf("pSDFree = %d MB\n", *pSDFree);
|
MLOGI("pSDFree = %d MB\n", *pSDFree);
|
||||||
printf("pSDTotalSize = %d MB\n", *pSDTotalSize);
|
MLOGI("pSDTotalSize = %d MB\n", *pSDTotalSize);
|
||||||
|
|
||||||
return *pSDStatus;
|
return *pSDStatus;
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,7 @@ static void sf_set_zoom(U32 nZoom)
|
||||||
int nwidth = 2492;
|
int nwidth = 2492;
|
||||||
int nheight = 1400;
|
int nheight = 1400;
|
||||||
|
|
||||||
printf("[sf_set_zoom],nZoom:%d\n",nZoom);
|
MLOGI("[sf_set_zoom],nZoom:%d\n",nZoom);
|
||||||
if(nZoom == 2)
|
if(nZoom == 2)
|
||||||
{
|
{
|
||||||
nwidth = 1280;
|
nwidth = 1280;
|
||||||
|
@ -279,7 +279,7 @@ void sf_set_wifi_status(SF_WIFI_STATUS_E enStatus)
|
||||||
if(enStatus < SF_WIFI_BUTT)
|
if(enStatus < SF_WIFI_BUTT)
|
||||||
WifiStatus = enStatus;
|
WifiStatus = enStatus;
|
||||||
else
|
else
|
||||||
printf("Type format error\n");
|
MLOGE("Type format error\n");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -291,7 +291,7 @@ UINT32 sp5kFsFileSizeGet(const char *path)
|
||||||
struct stat statbuff;
|
struct stat statbuff;
|
||||||
if(stat(path, &statbuff) < 0)
|
if(stat(path, &statbuff) < 0)
|
||||||
{
|
{
|
||||||
printf("failed path:%s size:%ld\n", path, (unsigned long int)statbuff.st_size);
|
MLOGE("failed path:%s size:%ld\n", path, (unsigned long int)statbuff.st_size);
|
||||||
return filesize;
|
return filesize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -366,7 +366,7 @@ void appThumbNameToKey(thumbType_t *fileType, UINT16 *dirKey, UINT16 *fileKey, S
|
||||||
strncpy((char *)tempBuf, (char *)fileName, 3);
|
strncpy((char *)tempBuf, (char *)fileName, 3);
|
||||||
tempBuf[3] = '\0';
|
tempBuf[3] = '\0';
|
||||||
*dirKey = atoi((char *)tempBuf);
|
*dirKey = atoi((char *)tempBuf);
|
||||||
printf("dirkey str:%s id:%d\n",tempBuf,*dirKey);
|
MLOGI("dirkey str:%s id:%d\n",tempBuf,*dirKey);
|
||||||
|
|
||||||
strncpy((char *)tempBuf, (char *)fileName+3, 1);
|
strncpy((char *)tempBuf, (char *)fileName+3, 1);
|
||||||
tempBuf[1] = '\0';
|
tempBuf[1] = '\0';
|
||||||
|
@ -452,7 +452,7 @@ S8 *appThumbKeyToName(thumbSize_t imgSize, thumbType_t fileType, UINT16 dirKey,
|
||||||
/****check floder and creat it if that is not exist***end****/
|
/****check floder and creat it if that is not exist***end****/
|
||||||
|
|
||||||
sprintf((char *)fileName, "%s/%03d%1d%04d.JPG", path, dirKey, fileType, fileKey);
|
sprintf((char *)fileName, "%s/%03d%1d%04d.JPG", path, dirKey, fileType, fileKey);
|
||||||
printf("ThumbName:%s", fileName);
|
MLOGI("ThumbName:%s", fileName);
|
||||||
return fileName;
|
return fileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -541,7 +541,7 @@ static void cmdClientListPrint(clientContext_t *pHead)
|
||||||
clientContext_t *pClient = pHead;
|
clientContext_t *pClient = pHead;
|
||||||
while ( pClient != NULL )
|
while ( pClient != NULL )
|
||||||
{
|
{
|
||||||
printf("cmd socket:%d,port:%d,IP:%s\n",pClient->socket,htons(pClient->ClientAddr.sin_port),inet_ntoa(pClient->ClientAddr.sin_addr));
|
MLOGI("cmd socket:%d,port:%d,IP:%s\n",pClient->socket,htons(pClient->ClientAddr.sin_port),inet_ntoa(pClient->ClientAddr.sin_addr));
|
||||||
pClient = pClient->p_next;
|
pClient = pClient->p_next;
|
||||||
}
|
}
|
||||||
//printf("list end\n");
|
//printf("list end\n");
|
||||||
|
@ -553,13 +553,13 @@ void appsvr_getFileList(UINT8 *dirPath, UINT8 *startFileKey)
|
||||||
struct dirent *ptr = NULL;
|
struct dirent *ptr = NULL;
|
||||||
UINT32 nFileNums = 0;
|
UINT32 nFileNums = 0;
|
||||||
|
|
||||||
printf("[appsvr_getFileList] dirPath:%s\n", dirPath);
|
MLOGI(" dirPath:%s\n", dirPath);
|
||||||
if ((dir=opendir((char *)dirPath)) == NULL)
|
if ((dir=opendir((char *)dirPath)) == NULL)
|
||||||
{
|
{
|
||||||
printf("Open dir error...");
|
MLOGE("Open dir error...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("open success\n");
|
MLOGI("open success\n");
|
||||||
|
|
||||||
while ((ptr=readdir(dir)) != NULL)
|
while ((ptr=readdir(dir)) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -605,17 +605,17 @@ void appsvr_getDirList(UINT8* dirPath, UINT8 *startDirKey)
|
||||||
UINT32 nFileNums = 0;
|
UINT32 nFileNums = 0;
|
||||||
DIR *dir = NULL;
|
DIR *dir = NULL;
|
||||||
struct dirent *ptr = NULL;
|
struct dirent *ptr = NULL;
|
||||||
printf("appsvr_getDirList:%s,startDirKey:%s\n", dirPath,startDirKey);
|
MLOGI(" %s,startDirKey:%s\n", dirPath,startDirKey);
|
||||||
if ((dir=opendir((char *)dirPath)) == NULL)
|
if ((dir=opendir((char *)dirPath)) == NULL)
|
||||||
{
|
{
|
||||||
printf("Open dir error...\n");
|
MLOGE("Open dir error...\n");
|
||||||
printf("dir path:%s\n", dirPath);
|
MLOGE("dir path:%s\n", dirPath);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
printf("dir open success\n");
|
MLOGI("dir open success\n");
|
||||||
while ((ptr=readdir(dir)) != NULL)
|
while ((ptr=readdir(dir)) != NULL)
|
||||||
{
|
{
|
||||||
printf("ptr != NULL ,ptr->d_name:---%s,Type:%d-----\n", ptr->d_name,ptr->d_type);
|
MLOGI("ptr != NULL ,ptr->d_name:---%s,Type:%d-----\n", ptr->d_name,ptr->d_type);
|
||||||
if(strcmp(ptr->d_name,".")==0 || strcmp(ptr->d_name,"..")==0) ///current dir OR parrent dir
|
if(strcmp(ptr->d_name,".")==0 || strcmp(ptr->d_name,"..")==0) ///current dir OR parrent dir
|
||||||
continue;
|
continue;
|
||||||
else if(ptr->d_type == 4) ///dir
|
else if(ptr->d_type == 4) ///dir
|
||||||
|
@ -624,7 +624,7 @@ void appsvr_getDirList(UINT8* dirPath, UINT8 *startDirKey)
|
||||||
if(strncmp((char *)&ptr->d_name, (char *)startDirKey, 3) >= 0)
|
if(strncmp((char *)&ptr->d_name, (char *)startDirKey, 3) >= 0)
|
||||||
{
|
{
|
||||||
strcpy((char *)gDevDirList[nFileNums].dirName, (char *)ptr->d_name);
|
strcpy((char *)gDevDirList[nFileNums].dirName, (char *)ptr->d_name);
|
||||||
printf("gDevDirList:%s\n", gDevDirList[nFileNums].dirName);
|
MLOGI("gDevDirList:%s\n", gDevDirList[nFileNums].dirName);
|
||||||
nFileNums++;
|
nFileNums++;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -642,7 +642,7 @@ void appsvr_getDirList(UINT8* dirPath, UINT8 *startDirKey)
|
||||||
|
|
||||||
gDevDirListNums = nFileNums;
|
gDevDirListNums = nFileNums;
|
||||||
closedir(dir);
|
closedir(dir);
|
||||||
printf("appsvr_getDirList e,gDevDirListNums:%d >>>>>\n",gDevDirListNums);
|
MLOGI(" e,gDevDirListNums:%d >>>>>\n",gDevDirListNums);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG
|
||||||
UINT8 startFileKey[5] = {0};
|
UINT8 startFileKey[5] = {0};
|
||||||
UINT8 temp[5] = {0};
|
UINT8 temp[5] = {0};
|
||||||
|
|
||||||
printf("fileName:%s\n",fileName);
|
MLOGI("fileName:%s\n",fileName);
|
||||||
|
|
||||||
if(fileName != NULL && fileName[0] != '\0' && fileName[0] != '0')
|
if(fileName != NULL && fileName[0] != '\0' && fileName[0] != '0')
|
||||||
{
|
{
|
||||||
|
@ -719,7 +719,7 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG
|
||||||
|
|
||||||
memset(gDevFileList, 0, sizeof(gDevFileList));
|
memset(gDevFileList, 0, sizeof(gDevFileList));
|
||||||
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);
|
||||||
|
|
||||||
|
|
||||||
|
@ -730,7 +730,7 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG
|
||||||
|
|
||||||
// while((gDevDirList[i].dirName[0] != '\0') && (i <= DCF_DIR_NUM_MAX))
|
// while((gDevDirList[i].dirName[0] != '\0') && (i <= DCF_DIR_NUM_MAX))
|
||||||
{
|
{
|
||||||
printf("i=%d,dir:%s\n", i, gDevDirList[i].dirName);
|
MLOGI("i=%d,dir:%s\n", i, gDevDirList[i].dirName);
|
||||||
// printf("get file s\n");
|
// printf("get file s\n");
|
||||||
sprintf((char *)dirPath, "%s/%s", THUMB_PATH, gDevDirList[i].dirName);
|
sprintf((char *)dirPath, "%s/%s", THUMB_PATH, gDevDirList[i].dirName);
|
||||||
|
|
||||||
|
@ -742,7 +742,7 @@ void appCreatThumbList(S8 *fileName)//start file name example: 10010032.JPG
|
||||||
{
|
{
|
||||||
appsvr_getFileList(dirPath, temp);
|
appsvr_getFileList(dirPath, temp);
|
||||||
}
|
}
|
||||||
printf("get file e\n");
|
//printf("get file e\n");
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
@ -771,14 +771,14 @@ static UINT32 sf_get_mac_addr(char *ifName, UINT8 *MacBuf)
|
||||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if(sock < 0)
|
if(sock < 0)
|
||||||
{
|
{
|
||||||
printf("error sock");
|
MLOGE("error sock");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(ifreq.ifr_name, ifName);
|
strcpy(ifreq.ifr_name, ifName);
|
||||||
if(ioctl(sock,SIOCGIFHWADDR,&ifreq) < 0)
|
if(ioctl(sock,SIOCGIFHWADDR,&ifreq) < 0)
|
||||||
{
|
{
|
||||||
printf("error ioctl");
|
MLOGE("error ioctl");
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -787,7 +787,7 @@ static UINT32 sf_get_mac_addr(char *ifName, UINT8 *MacBuf)
|
||||||
sprintf((char *)MacBuf+3*i, "%02X:", (unsigned char)ifreq.ifr_hwaddr.sa_data[i]);
|
sprintf((char *)MacBuf+3*i, "%02X:", (unsigned char)ifreq.ifr_hwaddr.sa_data[i]);
|
||||||
}
|
}
|
||||||
MacBuf[strlen((char *)MacBuf) - 1] = 0;
|
MacBuf[strlen((char *)MacBuf) - 1] = 0;
|
||||||
printf("MAC: %s\n", MacBuf);
|
MLOGI("MAC: %s\n", MacBuf);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -796,22 +796,22 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
{
|
{
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
|
||||||
printf("camInfo:%x\n",camInfo->cmdRet);
|
MLOGI("camInfo:%x\n",camInfo->cmdRet);
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_sifar_param\n");
|
//MLOGI("[sf_app_Get_Camera_Info],sf_get_sifar_param\n");
|
||||||
|
|
||||||
camInfo->cmdRet = 0;
|
camInfo->cmdRet = 0;
|
||||||
//strcpy((char *)camInfo->protocolVersion, "1.0");
|
//strcpy((char *)camInfo->protocolVersion, "1.0");
|
||||||
|
|
||||||
printf("[sf_app_Get_Camera_Info],protocolVersion\n");
|
//printf("[sf_app_Get_Camera_Info],protocolVersion\n");
|
||||||
camInfo->devType = 0;
|
camInfo->devType = 0;
|
||||||
//strcpy((char *)camInfo->devId, "1.0.0.1");
|
//strcpy((char *)camInfo->devId, "1.0.0.1");
|
||||||
|
|
||||||
printf("[sf_app_Get_Camera_Info],devId\n");
|
// printf("[sf_app_Get_Camera_Info],devId\n");
|
||||||
camInfo->batLevel = sf_battery_level_get();
|
camInfo->batLevel = sf_battery_level_get();
|
||||||
if(camInfo->batLevel < 1)
|
if(camInfo->batLevel < 1)
|
||||||
camInfo->batLevel = 1;
|
camInfo->batLevel = 1;
|
||||||
|
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_Battery_Level\n");
|
//printf("[sf_app_Get_Camera_Info],sf_get_Battery_Level\n");
|
||||||
|
|
||||||
//camInfo->batteryPercent = camInfo->batLevel * 20;
|
//camInfo->batteryPercent = camInfo->batLevel * 20;
|
||||||
camInfo->batteryPercent = sf_battery_value_get(sf_get_night_led_flag());
|
camInfo->batteryPercent = sf_battery_value_get(sf_get_night_led_flag());
|
||||||
|
@ -826,7 +826,7 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
camInfo->SDFree = htonl(SDFree);
|
camInfo->SDFree = htonl(SDFree);
|
||||||
camInfo->SDTotalSize = htonl(SDTotalSize);
|
camInfo->SDTotalSize = htonl(SDTotalSize);
|
||||||
|
|
||||||
printf("[sf_app_Get_Camera_Info],get_sd_info\n");
|
// printf("[sf_app_Get_Camera_Info],get_sd_info\n");
|
||||||
#ifdef SF_SK
|
#ifdef SF_SK
|
||||||
//camInfo->GpsLongitude = htonl(0);
|
//camInfo->GpsLongitude = htonl(0);
|
||||||
//camInfo->GpsLatitude = htonl(0);
|
//camInfo->GpsLatitude = htonl(0);
|
||||||
|
@ -836,15 +836,15 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
//sf_get_sys_version(strTemp);
|
//sf_get_sys_version(strTemp);
|
||||||
|
|
||||||
strcpy((char *)camInfo->swVer, SF_BASE_VERSION);
|
strcpy((char *)camInfo->swVer, SF_BASE_VERSION);
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_sys_version\n");
|
//printf("[sf_app_Get_Camera_Info],sf_get_sys_version\n");
|
||||||
|
|
||||||
//sf_get_sifar_version(strTemp);
|
//sf_get_sifar_version(strTemp);
|
||||||
strcpy((char *)camInfo->swVer1, SF_BASE_VERSION_FEA);
|
strcpy((char *)camInfo->swVer1, SF_BASE_VERSION_FEA);
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_sifar_version\n");
|
//printf("[sf_app_Get_Camera_Info],sf_get_sifar_version\n");
|
||||||
|
|
||||||
//UINT8 mcuVersion=0, mcuSubVersion=0;
|
//UINT8 mcuVersion=0, mcuSubVersion=0;
|
||||||
//sf_mcu_ver_get(&mcuVersion, &mcuSubVersion);
|
//sf_mcu_ver_get(&mcuVersion, &mcuSubVersion);
|
||||||
printf("[sf_app_Get_Camera_Info],sf_mcu_version_get\n");
|
//printf("[sf_app_Get_Camera_Info],sf_mcu_version_get\n");
|
||||||
|
|
||||||
//char mcuVer[10]= {0};
|
//char mcuVer[10]= {0};
|
||||||
sf_mcu_version_get(camInfo->McuVer);
|
sf_mcu_version_get(camInfo->McuVer);
|
||||||
|
@ -857,11 +857,11 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
//UINT8 signalValue=0;
|
//UINT8 signalValue=0;
|
||||||
//sf_get_signal_level(&signalValue);
|
//sf_get_signal_level(&signalValue);
|
||||||
camInfo->signalLevel = sf_cardv_get_cq_signal();
|
camInfo->signalLevel = sf_cardv_get_cq_signal();
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_signal_level\n");
|
//printf("[sf_app_Get_Camera_Info],sf_get_signal_level\n");
|
||||||
|
|
||||||
//char strIccid[32]= {0};
|
//char strIccid[32]= {0};
|
||||||
//sf_get_iccid(strIccid);
|
//sf_get_iccid(strIccid);
|
||||||
printf("[sf_app_Get_Camera_Info],sf_get_iccid\n");
|
//printf("[sf_app_Get_Camera_Info],sf_get_iccid\n");
|
||||||
|
|
||||||
strcpy((char *)camInfo->SimICCID, puiPara->SimIccid);
|
strcpy((char *)camInfo->SimICCID, puiPara->SimIccid);
|
||||||
if(WIFI_TYPE_8189FS == sf_get_wifi_type())
|
if(WIFI_TYPE_8189FS == sf_get_wifi_type())
|
||||||
|
@ -873,7 +873,7 @@ void sf_app_Get_Camera_Info(MSG_DEV_INFO_Get_Rsp_T *camInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
camInfo->suffix = htons(0xFFEE);
|
camInfo->suffix = htons(0xFFEE);
|
||||||
printf("[sf_app_Get_Camera_Info],End\n");
|
MLOGI(" End\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
||||||
|
@ -902,7 +902,7 @@ void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
||||||
CamPara->cameraMode = 0;
|
CamPara->cameraMode = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Camera Mode:%d\n", CamPara->cameraMode);
|
MLOGI("Camera Mode:%d\n", CamPara->cameraMode);
|
||||||
|
|
||||||
//CamPara->cameraMode = puiPara->CamMode;
|
//CamPara->cameraMode = puiPara->CamMode;
|
||||||
|
|
||||||
|
@ -923,7 +923,7 @@ void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
||||||
CamPara->imageSize = 2;
|
CamPara->imageSize = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Image Size:%d\n", CamPara->imageSize);
|
MLOGI("Image Size:%d\n", CamPara->imageSize);
|
||||||
|
|
||||||
//CamPara->imageSize = puiPara->ImgSize;
|
//CamPara->imageSize = puiPara->ImgSize;
|
||||||
|
|
||||||
|
@ -937,11 +937,11 @@ void sf_app_Get_Camera_Para(MSG_DEV_Param_Get_Rsp_T *CamPara)
|
||||||
CamPara->timerStartMinute = puiPara->WorkTime[0].StartTime.Min;
|
CamPara->timerStartMinute = puiPara->WorkTime[0].StartTime.Min;
|
||||||
CamPara->timerEndHour = puiPara->WorkTime[0].StopTime.Hour;
|
CamPara->timerEndHour = puiPara->WorkTime[0].StopTime.Hour;
|
||||||
CamPara->timerEndMinute = puiPara->WorkTime[0].StopTime.Min;
|
CamPara->timerEndMinute = puiPara->WorkTime[0].StopTime.Min;
|
||||||
printf("timer:%d\n", puiPara->WorkTime1Switch);
|
MLOGI("timer:%d\n", puiPara->WorkTime1Switch);
|
||||||
printf("TimerHstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Hour);
|
MLOGI("TimerHstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Hour);
|
||||||
printf("TimerMstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Min);
|
MLOGI("TimerMstart[0]:%d\n", puiPara->WorkTime[0].StartTime.Min);
|
||||||
printf("TimerHstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Hour);
|
MLOGI("TimerHstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Hour);
|
||||||
printf("TimerMstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Min);
|
MLOGI("TimerMstop[0]:%d\n", puiPara->WorkTime[0].StopTime.Min);
|
||||||
|
|
||||||
CamPara->maxNum = puiPara->SendMaxNum;//MaxNumber
|
CamPara->maxNum = puiPara->SendMaxNum;//MaxNumber
|
||||||
CamPara->delay = puiPara->PirDelaySwitch;//DelayFlag
|
CamPara->delay = puiPara->PirDelaySwitch;//DelayFlag
|
||||||
|
@ -996,7 +996,7 @@ void sf_camera_name_check(SF_CHAR* str)
|
||||||
len = 4;
|
len = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("str:%s,len:%d\n", str, len);
|
MLOGI("str:%s,len:%d\n", str, len);
|
||||||
for(i = 0; i < len; i++)
|
for(i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
if((str[i] >= 'a') && (str[i] <= 'z'))
|
if((str[i] >= 'a') && (str[i] <= 'z'))
|
||||||
|
@ -1070,13 +1070,13 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
if(poweroff_mode == POWEROFF_COUNTDOWN)
|
if(poweroff_mode == POWEROFF_COUNTDOWN)
|
||||||
{
|
{
|
||||||
printf("Going power off, ignore cmd.\n");
|
MLOGE("Going power off, ignore cmd.\n");
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(NULL == pAppData || dataLen < 11)
|
if(NULL == pAppData || dataLen < 11)
|
||||||
{
|
{
|
||||||
printf("ERROR:input para error in sf_svr_packet_proc() \n");
|
MLOGE("ERROR:input para error in sf_svr_packet_proc() \n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1112,7 +1112,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
/*parse the msglen valid*/
|
/*parse the msglen valid*/
|
||||||
if(dataLen < msgTotolLen)//(msgTotolLen != dataLen )
|
if(dataLen < msgTotolLen)//(msgTotolLen != dataLen )
|
||||||
{
|
{
|
||||||
printf("[sf_svr_packet_proc]:recv the error length msg, just drop! t_len[%d] rcv_len[%d]\n",msgTotolLen, dataLen);
|
MLOGI(":recv the error length msg, just drop! t_len[%d] rcv_len[%d]\n",msgTotolLen, dataLen);
|
||||||
|
|
||||||
for( j=0; j<dataLen; j++)
|
for( j=0; j<dataLen; j++)
|
||||||
printf("%02x ",pAppData[j]);
|
printf("%02x ",pAppData[j]);
|
||||||
|
@ -1129,7 +1129,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
if(MSG_END_FIX != msgEndVal)
|
if(MSG_END_FIX != msgEndVal)
|
||||||
{
|
{
|
||||||
printf("[sf_svr_packet_proc]:recv the error endflag msg, just drop! rcv_e_flag[0x%x] \n",msgEndVal);
|
MLOGI(":recv the error endflag msg, just drop! rcv_e_flag[0x%x] \n",msgEndVal);
|
||||||
#if DEBUG_INFO_ON_LCD
|
#if DEBUG_INFO_ON_LCD
|
||||||
menuStrDisp(0, 4, "cmd END_FIX:0xFFEE error", 0, 0);
|
menuStrDisp(0, 4, "cmd END_FIX:0xFFEE error", 0, 0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1191,14 +1191,14 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WIFI_GET_CAMERA_INFORMATIION: //o
|
case WIFI_GET_CAMERA_INFORMATIION: //o
|
||||||
printf("[WIFI_GET_CAMERA_INFORMATIION],msgParse.msgBuf.rgetDevInfo:%x\n",msgParse.msgBuf.rgetDevInfo.cmdRet);
|
MLOGI("[WIFI_GET_CAMERA_INFORMATIION],msgParse.msgBuf.rgetDevInfo:%x\n",msgParse.msgBuf.rgetDevInfo.cmdRet);
|
||||||
sf_app_Get_Camera_Info(&msgParse.msgBuf.rgetDevInfo);
|
sf_app_Get_Camera_Info(&msgParse.msgBuf.rgetDevInfo);
|
||||||
msgParse.msglen = htons(sizeof(MSG_DEV_INFO_Get_Rsp_T) + 2*sizeof(UINT16) );
|
msgParse.msglen = htons(sizeof(MSG_DEV_INFO_Get_Rsp_T) + 2*sizeof(UINT16) );
|
||||||
respFlag = 1;
|
respFlag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_GET_CAMERA_PARAM: //o
|
case WIFI_GET_CAMERA_PARAM: //o
|
||||||
printf("[WIFI_GET_CAMERA_PARAM]\n");
|
MLOGI("[WIFI_GET_CAMERA_PARAM]\n");
|
||||||
sf_app_Get_Camera_Para(&msgParse.msgBuf.rgetDevParam);
|
sf_app_Get_Camera_Para(&msgParse.msgBuf.rgetDevParam);
|
||||||
/* add the cmd + resp total 2*2 bytes */
|
/* add the cmd + resp total 2*2 bytes */
|
||||||
msgParse.msglen = htons(sizeof(MSG_DEV_Param_Get_Rsp_T) + 2*sizeof(UINT16) );
|
msgParse.msglen = htons(sizeof(MSG_DEV_Param_Get_Rsp_T) + 2*sizeof(UINT16) );
|
||||||
|
@ -1207,7 +1207,7 @@ 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);
|
||||||
printf("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName);
|
MLOGI("[WIFI_GET_FILE_THUMBLIST],fileName:%s\n",fileName);
|
||||||
appCreatThumbList(fileName);
|
appCreatThumbList(fileName);
|
||||||
|
|
||||||
memset((void *)&msgParse, 0, sizeof(msgParse));
|
memset((void *)&msgParse, 0, sizeof(msgParse));
|
||||||
|
@ -1226,7 +1226,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
//memdump((&msgParse), (temp + sizeof(UINT16)*2));
|
//memdump((&msgParse), (temp + sizeof(UINT16)*2));
|
||||||
sendSize = 0;
|
sendSize = 0;
|
||||||
fileListSize = gDevFileListNums*sizeof(MSG_DEV_THUMB_LIST_Get_Data_Rsp_T);
|
fileListSize = gDevFileListNums*sizeof(MSG_DEV_THUMB_LIST_Get_Data_Rsp_T);
|
||||||
printf("start send fileList,sendSize:%d,gDevFileListNums:%d,fileListSize:%d\n",sendSize,gDevFileListNums,fileListSize);
|
MLOGI("start send fileList,sendSize:%d,gDevFileListNums:%d,fileListSize:%d\n",sendSize,gDevFileListNums,fileListSize);
|
||||||
while(sendSize < fileListSize)
|
while(sendSize < fileListSize)
|
||||||
{
|
{
|
||||||
// printf("sending fileList,sendSize:%d\n",sendSize);
|
// printf("sending fileList,sendSize:%d\n",sendSize);
|
||||||
|
@ -1255,18 +1255,18 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
if(sendSize == fileListSize)
|
if(sendSize == fileListSize)
|
||||||
{
|
{
|
||||||
printf("send success,fileSize=%d,sendSize=%d\n", fileListSize, sendSize);
|
MLOGI("send success,fileSize=%d,sendSize=%d\n", fileListSize, sendSize);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("send failed, time out!fileSize=%d,sendSize=%d\n", fileListSize, sendSize);
|
MLOGE("send failed, time out!fileSize=%d,sendSize=%d\n", fileListSize, sendSize);
|
||||||
}
|
}
|
||||||
respFlag = 0;
|
respFlag = 0;
|
||||||
sleep(2);
|
sleep(2);
|
||||||
break;
|
break;
|
||||||
#if 1
|
#if 1
|
||||||
case WIFI_GET_CAMERA_HD_FILE: //
|
case WIFI_GET_CAMERA_HD_FILE: //
|
||||||
printf("[WIFI_GET_CAMERA_HD_FILE],type:%d,dirName:%s\n",pMsgStruct->msgBuf.getHdFile.type,pMsgStruct->msgBuf.getHdFile.dirName);
|
MLOGI("[WIFI_GET_CAMERA_HD_FILE],type:%d,dirName:%s\n",pMsgStruct->msgBuf.getHdFile.type,pMsgStruct->msgBuf.getHdFile.dirName);
|
||||||
if(pMsgStruct->msgBuf.getHdFile.type == 0) //thumbnail
|
if(pMsgStruct->msgBuf.getHdFile.type == 0) //thumbnail
|
||||||
{
|
{
|
||||||
strcpy((char *)tempbuf, (char *)pMsgStruct->msgBuf.getHdFile.dirName);
|
strcpy((char *)tempbuf, (char *)pMsgStruct->msgBuf.getHdFile.dirName);
|
||||||
|
@ -1298,14 +1298,14 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case WIFI_SET_CAMERA_Zoom: //
|
case WIFI_SET_CAMERA_Zoom: //
|
||||||
printf("[WIFI_SET_CAMERA_Zoom],Zoom:%d\n",puiPara->Zoom);
|
MLOGI("[WIFI_SET_CAMERA_Zoom],Zoom:%d\n",puiPara->Zoom);
|
||||||
puiPara->Zoom = pMsgStruct->msgBuf.deviceZoomSet.zoom;
|
puiPara->Zoom = pMsgStruct->msgBuf.deviceZoomSet.zoom;
|
||||||
puiPara->Zoom = (puiPara->Zoom > 4 ? 1 : puiPara->Zoom);
|
puiPara->Zoom = (puiPara->Zoom > 4 ? 1 : puiPara->Zoom);
|
||||||
|
|
||||||
//forbuild sp5kModeGet(&curMode);
|
//forbuild sp5kModeGet(&curMode);
|
||||||
curMode = 0;//forbuild
|
curMode = 0;//forbuild
|
||||||
printf("mode = 0x%x, zoom = %d,\n", curMode, puiPara->Zoom);
|
MLOGI("mode = 0x%x, zoom = %d,\n", curMode, puiPara->Zoom);
|
||||||
printf(" factor = %d\n", zmFactor[puiPara->Zoom]);
|
MLOGI(" factor = %d\n", zmFactor[puiPara->Zoom]);
|
||||||
//forbuild sp5kZoomFactorSet(curMode, zmFactor[puiPara.zoom]);
|
//forbuild sp5kZoomFactorSet(curMode, zmFactor[puiPara.zoom]);
|
||||||
sf_set_zoom(puiPara->Zoom);
|
sf_set_zoom(puiPara->Zoom);
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1330,7 +1330,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
saveMode = 1;
|
saveMode = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("[WIFI_SET_CAMERA_CameraMode],cameraMode:%d,savemode:%d\n",pMsgStruct->msgBuf.setCameraMode.cameraMode,saveMode);
|
MLOGI("[WIFI_SET_CAMERA_CameraMode],cameraMode:%d,savemode:%d\n",pMsgStruct->msgBuf.setCameraMode.cameraMode,saveMode);
|
||||||
|
|
||||||
if(saveMode != pMsgStruct->msgBuf.setCameraMode.cameraMode)
|
if(saveMode != pMsgStruct->msgBuf.setCameraMode.cameraMode)
|
||||||
{
|
{
|
||||||
|
@ -1390,7 +1390,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
case WIFI_SET_CAMERA_ImageSize: //O
|
case WIFI_SET_CAMERA_ImageSize: //O
|
||||||
{
|
{
|
||||||
U8 tmpValue;
|
U8 tmpValue;
|
||||||
printf("[WIFI_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize);
|
MLOGI("[WIFI_SET_CAMERA_ImageSize],ImgSize:%d\n",puiPara->ImgSize);
|
||||||
tmpValue = pMsgStruct->msgBuf.setImageSize.imageSize;
|
tmpValue = pMsgStruct->msgBuf.setImageSize.imageSize;
|
||||||
|
|
||||||
if(tmpValue == 0)
|
if(tmpValue == 0)
|
||||||
|
@ -1425,7 +1425,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_MultiShot: //O
|
case WIFI_SET_CAMERA_MultiShot: //O
|
||||||
printf("Multishot:%d\nMultishotInterval:%d\n,SendMultishot:%d\n", pMsgStruct->msgBuf.setMultiShot.multiShot,
|
MLOGI("Multishot:%d\nMultishotInterval:%d\n,SendMultishot:%d\n", pMsgStruct->msgBuf.setMultiShot.multiShot,
|
||||||
pMsgStruct->msgBuf.setMultiShot.multiInterval,
|
pMsgStruct->msgBuf.setMultiShot.multiInterval,
|
||||||
pMsgStruct->msgBuf.setMultiShot.sendMulti);
|
pMsgStruct->msgBuf.setMultiShot.sendMulti);
|
||||||
puiPara->Multishot = pMsgStruct->msgBuf.setMultiShot.multiShot % 3+1;
|
puiPara->Multishot = pMsgStruct->msgBuf.setMultiShot.multiShot % 3+1;
|
||||||
|
@ -1459,7 +1459,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_PirSensitivity: //O
|
case WIFI_SET_CAMERA_PirSensitivity: //O
|
||||||
printf("[WIFI_SET_CAMERA_PirSensitivity],DigitPirSensitivity:%d\n",pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity);
|
MLOGI("[WIFI_SET_CAMERA_PirSensitivity],DigitPirSensitivity:%d\n",pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity);
|
||||||
sf_set_pir_sensitivity(pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity % 10);
|
sf_set_pir_sensitivity(pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity % 10);
|
||||||
|
|
||||||
/*puiPara->PirSensitivity = pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity % 10;
|
/*puiPara->PirSensitivity = pMsgStruct->msgBuf.setPirSensitivity.PirSensitivity % 10;
|
||||||
|
@ -1477,7 +1477,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_Timer: //O
|
case WIFI_SET_CAMERA_Timer: //O
|
||||||
printf("[WIFI_SET_CAMERA_Timer],timer:%d\n",pMsgStruct->msgBuf.setTimer.timer);
|
MLOGI("[WIFI_SET_CAMERA_Timer],timer:%d\n",pMsgStruct->msgBuf.setTimer.timer);
|
||||||
puiPara->WorkTime1Switch = !!pMsgStruct->msgBuf.setTimer.timer;
|
puiPara->WorkTime1Switch = !!pMsgStruct->msgBuf.setTimer.timer;
|
||||||
puiPara->WorkTime[0].StartTime.Hour = pMsgStruct->msgBuf.setTimer.timerStartHour % 24;
|
puiPara->WorkTime[0].StartTime.Hour = pMsgStruct->msgBuf.setTimer.timerStartHour % 24;
|
||||||
puiPara->WorkTime[0].StartTime.Min = pMsgStruct->msgBuf.setTimer.timerStartMinute % 60;
|
puiPara->WorkTime[0].StartTime.Min = pMsgStruct->msgBuf.setTimer.timerStartMinute % 60;
|
||||||
|
@ -1493,14 +1493,14 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_MaxNum: //O
|
case WIFI_SET_CAMERA_MaxNum: //O
|
||||||
printf("[WIFI_SET_CAMERA_MaxNum],SendMaxNum:%d\n",pMsgStruct->msgBuf.setMaxNum.maxNum);
|
MLOGI("[WIFI_SET_CAMERA_MaxNum],SendMaxNum:%d\n",pMsgStruct->msgBuf.setMaxNum.maxNum);
|
||||||
puiPara->SendMaxNum = pMsgStruct->msgBuf.setMaxNum.maxNum % 100;
|
puiPara->SendMaxNum = pMsgStruct->msgBuf.setMaxNum.maxNum % 100;
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
paramSaveFlag = 1;
|
paramSaveFlag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_Delay: //O
|
case WIFI_SET_CAMERA_Delay: //O
|
||||||
printf("[WIFI_SET_CAMERA_Delay],delay:%d\n",pMsgStruct->msgBuf.setDelay.delay);
|
MLOGI("[WIFI_SET_CAMERA_Delay],delay:%d\n",pMsgStruct->msgBuf.setDelay.delay);
|
||||||
puiPara->PirDelaySwitch = !!pMsgStruct->msgBuf.setDelay.delay;
|
puiPara->PirDelaySwitch = !!pMsgStruct->msgBuf.setDelay.delay;
|
||||||
puiPara->PirDelayTime.Hour = pMsgStruct->msgBuf.setDelay.delayHour % 24;
|
puiPara->PirDelayTime.Hour = pMsgStruct->msgBuf.setDelay.delayHour % 24;
|
||||||
puiPara->PirDelayTime.Min = pMsgStruct->msgBuf.setDelay.delayMinute % 60;
|
puiPara->PirDelayTime.Min = pMsgStruct->msgBuf.setDelay.delayMinute % 60;
|
||||||
|
@ -1510,14 +1510,14 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_SDLoop: //O
|
case WIFI_SET_CAMERA_SDLoop: //O
|
||||||
printf("[WIFI_SET_CAMERA_SDLoop],SDLoop:%d\n",pMsgStruct->msgBuf.setSDLoop.SDLoop);
|
MLOGI("[WIFI_SET_CAMERA_SDLoop],SDLoop:%d\n",pMsgStruct->msgBuf.setSDLoop.SDLoop);
|
||||||
puiPara->SdLoopSwitch = !!pMsgStruct->msgBuf.setSDLoop.SDLoop;
|
puiPara->SdLoopSwitch = !!pMsgStruct->msgBuf.setSDLoop.SDLoop;
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
paramSaveFlag = 1;
|
paramSaveFlag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_FlashPower: //O
|
case WIFI_SET_CAMERA_FlashPower: //O
|
||||||
printf("[WIFI_SET_CAMERA_FlashPower],flashPower:%d\n",pMsgStruct->msgBuf.setFlashPower.flashPower);
|
MLOGI("[WIFI_SET_CAMERA_FlashPower],flashPower:%d\n",pMsgStruct->msgBuf.setFlashPower.flashPower);
|
||||||
|
|
||||||
puiPara->FlashLed = !!pMsgStruct->msgBuf.setFlashPower.flashPower;
|
puiPara->FlashLed = !!pMsgStruct->msgBuf.setFlashPower.flashPower;
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1525,7 +1525,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_NightMode: //O
|
case WIFI_SET_CAMERA_NightMode: //O
|
||||||
printf("[WIFI_SET_CAMERA_NightMode],nightMode:%d\n",pMsgStruct->msgBuf.setNightMode.nightMode);
|
MLOGI("[WIFI_SET_CAMERA_NightMode],nightMode:%d\n",pMsgStruct->msgBuf.setNightMode.nightMode);
|
||||||
puiPara->NightMode = pMsgStruct->msgBuf.setNightMode.nightMode % 3;
|
puiPara->NightMode = pMsgStruct->msgBuf.setNightMode.nightMode % 3;
|
||||||
//sf_set_img_size(puiPara->ImgSize);
|
//sf_set_img_size(puiPara->ImgSize);
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1533,10 +1533,10 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_SendType: //O
|
case WIFI_SET_CAMERA_SendType: //O
|
||||||
printf("[WIFI_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType);
|
MLOGI("[WIFI_SET_CAMERA_SendType],sendType:%d\n",pMsgStruct->msgBuf.setSendType.sendType);
|
||||||
if(puiPara->GprsMode == 0)
|
if(puiPara->GprsMode == 0)
|
||||||
{
|
{
|
||||||
puiPara->SendType = pMsgStruct->msgBuf.setSendType.sendType % 3;
|
puiPara->SendType = pMsgStruct->msgBuf.setSendType.sendType % 3;
|
||||||
puiPara->TimeSend1.Hour = pMsgStruct->msgBuf.setSendType.sendFirstTimeH % 24;
|
puiPara->TimeSend1.Hour = pMsgStruct->msgBuf.setSendType.sendFirstTimeH % 24;
|
||||||
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
puiPara->TimeSend1.Min = pMsgStruct->msgBuf.setSendType.sendFirstTimeM % 60;
|
||||||
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
puiPara->TimeSend2.Hour = pMsgStruct->msgBuf.setSendType.sendSecondTimeH % 24;
|
||||||
|
@ -1561,6 +1561,8 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
puiPara->TimeSend1Switch = 1;
|
puiPara->TimeSend1Switch = 1;
|
||||||
puiPara->TimeSend2Switch = 1;
|
puiPara->TimeSend2Switch = 1;
|
||||||
}
|
}
|
||||||
|
MLOGI("SendType:%d TimeSend1Switch:%d %02d:%02d TimeSend2Switch:%d %02d:%02d\n",puiPara->SendType,puiPara->TimeSend1Switch,puiPara->TimeSend1.Hour,puiPara->TimeSend1.Min,puiPara->TimeSend2Switch, puiPara->TimeSend2.Hour,puiPara->TimeSend2.Min);
|
||||||
|
|
||||||
}
|
}
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
paramSaveFlag = 1;
|
paramSaveFlag = 1;
|
||||||
|
@ -1589,7 +1591,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_VideoSize://err
|
case WIFI_SET_CAMERA_VideoSize://err
|
||||||
printf("[WIFI_SET_CAMERA_VideoSize],videoSize:%d\n",pMsgStruct->msgBuf.setVideoSize.videoSize);
|
MLOGI("[WIFI_SET_CAMERA_VideoSize],videoSize:%d\n",pMsgStruct->msgBuf.setVideoSize.videoSize);
|
||||||
puiPara->VideoSize = pMsgStruct->msgBuf.setVideoSize.videoSize % 3;
|
puiPara->VideoSize = pMsgStruct->msgBuf.setVideoSize.videoSize % 3;
|
||||||
//forbuild appMediaAttrUpdate(puiPara.VideoSize);
|
//forbuild appMediaAttrUpdate(puiPara.VideoSize);
|
||||||
//sf_set_video_size(puiPara->VideoSize);
|
//sf_set_video_size(puiPara->VideoSize);
|
||||||
|
@ -1598,7 +1600,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_VideoTime: //O
|
case WIFI_SET_CAMERA_VideoTime: //O
|
||||||
printf("[WIFI_SET_CAMERA_VideoTime],videoTime:%d\n",pMsgStruct->msgBuf.setVideoTime.videoTime);
|
MLOGI("[WIFI_SET_CAMERA_VideoTime],videoTime:%d\n",pMsgStruct->msgBuf.setVideoTime.videoTime);
|
||||||
puiPara->VideoLenth = pMsgStruct->msgBuf.setVideoTime.videoTime+5;
|
puiPara->VideoLenth = pMsgStruct->msgBuf.setVideoTime.videoTime+5;
|
||||||
//puiPara->VideoLenth = (puiPara->VideoLenth > 55 ? 0 : puiPara->VideoLenth);
|
//puiPara->VideoLenth = (puiPara->VideoLenth > 55 ? 0 : puiPara->VideoLenth);
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1606,7 +1608,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_BatteryType: //O
|
case WIFI_SET_CAMERA_BatteryType: //O
|
||||||
printf("[WIFI_SET_CAMERA_BatteryType],batType:%d\n",pMsgStruct->msgBuf.setBatType.batType);
|
MLOGI("[WIFI_SET_CAMERA_BatteryType],batType:%d\n",pMsgStruct->msgBuf.setBatType.batType);
|
||||||
puiPara->BatteryType = pMsgStruct->msgBuf.setBatType.batType;
|
puiPara->BatteryType = pMsgStruct->msgBuf.setBatType.batType;
|
||||||
puiPara->BatteryType = (puiPara->BatteryType > 3 ? 0 : puiPara->BatteryType);
|
puiPara->BatteryType = (puiPara->BatteryType > 3 ? 0 : puiPara->BatteryType);
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
|
@ -1614,18 +1616,18 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_CameraID: //O
|
case WIFI_SET_CAMERA_CameraID: //O
|
||||||
printf("[WIFI_SET_CAMERA_CameraID],cameraID:%d\n",pMsgStruct->msgBuf.setCameraID.cameraID);
|
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 : 1;
|
||||||
strncpy(puiPara->CamNameStr, (char *)pMsgStruct->msgBuf.setCameraID.cameraIDstr, 4); //Use SF_STRNCPY to avoid that APP has not send '\0'.
|
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);
|
sf_camera_name_check(puiPara->CamNameStr);
|
||||||
puiPara->CamNameStr[4] = '\0';
|
puiPara->CamNameStr[4] = '\0';
|
||||||
printf("Camid:%d,str:%s\n", puiPara->CamNameSwitch, puiPara->CamNameStr);
|
MLOGI("Camid:%d,str:%s\n", puiPara->CamNameSwitch, puiPara->CamNameStr);
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
paramSaveFlag = 1;
|
paramSaveFlag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_DateTime: //O
|
case WIFI_SET_CAMERA_DateTime: //O
|
||||||
printf("[WIFI_SET_CAMERA_DateTime],DateAuto:%d\n",pMsgStruct->msgBuf.setDateTime.dateTimeAuto);
|
MLOGI("[WIFI_SET_CAMERA_DateTime],DateAuto:%d\n",pMsgStruct->msgBuf.setDateTime.dateTimeAuto);
|
||||||
puiPara->DateAuto = !pMsgStruct->msgBuf.setDateTime.dateTimeAuto; //NTPAuto 0: Auto , 1: Manual
|
puiPara->DateAuto = !pMsgStruct->msgBuf.setDateTime.dateTimeAuto; //NTPAuto 0: Auto , 1: Manual
|
||||||
//puiPara->NTPZone = pMsgStruct->msgBuf.setDateTime.timeZone % 7;
|
//puiPara->NTPZone = pMsgStruct->msgBuf.setDateTime.timeZone % 7;
|
||||||
time.Year = htons(pMsgStruct->msgBuf.setDateTime.year);
|
time.Year = htons(pMsgStruct->msgBuf.setDateTime.year);
|
||||||
|
@ -1636,7 +1638,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
time.Sec = pMsgStruct->msgBuf.setDateTime.second % 60;
|
time.Sec = pMsgStruct->msgBuf.setDateTime.second % 60;
|
||||||
if(puiPara->DateAuto == 1) //1: Manual
|
if(puiPara->DateAuto == 1) //1: Manual
|
||||||
{
|
{
|
||||||
printf("Set RTC %d %d %d %d:%d%d\n", time.Year, time.Mon, time.Day, time.Hour, time.Min, time.Sec);
|
MLOGI("Set RTC %d %d %d %d:%d%d\n", time.Year, time.Mon, time.Day, time.Hour, time.Min, time.Sec);
|
||||||
sf_sys_rtc_time_set(&time);
|
sf_sys_rtc_time_set(&time);
|
||||||
sf_cardv_set_mcu_rtc_flag();
|
sf_cardv_set_mcu_rtc_flag();
|
||||||
}
|
}
|
||||||
|
@ -1644,7 +1646,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_GPS: //o
|
case WIFI_SET_CAMERA_GPS: //o
|
||||||
printf("[WIFI_SET_CAMERA_GPS],gpsSendType:%d\n",pMsgStruct->msgBuf.setGPS.gpsSendType);
|
MLOGI("[WIFI_SET_CAMERA_GPS],gpsSendType:%d\n",pMsgStruct->msgBuf.setGPS.gpsSendType);
|
||||||
#if SF_GPS_SUPPORT
|
#if SF_GPS_SUPPORT
|
||||||
puiPara->GpsSwitch = pMsgStruct->msgBuf.setGPS.gpsSwitch % 2;
|
puiPara->GpsSwitch = pMsgStruct->msgBuf.setGPS.gpsSwitch % 2;
|
||||||
puiPara->GpsNumber = pMsgStruct->msgBuf.setGPS.gpsSendType % 3;
|
puiPara->GpsNumber = pMsgStruct->msgBuf.setGPS.gpsSendType % 3;
|
||||||
|
@ -1654,7 +1656,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_timeLapse: //O
|
case WIFI_SET_CAMERA_timeLapse: //O
|
||||||
printf("[WIFI_SET_CAMERA_timeLapse],timelapse:%d\n",pMsgStruct->msgBuf.setTimeLapseTime.timelapse);
|
MLOGI("[WIFI_SET_CAMERA_timeLapse],timelapse:%d\n",pMsgStruct->msgBuf.setTimeLapseTime.timelapse);
|
||||||
puiPara->TimelapseSwitch = pMsgStruct->msgBuf.setTimeLapseTime.timelapse % 2;
|
puiPara->TimelapseSwitch = pMsgStruct->msgBuf.setTimeLapseTime.timelapse % 2;
|
||||||
puiPara->TimelapseTime.Hour = pMsgStruct->msgBuf.setTimeLapseTime.timelapseHour % 24;
|
puiPara->TimelapseTime.Hour = pMsgStruct->msgBuf.setTimeLapseTime.timelapseHour % 24;
|
||||||
puiPara->TimelapseTime.Min = pMsgStruct->msgBuf.setTimeLapseTime.timelapseMin % 60;
|
puiPara->TimelapseTime.Min = pMsgStruct->msgBuf.setTimeLapseTime.timelapseMin % 60;
|
||||||
|
@ -1668,16 +1670,16 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_PicUponDailyReport: //O
|
case WIFI_SET_CAMERA_PicUponDailyReport: //O
|
||||||
printf("[WIFI_SET_CAMERA_PicUponDailyReport],picUponDailyReport:%d\n",pMsgStruct->msgBuf.setDailyReport.picUponDailyReport);
|
MLOGI("[WIFI_SET_CAMERA_PicUponDailyReport],picUponDailyReport:%d\n",pMsgStruct->msgBuf.setDailyReport.picUponDailyReport);
|
||||||
puiPara->PicUpDailyReport = pMsgStruct->msgBuf.setDailyReport.picUponDailyReport;
|
puiPara->PicUpDailyReport = pMsgStruct->msgBuf.setDailyReport.picUponDailyReport;
|
||||||
respFlag = 2;
|
respFlag = 2;
|
||||||
paramSaveFlag = 1;
|
paramSaveFlag = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_SET_CAMERA_WifiPWD: //
|
case WIFI_SET_CAMERA_WifiPWD: //
|
||||||
printf("[WIFI_CONTROL_CAMERA_ModifyPWD],pwd:%s\n",pMsgStruct->msgBuf.setWifiPWD.newPWD);
|
MLOGI("[WIFI_CONTROL_CAMERA_ModifyPWD],pwd:%s\n",pMsgStruct->msgBuf.setWifiPWD.newPWD);
|
||||||
strncpy((char *)puiPara->WifiApPWD, (char *)pMsgStruct->msgBuf.setWifiPWD.newPWD, 16);
|
strncpy((char *)puiPara->WifiApPWD, (char *)pMsgStruct->msgBuf.setWifiPWD.newPWD, 16);
|
||||||
printf("new AP PWD: %s\n", puiPara->WifiApPWD);
|
MLOGI("new AP PWD: %s\n", puiPara->WifiApPWD);
|
||||||
paraNeedReboot = 1;
|
paraNeedReboot = 1;
|
||||||
//sp5kHostMsgSend(APP_UI_MSG_WIFI_REBOOT, 0);
|
//sp5kHostMsgSend(APP_UI_MSG_WIFI_REBOOT, 0);
|
||||||
poweroff_mode = POWEROFF_KEYREBOOT;
|
poweroff_mode = POWEROFF_KEYREBOOT;
|
||||||
|
@ -1688,7 +1690,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_FormatSDCard: //err
|
case WIFI_CONTROL_CAMERA_FormatSDCard: //err
|
||||||
printf("[WIFI_CONTROL_CAMERA_FormatSDCard],format:%d\n",pMsgStruct->msgBuf.ctrlFormat.format);
|
MLOGI("[WIFI_CONTROL_CAMERA_FormatSDCard],format:%d\n",pMsgStruct->msgBuf.ctrlFormat.format);
|
||||||
if(pMsgStruct->msgBuf.ctrlFormat.format == 1)
|
if(pMsgStruct->msgBuf.ctrlFormat.format == 1)
|
||||||
{
|
{
|
||||||
sf_set_card_statu(CMD_FORMAT_SD_STA);
|
sf_set_card_statu(CMD_FORMAT_SD_STA);
|
||||||
|
@ -1706,7 +1708,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_Reboot: //err
|
case WIFI_CONTROL_CAMERA_Reboot: //err
|
||||||
printf("[WIFI_CONTROL_CAMERA_Reboot],reboot:%d\n",pMsgStruct->msgBuf.ctrlReboot.reboot);
|
MLOGI("[WIFI_CONTROL_CAMERA_Reboot],reboot:%d\n",pMsgStruct->msgBuf.ctrlReboot.reboot);
|
||||||
tmp = pMsgStruct->msgBuf.ctrlReboot.reboot;
|
tmp = pMsgStruct->msgBuf.ctrlReboot.reboot;
|
||||||
poweroff_mode = POWEROFF_KEYREBOOT;
|
poweroff_mode = POWEROFF_KEYREBOOT;
|
||||||
paraNeedReboot = 1;
|
paraNeedReboot = 1;
|
||||||
|
@ -1715,7 +1717,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_Recovery: //
|
case WIFI_CONTROL_CAMERA_Recovery: //
|
||||||
printf("[WIFI_CONTROL_CAMERA_Recovery]\n");
|
MLOGI("[WIFI_CONTROL_CAMERA_Recovery]\n");
|
||||||
Reset_MenuInfo();
|
Reset_MenuInfo();
|
||||||
//sf_daily_report_count_clear();
|
//sf_daily_report_count_clear();
|
||||||
paraNeedReboot = 1;
|
paraNeedReboot = 1;
|
||||||
|
@ -1723,7 +1725,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_CloseAPMode: //err
|
case WIFI_CONTROL_CAMERA_CloseAPMode: //err
|
||||||
printf("[WIFI_CONTROL_CAMERA_CloseAPMode]\n");
|
MLOGI("[WIFI_CONTROL_CAMERA_CloseAPMode]\n");
|
||||||
//poweroff_mode = POWEROFF_PVDOWN;
|
//poweroff_mode = POWEROFF_PVDOWN;
|
||||||
//appGoToPoweroff();
|
//appGoToPoweroff();
|
||||||
//appPowerOffUiMsgSend(APP_POWER_OFF_NORMAL);
|
//appPowerOffUiMsgSend(APP_POWER_OFF_NORMAL);
|
||||||
|
@ -1742,7 +1744,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
keyMap = ntohl(pMsgStruct->msgBuf.ctrlFileTransfer.PORT);
|
keyMap = ntohl(pMsgStruct->msgBuf.ctrlFileTransfer.PORT);
|
||||||
function = pMsgStruct->msgBuf.ctrlFileTransfer.function;
|
function = pMsgStruct->msgBuf.ctrlFileTransfer.function;
|
||||||
printf("[WIFI_CONTROL_CAMERA_FileTransfer], keyMap=%d, function=%d,type:%d\n",keyMap,function,pMsgStruct->msgBuf.ctrlFileTransfer.type);
|
MLOGI("[WIFI_CONTROL_CAMERA_FileTransfer], keyMap=%d, function=%d,type:%d\n",keyMap,function,pMsgStruct->msgBuf.ctrlFileTransfer.type);
|
||||||
if(function)
|
if(function)
|
||||||
{
|
{
|
||||||
if(pMsgStruct->msgBuf.ctrlFileTransfer.type == 0) //thumbnail
|
if(pMsgStruct->msgBuf.ctrlFileTransfer.type == 0) //thumbnail
|
||||||
|
@ -1853,14 +1855,14 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_DeleteFile: //O
|
case WIFI_CONTROL_CAMERA_DeleteFile: //O
|
||||||
printf("[WIFI_SET_FILE_DeleteFile],fileName:%s\n",pMsgStruct->msgBuf.ctrlDelFile.fileName);
|
MLOGI("[WIFI_SET_FILE_DeleteFile],fileName:%s\n",pMsgStruct->msgBuf.ctrlDelFile.fileName);
|
||||||
strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.ctrlDelFile.fileName);
|
strcpy((char *)fileName, (char *)pMsgStruct->msgBuf.ctrlDelFile.fileName);
|
||||||
if(strlen((char *)fileName) == 12) // only file name
|
if(strlen((char *)fileName) == 12) // only file name
|
||||||
{
|
{
|
||||||
appThumbNameToKey((thumbType_t *)&fileType, &dirKey, &fileKey, fileName);
|
appThumbNameToKey((thumbType_t *)&fileType, &dirKey, &fileKey, fileName);
|
||||||
appThumbKeyToName(THUMB_320x240, fileType, dirKey, fileKey, fileName);
|
appThumbKeyToName(THUMB_320x240, fileType, dirKey, fileKey, fileName);
|
||||||
ret = remove((char *)fileName);
|
ret = remove((char *)fileName);
|
||||||
printf("delete thumb name=%s ret=%d\n",fileName,ret);
|
MLOGI("delete thumb name=%s ret=%d\n",fileName,ret);
|
||||||
if(fileType == STILL_THUMB)
|
if(fileType == STILL_THUMB)
|
||||||
sprintf((char *)fileName,"./%3dMEDIA/%s%04d.JPG", dirKey, DCF_FILE_FREE_CHAR, fileKey);
|
sprintf((char *)fileName,"./%3dMEDIA/%s%04d.JPG", dirKey, DCF_FILE_FREE_CHAR, fileKey);
|
||||||
else
|
else
|
||||||
|
@ -1886,7 +1888,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_SHOOT:
|
case WIFI_CONTROL_CAMERA_SHOOT:
|
||||||
printf("[WIFI_SET_CAMERA_SHOOT] shoot:%d\n",pMsgStruct->msgBuf.ctrlShoot.shoot);
|
MLOGI("[WIFI_SET_CAMERA_SHOOT] shoot:%d\n",pMsgStruct->msgBuf.ctrlShoot.shoot);
|
||||||
|
|
||||||
if((TRUE == sf_is_preview()) && (pMsgStruct->msgBuf.ctrlShoot.shoot <= 3))
|
if((TRUE == sf_is_preview()) && (pMsgStruct->msgBuf.ctrlShoot.shoot <= 3))
|
||||||
{
|
{
|
||||||
|
@ -1963,7 +1965,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_Update: //
|
case WIFI_CONTROL_CAMERA_Update: //
|
||||||
uTemp = htonl(pMsgStruct->msgBuf.ctrlUpdate.updateType);
|
uTemp = htonl(pMsgStruct->msgBuf.ctrlUpdate.updateType);
|
||||||
printf("[WIFI_CTRL_UPGRADE],fSize:%d\n",fSize);
|
MLOGI("[WIFI_CTRL_UPGRADE],fSize:%d\n",fSize);
|
||||||
#if 1//forbuild
|
#if 1//forbuild
|
||||||
//sf_app_msg_data_snd(SY_MSG_UPGRADE_FW,(unsigned char*)NULL);
|
//sf_app_msg_data_snd(SY_MSG_UPGRADE_FW,(unsigned char*)NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1972,7 +1974,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen)
|
||||||
|
|
||||||
case WIFI_CONTROL_CAMERA_Debug: //O
|
case WIFI_CONTROL_CAMERA_Debug: //O
|
||||||
puiPara->DebugMode = pMsgStruct->msgBuf.setDebugMode.debugMode % 2;
|
puiPara->DebugMode = pMsgStruct->msgBuf.setDebugMode.debugMode % 2;
|
||||||
printf("[WIFI_CONTROL_CAMERA_Debug]DebugMode:%d\n", puiPara->DebugMode);
|
MLOGI("[WIFI_CONTROL_CAMERA_Debug]DebugMode:%d\n", puiPara->DebugMode);
|
||||||
if(puiPara->DebugMode)
|
if(puiPara->DebugMode)
|
||||||
{
|
{
|
||||||
//sf_led_flash_start(SF_LED_FAST_FLAH, Sf_LED_SD_G);
|
//sf_led_flash_start(SF_LED_FAST_FLAH, Sf_LED_SD_G);
|
||||||
|
@ -2091,7 +2093,7 @@ UINT8 sf_wifi_server_stop_shoot_respond(UINT8 errCode)
|
||||||
{
|
{
|
||||||
APP_SVR_PACKET_T msgParse;
|
APP_SVR_PACKET_T msgParse;
|
||||||
UINT32 tmp = 0;
|
UINT32 tmp = 0;
|
||||||
printf("sf_wifi_server_StopShootRespond errCode = %d gSendSocket=%d\n", errCode,gSendSocket);
|
MLOGI("sf_wifi_server_StopShootRespond errCode = %d gSendSocket=%d\n", errCode,gSendSocket);
|
||||||
|
|
||||||
if(gSendSocket > 0)
|
if(gSendSocket > 0)
|
||||||
{
|
{
|
||||||
|
@ -2148,7 +2150,7 @@ static void sf_delete_ip_from_list(void)
|
||||||
if(clientMacList[0] != '\0')
|
if(clientMacList[0] != '\0')
|
||||||
{
|
{
|
||||||
|
|
||||||
printf("Device %s delete from list.\n", clientMacList);
|
MLOGI("Device %s delete from list.\n", clientMacList);
|
||||||
memset(clientMacList, 0, 24);
|
memset(clientMacList, 0, 24);
|
||||||
connectNum--;
|
connectNum--;
|
||||||
return;
|
return;
|
||||||
|
@ -2196,28 +2198,28 @@ void *sf_server_accept_thread(void *pData)
|
||||||
|
|
||||||
//UINT8 tmpBuf[50];
|
//UINT8 tmpBuf[50];
|
||||||
|
|
||||||
printf("[sf_server_accept_thread] start...\n");
|
MLOGI(" start...\n");
|
||||||
|
|
||||||
gAppSvrSocket = socket(AF_INET, SOCK_STREAM, 0);
|
gAppSvrSocket = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if (gAppSvrSocket < 0)
|
if (gAppSvrSocket < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] socket,ret:%x\n", gAppSvrSocket);
|
MLOGE("[Error] socket,ret:%x\n", gAppSvrSocket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("[sf_server_accept_thread],Server Socket:%d\n", gAppSvrSocket);
|
MLOGI(" Server Socket:%d\n", gAppSvrSocket);
|
||||||
|
|
||||||
on = 1 ;
|
on = 1 ;
|
||||||
ret = setsockopt(gAppSvrSocket, IPPROTO_TCP, SO_KEEPALIVE, &on, sizeof(on));
|
ret = setsockopt(gAppSvrSocket, IPPROTO_TCP, SO_KEEPALIVE, &on, sizeof(on));
|
||||||
if ( ret < 0 )
|
if ( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] setsockopt,ret:%x\n", ret);
|
MLOGE("[Error]setsockopt,ret:%x\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = setsockopt( gAppSvrSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) );
|
ret = setsockopt( gAppSvrSocket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof( on ) );
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] SO_REUSEADDR,ret:%d \n", ret);
|
MLOGE("[Error] SO_REUSEADDR,ret:%d \n", ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2229,14 +2231,14 @@ void *sf_server_accept_thread(void *pData)
|
||||||
ret = bind(gAppSvrSocket, (struct sockaddr*)&addrSend, sizeof(addrSend));
|
ret = bind(gAppSvrSocket, (struct sockaddr*)&addrSend, sizeof(addrSend));
|
||||||
if( ret < 0 )
|
if( ret < 0 )
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] bind:%d \n", ret);
|
MLOGE("[Error] bind:%d \n", ret);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = listen(gAppSvrSocket, LISTEN_PARAM) ;
|
ret = listen(gAppSvrSocket, LISTEN_PARAM) ;
|
||||||
if(ret < 0)
|
if(ret < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread]listen:%d\n", ret);
|
MLOGE("[Error]listen:%d\n", ret);
|
||||||
close(gAppSvrSocket);
|
close(gAppSvrSocket);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -2258,13 +2260,13 @@ void *sf_server_accept_thread(void *pData)
|
||||||
new_fd = accept(gAppSvrSocket, (struct sockaddr *) &cliAddr, (socklen_t *)&clientLength);
|
new_fd = accept(gAppSvrSocket, (struct sockaddr *) &cliAddr, (socklen_t *)&clientLength);
|
||||||
if (new_fd < 0)
|
if (new_fd < 0)
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread]accept:%d\n",new_fd);
|
MLOGE("[Error]accept:%d\n",new_fd);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("\n\n[Port:8866]new client's socket:%d --------oliver\n", new_fd);
|
MLOGI("\n\n[Port:8866]new client's socket:%d --------oliver\n", new_fd);
|
||||||
printf("cmd client.IP:%s, Port:%d\n\n\n", inet_ntoa(cliAddr.sin_addr), htons(cliAddr.sin_port));
|
MLOGI("cmd client.IP:%s, Port:%d\n\n\n", inet_ntoa(cliAddr.sin_addr), htons(cliAddr.sin_port));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if(SF_SUCCESS != sf_add_ip_to_list(inet_ntoa(cliAddr.sin_addr)))
|
if(SF_SUCCESS != sf_add_ip_to_list(inet_ntoa(cliAddr.sin_addr)))
|
||||||
|
@ -2293,7 +2295,7 @@ void *sf_server_accept_thread(void *pData)
|
||||||
/* Error occured */
|
/* Error occured */
|
||||||
if (FD_ISSET(gAppSvrSocket, &errfds))
|
if (FD_ISSET(gAppSvrSocket, &errfds))
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] while accepting socket: %d.\n", errno/*getSocketError(gAppSvrSocket)*/);
|
MLOGE("[Error] while accepting socket: %d.\n", errno/*getSocketError(gAppSvrSocket)*/);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2311,7 +2313,7 @@ void *sf_server_accept_thread(void *pData)
|
||||||
{
|
{
|
||||||
// if (FD_ISSET(pClient->socket, &errfds))
|
// if (FD_ISSET(pClient->socket, &errfds))
|
||||||
{
|
{
|
||||||
printf("errno: %d,pClient->socket=%d.\n", errno,pClient->socket);
|
MLOGE("errno: %d,pClient->socket=%d.\n", errno,pClient->socket);
|
||||||
//memdump(pClient, sizeof(clientContext_t));
|
//memdump(pClient, sizeof(clientContext_t));
|
||||||
if(errno != 11)
|
if(errno != 11)
|
||||||
{
|
{
|
||||||
|
@ -2333,7 +2335,7 @@ void *sf_server_accept_thread(void *pData)
|
||||||
if(nlasterr_socket >= 10)
|
if(nlasterr_socket >= 10)
|
||||||
{
|
{
|
||||||
fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
||||||
printf("errno overmax; delete client,socket:%d\n",pClient->socket);
|
MLOGE("errno overmax; delete client,socket:%d\n",pClient->socket);
|
||||||
pClientContextHead = DeleteClientContext(pClientContextHead,pClient);
|
pClientContextHead = DeleteClientContext(pClientContextHead,pClient);
|
||||||
pClient = pClientContextHead;
|
pClient = pClientContextHead;
|
||||||
|
|
||||||
|
@ -2377,7 +2379,7 @@ void *sf_server_accept_thread(void *pData)
|
||||||
/* Check in Exception Set */
|
/* Check in Exception Set */
|
||||||
if (FD_ISSET(pClient->socket, &errfds))
|
if (FD_ISSET(pClient->socket, &errfds))
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread] the socket errno: %d.\n", errno/*getSocketError(pClient->socket)*/);
|
MLOGE("[Error] the socket errno: %d.\n", errno/*getSocketError(pClient->socket)*/);
|
||||||
fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
fdClears(pClient->socket,&rdfds,&wrfds,&errfds);
|
||||||
pClient = DeleteClientContext(pClientContextHead,pClient);
|
pClient = DeleteClientContext(pClientContextHead,pClient);
|
||||||
printf("fordebug: delete client program dead 1\n");
|
printf("fordebug: delete client program dead 1\n");
|
||||||
|
@ -2399,7 +2401,7 @@ void *sf_server_accept_thread(void *pData)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("[Error][sf_server_accept_thread]nbytes %d,close\n", nbytes );
|
MLOGE("[Error]nbytes %d,close\n", nbytes );
|
||||||
pClient = pClientContextHead ;
|
pClient = pClientContextHead ;
|
||||||
while (pClient != NULL)
|
while (pClient != NULL)
|
||||||
{
|
{
|
||||||
|
@ -2437,7 +2439,7 @@ void sf_server_init(SINT8 *pSvrIp, UINT16 nSvrPort)
|
||||||
gAppSvrPort = nSvrPort;
|
gAppSvrPort = nSvrPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("IP:%s Port:%d\n", gAppSvrIp, gAppSvrPort);
|
MLOGI("IP:%s Port:%d\n", gAppSvrIp, gAppSvrPort);
|
||||||
//forbuild sf_getb_ipmac(gbAppLocalIp,gbAppLocalMac,gAppLocalIp,gAppLocalMac);
|
//forbuild sf_getb_ipmac(gbAppLocalIp,gbAppLocalMac,gAppLocalIp,gAppLocalMac);
|
||||||
//printf("[appsvr_init_cmd]IP:%s, MAC:%s,SerialID:%s,%d.%d.%d.%d\n",gAppLocalIp ,gAppLocalMac,gAppSerialID,gbAppLocalIp[3],gbAppLocalIp[2],gbAppLocalIp[1],gbAppLocalIp[0] );
|
//printf("[appsvr_init_cmd]IP:%s, MAC:%s,SerialID:%s,%d.%d.%d.%d\n",gAppLocalIp ,gAppLocalMac,gAppSerialID,gbAppLocalIp[3],gbAppLocalIp[2],gbAppLocalIp[1],gbAppLocalIp[0] );
|
||||||
|
|
||||||
|
@ -2456,7 +2458,7 @@ void sf_get_wifi_ssid(char *ssid)
|
||||||
if(SSID_STR[0] != '\0')
|
if(SSID_STR[0] != '\0')
|
||||||
{
|
{
|
||||||
strcpy(ssid, SSID_STR);
|
strcpy(ssid, SSID_STR);
|
||||||
printf("SSID:%s\n", ssid);
|
MLOGI("SSID:%s\n", ssid);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2530,14 +2532,14 @@ int sf_getb_mac(char *ifName, UINT8 *pbMacAddr)
|
||||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||||
if(sock < 0)
|
if(sock < 0)
|
||||||
{
|
{
|
||||||
printf("error sock");
|
MLOGE("error sock");
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(ifreq.ifr_name, ifName);
|
strcpy(ifreq.ifr_name, ifName);
|
||||||
if(ioctl(sock,SIOCGIFHWADDR,&ifreq) < 0)
|
if(ioctl(sock,SIOCGIFHWADDR,&ifreq) < 0)
|
||||||
{
|
{
|
||||||
printf("error ioctl");
|
MLOGE("error ioctl");
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2546,7 +2548,7 @@ int sf_getb_mac(char *ifName, UINT8 *pbMacAddr)
|
||||||
pbMacAddr[i]=(unsigned char)ifreq.ifr_hwaddr.sa_data[i];
|
pbMacAddr[i]=(unsigned char)ifreq.ifr_hwaddr.sa_data[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", pbMacAddr[0],pbMacAddr[1],pbMacAddr[2],pbMacAddr[3],pbMacAddr[4],pbMacAddr[5]);
|
MLOGI("MAC: %02X-%02X-%02X-%02X-%02X-%02X\n", pbMacAddr[0],pbMacAddr[1],pbMacAddr[2],pbMacAddr[3],pbMacAddr[4],pbMacAddr[5]);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -2558,7 +2560,7 @@ void sf_wifi_hw_init(void)
|
||||||
char scmd[256]= {0};
|
char scmd[256]= {0};
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
char sSSID[128]= {0};
|
char sSSID[128]= {0};
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
MLOGI("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
unsigned char wifitype = sf_get_wifi_type();
|
unsigned char wifitype = sf_get_wifi_type();
|
||||||
//ret = system("modprobe cfg80211");
|
//ret = system("modprobe cfg80211");
|
||||||
|
|
||||||
|
@ -2586,17 +2588,17 @@ void sf_wifi_hw_init(void)
|
||||||
|
|
||||||
//char buf[256];
|
//char buf[256];
|
||||||
ret = system("cp /etc/wifiap_wpa2.conf /tmp/wifiap_wpa2.conf");
|
ret = system("cp /etc/wifiap_wpa2.conf /tmp/wifiap_wpa2.conf");
|
||||||
printf("[%s:%d] sSSID:%s WifiApPWD:%s\n", __FUNCTION__, __LINE__,sSSID,puiPara->WifiApPWD);
|
MLOGI("[%s:%d] sSSID:%s WifiApPWD:%s\n", __FUNCTION__, __LINE__,sSSID,puiPara->WifiApPWD);
|
||||||
|
|
||||||
|
|
||||||
sprintf(scmd,"/etc/app/hostap.sh wpawpa2 %s %s 6 %s",sSSID,puiPara->WifiApPWD,SF_WIFI_NETDEV_8189_NAME);
|
sprintf(scmd,"/etc/app/hostap.sh wpawpa2 %s %s 6 %s",sSSID,puiPara->WifiApPWD,SF_WIFI_NETDEV_8189_NAME);
|
||||||
ret = system(scmd);
|
ret = system(scmd);
|
||||||
|
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
//printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
//ret = system("hostapd -B -dd /tmp/wifiap_wpa2.conf");
|
//ret = system("hostapd -B -dd /tmp/wifiap_wpa2.conf");
|
||||||
//printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
//printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
ret = system("udhcpd /etc/udhcpdw.conf");
|
ret = system("udhcpd /etc/udhcpdw.conf");
|
||||||
printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
//printf("[%s:%d] s\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
else if(WIFI_TYPE_HI3881 == wifitype)
|
else if(WIFI_TYPE_HI3881 == wifitype)
|
||||||
{
|
{
|
||||||
|
@ -2628,10 +2630,10 @@ void sf_wifi_hw_init(void)
|
||||||
|
|
||||||
if(ret != 0)
|
if(ret != 0)
|
||||||
{
|
{
|
||||||
printf("wifi hw init failed!scmd:%s\n",scmd);
|
MLOGE("wifi hw init failed!scmd:%s\n",scmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
MLOGI("[%s:%d] e\n", __FUNCTION__, __LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void *sf_wifi_sevrer_init(void *pNull)
|
void *sf_wifi_sevrer_init(void *pNull)
|
||||||
|
@ -2642,10 +2644,10 @@ void *sf_wifi_sevrer_init(void *pNull)
|
||||||
//usleep(1000*1000);
|
//usleep(1000*1000);
|
||||||
|
|
||||||
sf_DataSvrInit();
|
sf_DataSvrInit();
|
||||||
printf("wifi server data channel start....\n");
|
MLOGI("wifi server data channel start....\n");
|
||||||
appSvrSendInit();
|
appSvrSendInit();
|
||||||
sf_server_init(NULL, 0);
|
sf_server_init(NULL, 0);
|
||||||
printf("wifi server start\n");
|
MLOGI("wifi server start\n");
|
||||||
sf_apinfo_thread_init();
|
sf_apinfo_thread_init();
|
||||||
//sf_sys_status_led_set(SF_LED_SYS_STATE_WIFI_CONNECTED);
|
//sf_sys_status_led_set(SF_LED_SYS_STATE_WIFI_CONNECTED);
|
||||||
sf_sys_status_led_set(SF_LED_SYS_STATE_WIFI_DISCONNECT);
|
sf_sys_status_led_set(SF_LED_SYS_STATE_WIFI_DISCONNECT);
|
||||||
|
|
BIN
code/hdal/vendor/output/libvendor_ai2_pub.a
vendored
BIN
code/hdal/vendor/output/libvendor_ai2_pub.a
vendored
Binary file not shown.
BIN
code/hdal/vendor/output/libvendor_ai2_pub2.a
vendored
BIN
code/hdal/vendor/output/libvendor_ai2_pub2.a
vendored
Binary file not shown.
|
@ -1542,6 +1542,33 @@ static SINT32 sf_cardv_proccess_cmd_wifi(SF_MESSAGE_BUF_S *pMessageBuf)
|
||||||
|
|
||||||
case SF_WIFI_CMD_RESTART:
|
case SF_WIFI_CMD_RESTART:
|
||||||
ImageApp_Common_RtspStart(0);
|
ImageApp_Common_RtspStart(0);
|
||||||
|
break;
|
||||||
|
case SF_WIFI_CMD_CAPTURE:
|
||||||
|
if(PWR_ON_SETUP != sf_cardv_convert_power_on_mode()){
|
||||||
|
if(TRUE != sf_is_preview()){
|
||||||
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
int iCurrMode = System_GetState(SYS_STATE_CURRMODE);
|
||||||
|
int iNextMode = PRIMARY_MODE_PHOTO;
|
||||||
|
if((puiPara->CamMode == SF_CAM_MODE_PHOTO) || (puiPara->CamMode == SF_CAM_MODE_PHOTO_VIDEO))
|
||||||
|
{
|
||||||
|
iNextMode = PRIMARY_MODE_PHOTO;
|
||||||
|
}
|
||||||
|
else if(puiPara->CamMode == SF_CAM_MODE_VIDEO)
|
||||||
|
{
|
||||||
|
iNextMode = PRIMARY_MODE_MOVIE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iNextMode = PRIMARY_MODE_PHOTO;
|
||||||
|
}
|
||||||
|
UI_SetData(FL_PreMode, iCurrMode);
|
||||||
|
UI_SetData(FL_NextMode, iNextMode);
|
||||||
|
Ux_PostEvent(NVTEVT_SYSTEM_MODE, 1, iNextMode);
|
||||||
|
vos_util_delay_ms(200);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FlowPhoto_DoCapture();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
BIN
configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S530/nvt-evb.dtb
Normal file
BIN
configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S530/nvt-evb.dtb
Normal file
Binary file not shown.
1181
configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S530/nvt-evb.tmp.dts
Normal file
1181
configs/Linux/cfg_565_HUNTING_EVB_LINUX_4G_S530/nvt-evb.tmp.dts
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -1688,7 +1688,7 @@ UINT8 sf_mcu_reg_set(MCUParam_t attrId, UINT8 val)
|
||||||
temp |= 0x40;
|
temp |= 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((puiPara->GprsMode) && (val == 1))
|
if((puiPara->GprsSwitch) && (val == 1))
|
||||||
{
|
{
|
||||||
temp |= 0x80;
|
temp |= 0x80;
|
||||||
}else
|
}else
|
||||||
|
@ -1729,7 +1729,7 @@ UINT8 sf_mcu_reg_set(MCUParam_t attrId, UINT8 val)
|
||||||
temp |= 0x40;
|
temp |= 0x40;
|
||||||
}
|
}
|
||||||
|
|
||||||
if((puiPara->GprsMode) && (simCardInsert))
|
if((puiPara->GprsSwitch) && (simCardInsert))
|
||||||
{
|
{
|
||||||
temp |= 0x80;
|
temp |= 0x80;
|
||||||
}else
|
}else
|
||||||
|
@ -2123,11 +2123,11 @@ 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};
|
||||||
//UINT32 fd = 0;
|
int fd = 0;
|
||||||
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_ui_para_get();
|
||||||
|
|
||||||
#if SF_IQ_TEST != ENABLE
|
#if SF_IQ_TEST != ENABLE
|
||||||
FileSys_SetAttrib(PHOTO_THUMB_PATH, FST_ATTRIB_HIDDEN | FST_ATTRIB_SYSTEM, TRUE);
|
FileSys_SetAttrib(PHOTO_THUMB_PATH, FST_ATTRIB_HIDDEN/* | FST_ATTRIB_SYSTEM*/, TRUE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(strlen(sendfname) != SF_SEND_LIST_ITEM_LENGTH-3) //3 ->CamMode \r\n
|
if(strlen(sendfname) != SF_SEND_LIST_ITEM_LENGTH-3) //3 ->CamMode \r\n
|
||||||
|
@ -2142,9 +2142,13 @@ void sf_add_file_name_to_send_list(char *sendfname)
|
||||||
}else {
|
}else {
|
||||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);
|
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);
|
||||||
}
|
}
|
||||||
|
if(access(sendListName, F_OK) == 0)
|
||||||
|
{
|
||||||
int fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR);
|
fd = open(sendListName, O_APPEND | O_WRONLY);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
||||||
|
}
|
||||||
|
|
||||||
if(fd)
|
if(fd)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user