调整重拍机制

失败后等待数秒再重拍
serial
BlueMatthew 1 year ago
parent bf078645f4
commit 5c2cb42aad

@ -596,12 +596,12 @@ void CPhoneDevice::handleTimerImpl(CPhoneDevice::TIMER_CONTEXT* context)
{ {
if (m_listener != NULL) if (m_listener != NULL)
{ {
m_listener->OnTimeout(context->uid, context->timerType, context->times); m_listener->OnTimeout(context->uid, context->timerType, context->data, context->times);
} }
} }
} }
IDevice::timer_uid_t CPhoneDevice::RegisterTimer(unsigned int timerType, unsigned int timeout, unsigned long times/* = 0*/) IDevice::timer_uid_t CPhoneDevice::RegisterTimer(unsigned int timerType, unsigned int timeout, void* data, unsigned long times/* = 0*/)
{ {
struct sigevent evp = { 0 }; struct sigevent evp = { 0 };
struct itimerspec ts = { 0 }; struct itimerspec ts = { 0 };
@ -610,6 +610,7 @@ IDevice::timer_uid_t CPhoneDevice::RegisterTimer(unsigned int timerType, unsigne
TIMER_CONTEXT* context = new TIMER_CONTEXT(); TIMER_CONTEXT* context = new TIMER_CONTEXT();
context->device = this; context->device = this;
context->data = data;
context->timerType = timerType; context->timerType = timerType;
context->expectedTimes = times; context->expectedTimes = times;

@ -168,6 +168,7 @@ public:
CPhoneDevice* device; CPhoneDevice* device;
unsigned int timerType; unsigned int timerType;
unsigned long times; unsigned long times;
void* data;
unsigned long expectedTimes; unsigned long expectedTimes;
unsigned long uid; unsigned long uid;
}; };
@ -187,7 +188,7 @@ public:
virtual timer_uid_t RegisterHeartbeat(unsigned int timerType, unsigned int timeout); virtual timer_uid_t RegisterHeartbeat(unsigned int timerType, unsigned int timeout);
virtual bool TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path); virtual bool TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<OSD_INFO>& osds, const std::string& path);
virtual bool CloseCamera(); virtual bool CloseCamera();
virtual timer_uid_t RegisterTimer(unsigned int timerType, unsigned int timeout, unsigned long times = 0); virtual timer_uid_t RegisterTimer(unsigned int timerType, unsigned int timeout, void* data, unsigned long times = 0);
virtual bool UnregisterTimer(timer_uid_t uid); virtual bool UnregisterTimer(timer_uid_t uid);
virtual unsigned long RequestWakelock(unsigned long timeout); virtual unsigned long RequestWakelock(unsigned long timeout);
virtual bool ReleaseWakelock(unsigned long wakelock); virtual bool ReleaseWakelock(unsigned long wakelock);

@ -225,7 +225,7 @@ bool CPhoneDevice2::FireTimer(timer_uid_t uid)
return false; return false;
} }
m_listener->OnTimeout(uid, timerType, times); m_listener->OnTimeout(uid, timerType, NULL, times);
return true; return true;
} }

@ -483,6 +483,8 @@ public class MainActivity extends AppCompatActivity {
String cameraInfo = CameraUtils.getAllCameraInfo(view.getContext()); String cameraInfo = CameraUtils.getAllCameraInfo(view.getContext());
Log.d(TAG, cameraInfo);
SysApi.setCam3V3Enable(false); SysApi.setCam3V3Enable(false);
SysApi.setOtgState(false); SysApi.setOtgState(false);

Loading…
Cancel
Save