From bd706d1cf480120419f0915ea8dd336203781997 Mon Sep 17 00:00:00 2001 From: "XI.CHEN" <2311041011@qq.com> Date: Thu, 5 Dec 2024 10:21:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8F=8D=E5=A4=8D=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E4=BC=A0=E6=84=9F=E5=99=A8=E6=B3=A2=E7=89=B9=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/PhoneDevice.cpp | 2 +- app/src/main/cpp/SensorsProtocol.cpp | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/cpp/PhoneDevice.cpp b/app/src/main/cpp/PhoneDevice.cpp index 20e2af11..cb5e7013 100644 --- a/app/src/main/cpp/PhoneDevice.cpp +++ b/app/src/main/cpp/PhoneDevice.cpp @@ -1706,7 +1706,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector< OpenPTZSensors(photoInfo.selfTestingTime); } CameraPhotoCmd(ts, photoInfo.channel, 0, photoInfo.resolution, 0); - XYLOG(XYLOG_SEVERITY_INFO, "Takeing photo over"); + XYLOG(XYLOG_SEVERITY_INFO, "Taking photo over"); res = TakePTZPhotoCb(3, photoInfo); } else if (mPhotoInfo.usingSysCamera == 1) diff --git a/app/src/main/cpp/SensorsProtocol.cpp b/app/src/main/cpp/SensorsProtocol.cpp index 70147713..9df8091e 100644 --- a/app/src/main/cpp/SensorsProtocol.cpp +++ b/app/src/main/cpp/SensorsProtocol.cpp @@ -695,6 +695,7 @@ void Gm_OpenSerialPort(int devidx) sprintf(szbuf, "装置%d 打开串口%d %s成功!fd=%d", devidx + 1, devparam[devidx].commid + 1, devparam[devidx].pathname, fd); DebugLog(devparam[devidx].commid, szbuf, 'I'); serialport[devparam[devidx].commid].fd = fd; + Gm_SetSerialPortParam(devparam[devidx].commid); return; } sprintf(szbuf, "装置%d 串口%d %s已经打开!fd=%d", devidx + 1, devparam[devidx].commid + 1, devparam[devidx].pathname, serialport[devparam[devidx].commid].fd); @@ -2220,9 +2221,9 @@ void SendCmdFormPollCmdBuf(int port) serialport[devparam[srdt.curdevidx[port]].commid].m_iRevStatus = 0; if (serialport[port].fd < 0) return; - ret = Gm_SetSerialPortParam(port); - if (ret < 0) - return; + //ret = Gm_SetSerialPortParam(port); + //if (ret < 0) + // return; len = GM_SerialComSend(&pPortParam->PollCmd[2], pPortParam->cmdlen - 2, port); if (len < 1) { @@ -2751,7 +2752,7 @@ void Gm_SendPelco_pCommand(uint32_t cmdtype) commandbuf[len] = (uint8_t)Gm_Pelco_pXORCheck(commandbuf, len); len++; serialport[srdt.camerauseserial].cmdlen = len; - Gm_SetSerialPortParam(srdt.camerauseserial); + //Gm_SetSerialPortParam(srdt.camerauseserial); //unsigned char sendbuf[] = {0x68,0x00,0x00,0x68,0x0ff,0x02,0x01,0x16}; //len = GM_SerialComSend(sendbuf, sizeof(sendbuf), srdt.camerauseserial); @@ -2803,7 +2804,7 @@ void Gm_SendPelco_DCommand(uint32_t cmdtype) #endif len++; serialport[srdt.camerauseserial].cmdlen = len; - Gm_SetSerialPortParam(srdt.camerauseserial); + //Gm_SetSerialPortParam(srdt.camerauseserial); len = GM_SerialComSend(commandbuf, len, srdt.camerauseserial); if (len < 1) {