void sendtoHuawei(uint8_t *cameraIp,uint16_t cameraSrcPort,uint16_t cameraDstPort,uint8_t *userName,uint8_t *pwd,uint8_t lineNum,int camNo)//华为
{
int flag = 1;
int sock = -1,connected;
uint8_t ret;
int recv_data_len;
memset(str1, 0, sizeof(str1));
memset(str2, 0, sizeof(str2));
memset(str3, 0, sizeof(str3));
memset(recvbuf, 0, sizeof(recvbuf));
/*
memset(disp1, 0, 4096);
memset(disp2, 0, 4096);
memset(disp3, 0, 4096);
memset(disp4, 0, 4096);
*/
char ip[15]="\0";
memset(ip,0,sizeof(ip));
sprintf(ip,"%d.%d.%d.%d",cameraIp[0],cameraIp[1],cameraIp[2],cameraIp[3]);
printf("sendtoHuawei g_NetDataBag.cameraDstPort = %s,g_NetDataBag.cameraDstPort=%d\r\n",ip,cameraDstPort);
ret=socket(SOCK_TCPS,Sn_MR_TCP,0, Sn_MR_ND);
if(ret != SOCK_TCPS){
printf("%d:Socket Error\r\n",SOCK_TCPS);
goto exit;
}else{
//printf("%d:Opened\r\n",SOCK_TCPS);
}
ret=connect(SOCK_TCPS,cameraIp,cameraDstPort);
if(ret != SOCK_OK){
printf("%d:Socket Connect Error\r\n",SOCK_TCPS);
// while(1);
goto exit;
}
int len = strlen(str2);
sprintf(str3, "%d", 4);
memset(str1, 0, sizeof(str1));
strcat(str1, "PUT /SDCAPI/V1.0/OsdIaas/Channels/Osd?ChannelId=101&TemplateId=0 HTTP/1.1\r\n");
strcat(str1, "Accept: */*\r\n");
strcat(str1, "Host: ");
strcat(str1, ip);
strcat(str1, "\r\n");
//strcat(str1, "connection:close\r\n");
//strcat(str1, "\r\n");
strcat(str1, "Content-Type: text/xml\r\n");
strcat(str1, "\r\n");
printf("[sendcam]len=%d,%s\r\n",strlen(str1),str1);
send(SOCK_TCPS,(uint8_t *)str1,strlen(str1));
vTaskDelay(300);
//接收数据
if(getSn_IR(SOCK_TCPS) & Sn_IR_CON)
{
setSn_IR(SOCK_TCPS, Sn_IR_CON); // Sn_IR的CON位置1,通知W5500连接已建立
}
// 数据回环测试程序:数据从上位机服务器发给W5500,W5500接收到数据后再回给服务器
len=getSn_RX_RSR(SOCK_TCPS); // len=Socket0接收缓存中已接收和保存的数据大小
recv_data_len &#