|
|
@ -479,7 +479,7 @@ int32_t CPhoneDevice::CJpegCamera::getOutputFormat() const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPath, unsigned int netId, unsigned int versionCode, const std::string& nativeLibDir)
|
|
|
|
CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPath, unsigned int netId, unsigned int versionCode, const std::string& nativeLibDir)
|
|
|
|
: mVersionCode(versionCode), m_nativeLibraryDir(nativeLibDir), m_network(NULL), m_netHandle(NETWORK_UNSPECIFIED)
|
|
|
|
: mVersionCode(versionCode), m_nativeLibraryDir(nativeLibDir), m_network(NULL), m_ethnetHandle(NETWORK_UNSPECIFIED)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mCamera = NULL;
|
|
|
|
mCamera = NULL;
|
|
|
|
m_listener = NULL;
|
|
|
|
m_listener = NULL;
|
|
|
@ -1125,7 +1125,7 @@ bool CPhoneDevice::InstallAPP(const std::string& path, unsigned int delayedTime)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reason)
|
|
|
|
bool CPhoneDevice::Reboot(int resetType, bool manually, const std::string& reason, uint32_t timeout/* = 1000*/)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (resetType == REBOOT_TYPE_DEVICE)
|
|
|
|
if (resetType == REBOOT_TYPE_DEVICE)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1500,7 +1500,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
SetStaticIp();
|
|
|
|
SetStaticIp();
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(256));
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(256));
|
|
|
|
|
|
|
|
|
|
|
|
net_handle_t netHandle = GetNetHandle();
|
|
|
|
net_handle_t netHandle = GetEthnetHandle();
|
|
|
|
|
|
|
|
|
|
|
|
if (netHandle == 0)
|
|
|
|
if (netHandle == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1508,7 +1508,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
for (int idx = 0; idx < 84; idx++)
|
|
|
|
for (int idx = 0; idx < 84; idx++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(128));
|
|
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(128));
|
|
|
|
netHandle = GetNetHandle();
|
|
|
|
netHandle = GetEthnetHandle();
|
|
|
|
|
|
|
|
|
|
|
|
if (netHandle != 0)
|
|
|
|
if (netHandle != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1584,7 +1584,7 @@ bool CPhoneDevice::TakePhotoWithNetCamera(IDevice::PHOTO_INFO& localPhotoInfo, c
|
|
|
|
bool netCaptureResult = false;
|
|
|
|
bool netCaptureResult = false;
|
|
|
|
for (int idx = 0; idx < 3; idx++)
|
|
|
|
for (int idx = 0; idx < 3; idx++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
netHandle = GetNetHandle();
|
|
|
|
netHandle = GetEthnetHandle();
|
|
|
|
netPhotoInfo.netHandle = netHandle;
|
|
|
|
netPhotoInfo.netHandle = netHandle;
|
|
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "NetCapture %d NetHandle=%lld PHOTOID=%u", idx, netHandle, localPhotoInfo.photoId);
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO, "NetCapture %d NetHandle=%lld PHOTOID=%u", idx, netHandle, localPhotoInfo.photoId);
|
|
|
@ -1923,7 +1923,7 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
|
|
|
|
{
|
|
|
|
{
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"Recv CameraCtrl Command, action= MOVE_PRESETNO, preset = %u", localPhotoInfo.preset);
|
|
|
|
XYLOG(XYLOG_SEVERITY_INFO,"Recv CameraCtrl Command, action= MOVE_PRESETNO, preset = %u", localPhotoInfo.preset);
|
|
|
|
CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset, param.serfile, param.baud, param.addr);
|
|
|
|
CameraPhotoCmd(time(NULL), localPhotoInfo.channel, MOVE_PRESETNO, 0, localPhotoInfo.preset, param.serfile, param.baud, param.addr);
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(5));
|
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(10));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pThis->TakePhotoWithNetCamera(localPhotoInfo, path, osds, powerCtrlPtr);
|
|
|
|
pThis->TakePhotoWithNetCamera(localPhotoInfo, path, osds, powerCtrlPtr);
|
|
|
@ -3748,17 +3748,17 @@ void CPhoneDevice::UpdateSimcard(const std::string& simcard)
|
|
|
|
void CPhoneDevice::UpdateEthernet(net_handle_t nethandle, bool available)
|
|
|
|
void CPhoneDevice::UpdateEthernet(net_handle_t nethandle, bool available)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_devLocker.lock();
|
|
|
|
m_devLocker.lock();
|
|
|
|
m_netHandle = available ? nethandle : NETWORK_UNSPECIFIED;
|
|
|
|
m_ethnetHandle = available ? nethandle : NETWORK_UNSPECIFIED;
|
|
|
|
m_devLocker.unlock();
|
|
|
|
m_devLocker.unlock();
|
|
|
|
|
|
|
|
|
|
|
|
XYLOG(XYLOG_SEVERITY_WARNING, "NET Handle: %lld", available ? (uint64_t)nethandle : 0);
|
|
|
|
XYLOG(XYLOG_SEVERITY_WARNING, "NET Handle: %lld", available ? (uint64_t)nethandle : 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
net_handle_t CPhoneDevice::GetNetHandle() const
|
|
|
|
net_handle_t CPhoneDevice::GetEthnetHandle() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
net_handle_t nethandle = NETWORK_UNSPECIFIED;
|
|
|
|
net_handle_t nethandle = NETWORK_UNSPECIFIED;
|
|
|
|
m_devLocker.lock();
|
|
|
|
m_devLocker.lock();
|
|
|
|
nethandle = m_netHandle;
|
|
|
|
nethandle = m_ethnetHandle;
|
|
|
|
m_devLocker.unlock();
|
|
|
|
m_devLocker.unlock();
|
|
|
|
return nethandle;
|
|
|
|
return nethandle;
|
|
|
|
|
|
|
|
|
|
|
|