diff --git a/app/src/main/cpp/SensorsProtocol.cpp b/app/src/main/cpp/SensorsProtocol.cpp index e7c8e46c..a7ed0966 100644 --- a/app/src/main/cpp/SensorsProtocol.cpp +++ b/app/src/main/cpp/SensorsProtocol.cpp @@ -1925,8 +1925,6 @@ void CameraPhotoPortDataProcess(SIO_PARAM_SERIAL_DEF *curserial) curserial->image.state = PHOTO_SAVE_SUCC; } recvend = 1; - memset(&serialport[0].image, 0, sizeof(PHOTO_DEF)); - memmove((void *)&serialport[0].image, (void*)&curserial->image, sizeof(PHOTO_DEF)); } } else @@ -3594,9 +3592,11 @@ int GM_IsCloseCamera(SIO_PARAM_SERIAL_DEF *pPortParam) if ((SER_STARTSAMPLE == pPortParam->image.state) || (SER_SAMPLE == pPortParam->image.state)) pPortParam->image.state = SER_SAMPLEFAIL; else if (PHOTO_SAVE_SUCC == pPortParam->image.state) - pPortParam->image.state = SAMPLINGSUCCESS; + pPortParam->image.state = PHOTO_SAVE_SUCC; strcpy(buf, "通道1摄像机使用完毕!可以关闭摄像机电源!"); DebugLog(0, buf, 'I'); + memset(&serialport[0].image, 0, sizeof(PHOTO_DEF)); + memmove((void *)&serialport[0].image, (void*)&pPortParam->image, sizeof(PHOTO_DEF)); if(pPortParam->fd >= 0) { close(pPortParam->fd); @@ -3989,7 +3989,7 @@ int GetImage(int devno, IMAGE_DEF *photo) sprintf(logbuf, "装置%d, image_state=%d, 预置点:%d,拍照时间:%d, pic_name:%s", devno + 1, photo->state, photo->presetno, photo->phototime, photo->photoname); DebugLog(8, logbuf, 'I'); - if ((SER_SAMPLEFAIL == photo->state) || (SAMPLINGSUCCESS == photo->state)) + if ((SER_SAMPLEFAIL == photo->state) || (PHOTO_SAVE_SUCC == photo->state)) { serialport[0].image.state = SER_IDLE; return 2;