1.根据新的短信协议调整代码

This commit is contained in:
payton 2024-01-11 13:56:55 +08:00
parent dcbb89539a
commit 39310f9d80

View File

@ -229,7 +229,7 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
} }
else if(strValue[i][0] - '0' == 2) else if(strValue[i][0] - '0' == 2)
{ {
pPara_sms_saved->ImgSize = PHOTO_SIZE_12M; //pPara_sms_saved->ImgSize = PHOTO_SIZE_12M;
} }
else if(strValue[i][0] - '0' == 3) else if(strValue[i][0] - '0' == 3)
{ {
@ -592,7 +592,7 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
//ftp forbidden set //ftp forbidden set
i++; i++;
if(SF_STRNCMP(strValue[i], "ON", 2)== 0) /*if(SF_STRNCMP(strValue[i], "ON", 2)== 0)
{ {
pPara_sms_saved->FtpSwitch = 2; pPara_sms_saved->FtpSwitch = 2;
} }
@ -604,7 +604,7 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
{ {
printf("Error Format line:%d i=%d\n", __LINE__, i); printf("Error Format line:%d i=%d\n", __LINE__, i);
Readmmsok = SMS_STATUS_FORMAT_ERR; Readmmsok = SMS_STATUS_FORMAT_ERR;
} }*/
//sms ctrl //sms ctrl
i++; i++;
@ -841,7 +841,7 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
{ {
if((strValue[i][0] - '0') == 0 ) if((strValue[i][0] - '0') == 0 )
{ {
pPara_sms_saved->GpsNumber = GPS_NUMBER_OFF; //pPara_sms_saved->GpsNumber = GPS_NUMBER_OFF;
} }
else if((strValue[i][0] - '0') == 1) else if((strValue[i][0] - '0') == 1)
{ {
@ -1114,16 +1114,21 @@ UINT8 sf_message_data_processing(UINT8 strValue[30][32], UINT16 mm, UINT8 *sms_s
{ {
if(SF_STRLEN(strValue[i]) == 5) if(SF_STRLEN(strValue[i]) == 5)
{ {
if((strValue[i][4] - '0') == 1) if((strValue[i][4] - '0') == 1)
{ {
CameraCmd.formatSD = 1; CameraCmd.formatSD = 1;
Readmmsok = SMS_STATUS_RECIEV; Readmmsok = SMS_STATUS_RECIEV;
} }
else else if((strValue[i][4] - '0') == 2)
{ {
printf("Error Parameter line:%d i=%d\n", __LINE__, i); CameraCmd.formatSD = 2;
Readmmsok = SMS_STATUS_PARA_ERR; Readmmsok = SMS_STATUS_RECIEV;
} }
else
{
printf("Error Parameter line:%d i=%d\n", __LINE__, i);
Readmmsok = SMS_STATUS_PARA_ERR;
}
} }
else else
{ {
@ -1979,8 +1984,8 @@ void sf_hd_pic_add_to_list(UINT8 *fileName)
char fname[50] = {0}; char fname[50] = {0};
printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName); printf("[%s:%d] add to list:%s\n", __FUNCTION__, __LINE__, fileName);
SF_STRNCPY(tempStr, fileName+1, 3); SF_STRNCPY(tempStr, fileName+2, 2);
dirKey = atoi((const char *)tempStr); dirKey = atoi((const char *)tempStr) + 100;
fileKey = atoi((const char *)fileName+4); fileKey = atoi((const char *)fileName+4);
if(strstr((char*)fileName, "E")) if(strstr((char*)fileName, "E"))
{ {
@ -2128,8 +2133,8 @@ void sf_video_add_to_list(UINT8 *fileName)
printf("add to list:%s\n", fileName); printf("add to list:%s\n", fileName);
SF_STRNCPY(tempStr, fileName+1, 3); SF_STRNCPY(tempStr, fileName+2, 2);
dirKey = atoi((const char *)tempStr); dirKey = atoi((const char *)tempStr) + 100;
fileKey = atoi((const char *)fileName+4); fileKey = atoi((const char *)fileName+4);
fileIndex = dirKey * 10000 + fileKey + 1; fileIndex = dirKey * 10000 + fileKey + 1;
@ -2478,15 +2483,23 @@ SINT32 sf_power_off_check_format_sd(void)
{ {
SF_MESSAGE_BUF_S stMessageBuf = {0}; SF_MESSAGE_BUF_S stMessageBuf = {0};
if(CameraCmd.formatSD) if(CameraCmd.formatSD == 1)
{ {
if((sf_in_card_exist()) && (sf_is_card())) if((sf_in_card_exist()) && (sf_is_card()))
{ {
stMessageBuf.arg2 = CameraCmd.formatSD;
stMessageBuf.arg1 = CMD_SD_FORMAT; stMessageBuf.arg1 = CMD_SD_FORMAT;
stMessageBuf.cmdId = CMD_SD; stMessageBuf.cmdId = CMD_SD;
sf_com_message_send_to_cardv(&stMessageBuf); sf_com_message_send_to_cardv(&stMessageBuf);
} }
} }
else if(CameraCmd.formatSD == 2)
{
stMessageBuf.arg2 = CameraCmd.formatSD;
stMessageBuf.arg1 = CMD_SD_FORMAT;
stMessageBuf.cmdId = CMD_SD;
sf_com_message_send_to_cardv(&stMessageBuf);
}
return 0; return 0;
} }