|
|
@ -1991,12 +1991,12 @@ int FindNextCameraPhotoCommand(SIO_PARAM_SERIAL_DEF *pPortParam)
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//pPortParam->SerialCmdidx = -1;
|
|
|
|
MakePtzStateQueryCommand(pPortParam, cmdidx);
|
|
|
|
break;
|
|
|
|
return 1;
|
|
|
|
case QUERY_PTZ_STATE: /* 查询云台状态信息*/
|
|
|
|
case QUERY_PTZ_STATE: /* 查询云台状态信息*/
|
|
|
|
::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
//::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
sprintf(szbuf, "下发命令sendptzstatecmd=%d!", pPortParam->sendptzstatecmd);
|
|
|
|
//sprintf(szbuf, "下发命令sendptzstatecmd=%d!", pPortParam->sendptzstatecmd);
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
//DebugLog(0, szbuf, 'I');
|
|
|
|
//if (pPortParam->sendptzstatecmd > 0)
|
|
|
|
//if (pPortParam->sendptzstatecmd > 0)
|
|
|
|
#if 1
|
|
|
|
#if 1
|
|
|
|
if (pPortParam->sendptzstatecmd == 0)
|
|
|
|
if (pPortParam->sendptzstatecmd == 0)
|
|
|
@ -2016,10 +2016,10 @@ int FindNextCameraPhotoCommand(SIO_PARAM_SERIAL_DEF *pPortParam)
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
return -1;
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pPortParam->sendptzstatecmd++;
|
|
|
|
//pPortParam->sendptzstatecmd++;
|
|
|
|
cmdidx = 0x08;
|
|
|
|
//cmdidx = 0x08;
|
|
|
|
//pPortParam->SerialCmdidx = -1;
|
|
|
|
MakePtzStateQueryCommand(pPortParam, cmdidx);
|
|
|
|
break;
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
imagesize = 0xFF;
|
|
|
|
imagesize = 0xFF;
|
|
|
@ -2041,9 +2041,9 @@ int FindNextCameraPhotoCommand(SIO_PARAM_SERIAL_DEF *pPortParam)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
//::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
strcpy(szbuf, "make:sendptzstatecmd");
|
|
|
|
//strcpy(szbuf, "make:sendptzstatecmd");
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
//DebugLog(0, szbuf, 'I');
|
|
|
|
|
|
|
|
|
|
|
|
MakeCameraPhotoCommand(pPortParam, cmdidx, imagesize, packetsize, imagequality, srdt.sendphototime);
|
|
|
|
MakeCameraPhotoCommand(pPortParam, cmdidx, imagesize, packetsize, imagequality, srdt.sendphototime);
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -2114,6 +2114,8 @@ void MakeCameraPhotoCommand(SIO_PARAM_SERIAL_DEF *pPortParam, uint8_t cmdidx, in
|
|
|
|
sendbuf[i++] = LOBYTE(LOWORD(OneParam));
|
|
|
|
sendbuf[i++] = LOBYTE(LOWORD(OneParam));
|
|
|
|
sendbuf[i++] = (uint8_t)TwoParam; /* 是否需要保存*/
|
|
|
|
sendbuf[i++] = (uint8_t)TwoParam; /* 是否需要保存*/
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
sendbuf[i] = CalLpc((u_char *)&sendbuf[6], i - 6);
|
|
|
|
sendbuf[i] = CalLpc((u_char *)&sendbuf[6], i - 6);
|
|
|
|
i += 1;
|
|
|
|
i += 1;
|
|
|
@ -2135,6 +2137,49 @@ void MakeCameraPhotoCommand(SIO_PARAM_SERIAL_DEF *pPortParam, uint8_t cmdidx, in
|
|
|
|
//return;
|
|
|
|
//return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*********************************************************************************
|
|
|
|
|
|
|
|
生成 QueryPtzState命令
|
|
|
|
|
|
|
|
**********************************************************************************/
|
|
|
|
|
|
|
|
void MakePtzStateQueryCommand(SIO_PARAM_SERIAL_DEF *pPortParam, uint8_t cmdidx)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i, icurtime;
|
|
|
|
|
|
|
|
u_char *sendbuf;
|
|
|
|
|
|
|
|
//char szbuf[128];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sendbuf = pPortParam->PollCmd;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
|
|
|
|
//strcpy(szbuf, "make:sendptzstatecmd start!");
|
|
|
|
|
|
|
|
//DebugLog(0, szbuf, 'I');
|
|
|
|
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
sendbuf[i++] = 0x00; /* 强制等待时间*/
|
|
|
|
|
|
|
|
sendbuf[i++] = 0x00; /* 强制等待时间*/
|
|
|
|
|
|
|
|
sendbuf[i++] = 0x68; /* 起始字符*/
|
|
|
|
|
|
|
|
sendbuf[i++] = (uint8_t)0x00; /* length */
|
|
|
|
|
|
|
|
sendbuf[i++] = (uint8_t)0x00; /* length */
|
|
|
|
|
|
|
|
sendbuf[i++] = 0x68; /* 起始字符*/
|
|
|
|
|
|
|
|
sendbuf[i++] = (uint8_t)pPortParam->cameraaddr;/* 传感器地址*/
|
|
|
|
|
|
|
|
sendbuf[i++] = cmdidx; /* 命令字*/
|
|
|
|
|
|
|
|
sendbuf[i] = CalLpc((u_char *)&sendbuf[6], i - 6);
|
|
|
|
|
|
|
|
i += 1;
|
|
|
|
|
|
|
|
sendbuf[i++] = 0x16; /* 信息尾*/
|
|
|
|
|
|
|
|
sendbuf[3] = (uint8_t)((i - 10) >> 8);
|
|
|
|
|
|
|
|
sendbuf[4] = (uint8_t)(i - 10);
|
|
|
|
|
|
|
|
pPortParam->cmdlen = i;
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
//::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
|
|
|
|
//strcpy(szbuf, "make over!");
|
|
|
|
|
|
|
|
//DebugLog(0, szbuf, 'I');
|
|
|
|
|
|
|
|
if(0x08 == cmdidx)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
::memset(szbuf, 0, sizeof(szbuf));
|
|
|
|
|
|
|
|
strcpy(szbuf, "生成查询云台位置命令!");
|
|
|
|
|
|
|
|
DebugLog(0, szbuf, 'I');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 准备发送云台指令
|
|
|
|
// 准备发送云台指令
|
|
|
|
int Gm_CtrlPtzCmd(SIO_PARAM_SERIAL_DEF *pPortParam, uint32_t ptzcmd)
|
|
|
|
int Gm_CtrlPtzCmd(SIO_PARAM_SERIAL_DEF *pPortParam, uint32_t ptzcmd)
|
|
|
|
{
|
|
|
|
{
|
|
|
|