liuguijing 4 months ago
commit 011bd762ab

@ -5,7 +5,7 @@ plugins {
// 10,00,000 major-minor-build // 10,00,000 major-minor-build
def AppMajorVersion = 1 def AppMajorVersion = 1
def AppMinorVersion = 3 def AppMinorVersion = 3
def AppBuildNumber = 9 def AppBuildNumber = 15
def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber
def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber

@ -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;

@ -219,7 +219,7 @@ public:
virtual bool UpdateSchedules(); virtual bool UpdateSchedules();
virtual bool QuerySystemProperties(map<string, string>& properties); virtual bool QuerySystemProperties(map<string, string>& properties);
virtual bool InstallAPP(const std::string& path, unsigned int delayedTime); virtual bool InstallAPP(const std::string& path, unsigned int delayedTime);
virtual bool Reboot(int resetType, bool manually, const std::string& reason); virtual bool Reboot(int resetType, bool manually, const std::string& reason, uint32_t timeout = 1000);
virtual bool EnableGPS(bool enabled); virtual bool EnableGPS(bool enabled);
virtual float QueryBattaryVoltage(int timesForAvg, bool* isCharging); virtual float QueryBattaryVoltage(int timesForAvg, bool* isCharging);
virtual bool RequestPosition(); virtual bool RequestPosition();
@ -262,7 +262,7 @@ public:
void UpdateSimcard(const std::string& simcard); void UpdateSimcard(const std::string& simcard);
void UpdateEthernet(net_handle_t nethandle, bool available); void UpdateEthernet(net_handle_t nethandle, bool available);
net_handle_t GetNetHandle() const; net_handle_t GetEthnetHandle() const;
protected: protected:
@ -354,7 +354,7 @@ protected:
std::string m_nativeLibraryDir; std::string m_nativeLibraryDir;
NETWORK* m_network; NETWORK* m_network;
net_handle_t m_netHandle; net_handle_t m_ethnetHandle;
jmethodID mRegisterHeartbeatMid; jmethodID mRegisterHeartbeatMid;
jmethodID mUpdateCaptureScheduleMid; jmethodID mUpdateCaptureScheduleMid;

@ -1880,9 +1880,11 @@ void NdkCamera::CopyPreviewRequest(ACaptureRequest* request, const ACameraMetada
void NdkCamera::onCaptureFailed(ACameraCaptureSession* session, ACaptureRequest* request, ACameraCaptureFailure* failure) void NdkCamera::onCaptureFailed(ACameraCaptureSession* session, ACaptureRequest* request, ACameraCaptureFailure* failure)
{ {
XYLOG(XYLOG_SEVERITY_WARNING, "onCaptureFailed session=%p request=%p reason=%d PhotoTaken=%d", session, request, failure->reason, m_photoTaken ? 1 : 0); bool isPreview = (request == mCaptureRequests[PREVIEW_REQUEST_IDX]->request);
if (failure->sequenceId == mCaptureRequests[PREVIEW_REQUEST_IDX]->sessionSequenceId) XYLOG(XYLOG_SEVERITY_WARNING, "onCaptureFailed session=%p request=%p reason=%d PhotoTaken=%d Preview=%d", session, request, failure->reason, m_photoTaken ? 1 : 0, isPreview ? 1 : 0);
if (isPreview)
{ {
return; return;
} }

@ -403,8 +403,6 @@ public class MainActivity extends AppCompatActivity {
binding.btnCameraInfo.setOnClickListener(new View.OnClickListener() { binding.btnCameraInfo.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
MicroPhotoService.setOtgState(true);
MicroPhotoService.setCam3V3Enable(true); MicroPhotoService.setCam3V3Enable(true);
Runnable runnable = new Runnable() { Runnable runnable = new Runnable() {
@ -415,7 +413,6 @@ public class MainActivity extends AppCompatActivity {
Log.d(TAG, cameraInfo); Log.d(TAG, cameraInfo);
MicroPhotoService.setCam3V3Enable(false); MicroPhotoService.setCam3V3Enable(false);
MicroPhotoService.setOtgState(false);
MicroPhotoService.infoLog(cameraInfo); MicroPhotoService.infoLog(cameraInfo);
Toast.makeText(view.getContext(), cameraInfo, Toast.LENGTH_LONG).show(); Toast.makeText(view.getContext(), cameraInfo, Toast.LENGTH_LONG).show();

@ -1181,7 +1181,7 @@ public class MicroPhotoService extends Service {
} }
notificationBuilder notificationBuilder
.setContent(remoteViews) .setContent(remoteViews)
.setSmallIcon(R.mipmap.ic_launcher) .setSmallIcon(R.drawable.ic_notification_mp)
.setCategory(NotificationCompat.CATEGORY_SERVICE) .setCategory(NotificationCompat.CATEGORY_SERVICE)
.setOnlyAlertOnce(true) .setOnlyAlertOnce(true)
.setOngoing(true) .setOngoing(true)
@ -1567,8 +1567,8 @@ public class MicroPhotoService extends Service {
if (!TextUtils.isEmpty(gateway)) { if (!TextUtils.isEmpty(gateway)) {
intent.putExtra("gateway", gateway); intent.putExtra("gateway", gateway);
} }
// intent.putExtra("dns1", "8.8.8.8"); intent.putExtra("dns1", "0.0.0.0");
// intent.putExtra("dns2", "192.168.19.1"); intent.putExtra("dns2", "0.0.0.0");
sendBroadcast(getApplicationContext(), intent); sendBroadcast(getApplicationContext(), intent);
} }
} }

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#00FF00"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M20,4h-3.17L15,2L9,2L7.17,4L4,4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2L22,6c0,-1.1 -0.9,-2 -2,-2zM20,18L4,18L4,6h4.05l1.83,-2h4.24l1.83,2L20,6v12zM12,7c-2.76,0 -5,2.24 -5,5s2.24,5 5,5 5,-2.24 5,-5 -2.24,-5 -5,-5zM12,15c-1.65,0 -3,-1.35 -3,-3s1.35,-3 3,-3 3,1.35 3,3 -1.35,3 -3,3z"/>
</vector>

@ -4,7 +4,7 @@ plugins {
def AppMajorVersion = 1 def AppMajorVersion = 1
def AppMinorVersion = 0 def AppMinorVersion = 0
def AppBuildNumber = 94 def AppBuildNumber = 95
def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber
def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber

@ -945,7 +945,7 @@ public class MpMasterService extends Service {
} }
notificationBuilder notificationBuilder
.setContent(remoteViews) .setContent(remoteViews)
.setSmallIcon(R.mipmap.ic_launcher) .setSmallIcon(R.drawable.ic_notification_mst)
.setCategory(NotificationCompat.CATEGORY_SERVICE) .setCategory(NotificationCompat.CATEGORY_SERVICE)
.setOnlyAlertOnce(true) .setOnlyAlertOnce(true)
.setOngoing(true) .setOngoing(true)
@ -1239,7 +1239,7 @@ public class MpMasterService extends Service {
if (destPathFile.exists()) { if (destPathFile.exists()) {
File dataPath = new File(destPathFile, "data"); File dataPath = new File(destPathFile, "data");
if (dataPath.exists()) { if (dataPath.exists()) {
File file = new File(destPathFile, "App.json"); File file = new File(dataPath, "App.json");
if (file.exists()) { if (file.exists()) {
return false; return false;
} else { } else {
@ -1247,6 +1247,7 @@ public class MpMasterService extends Service {
} }
} else { } else {
existed = false; existed = false;
try { try {
dataPath.mkdirs(); dataPath.mkdirs();
} catch (Exception ex) { } catch (Exception ex) {

@ -0,0 +1,5 @@
<vector android:height="24dp" android:tint="#FF0000"
android:viewportHeight="24" android:viewportWidth="24"
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="@android:color/white" android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/>
</vector>
Loading…
Cancel
Save