TempBranch
Matthew 7 months ago
parent 35aa8bf2b0
commit 92e5473ca3

@ -3131,8 +3131,6 @@ void CPhoneDevice::UpdateSimcard(const std::string& simcard)
m_simcard = simcard;
}
int CPhoneDevice::GetIceData(IDevice::ICE_INFO *iceInfo, IDevice::ICE_TAIL *iceTail, SENSOR_PARAM *sensorParam)
{
Collect_sensor_data(); //15s
@ -3216,13 +3214,13 @@ bool CPhoneDevice::OpenSensors(int sensortype)
GpioControl::set12VEnable(true);
GpioControl::setCam3V3Enable(true);
GpioControl::setRS485Enable(true);
GpioControl::setInt(CMD_SET_485_ENABLE, 1); // 打开RS485电源
GpioControl::setInt(CMD_SET_485_EN_STATE, 1); // 打开RS485电源
}
if(sensortype == CAMERA_SENSOR_OPEN)
{
GpioControl::setInt(CMD_SET_PIC1_POWER, 1);
GpioControl::setInt(CMD_SET_485_en4, 1);
GpioControl::setInt(CMD_SET_3V3_PWR_ENABLE, 1); // 打开3.3V电压
GpioControl::setInt(CMD_SET_CAM_3V3_EN_STATE, 1); // 打开3.3V电压
GpioControl::setInt(CMD_SET_PTZ_PWR_ENABLE, 1);
}
if(sensortype == WEATHER_SENSOR_OPEN || sensortype == ICETHICK_SENSOR_OPEN)
@ -3253,14 +3251,14 @@ bool CPhoneDevice::CloseSensors(int sensortype)
GpioControl::set12VEnable(false);
GpioControl::setCam3V3Enable(false);
GpioControl::setRS485Enable(false);
GpioControl::setInt(CMD_SET_485_ENABLE, 0);
GpioControl::setInt(CMD_SET_485_EN_STATE, 0);
}
if(sensortype == CAMERA_SENSOR_OPEN)
{
GpioControl::setInt(CMD_SET_PIC1_POWER, 0);
GpioControl::setInt(CMD_SET_485_en4, 0);
GpioControl::setInt(CMD_SET_3V3_PWR_ENABLE, 0);
GpioControl::setInt(CMD_SET_CAM_3V3_EN_STATE, 0);
GpioControl::setInt(CMD_SET_PTZ_PWR_ENABLE, 0);
}
if(sensortype == WEATHER_SENSOR_OPEN || sensortype == ICETHICK_SENSOR_OPEN)
@ -3281,4 +3279,4 @@ bool CPhoneDevice::CloseSensors(int sensortype)
GpioControl::setInt(CMD_SET_485_en2, 0);
}
return 0;
}
}

@ -115,7 +115,9 @@ public class MainActivity extends AppCompatActivity {
}
}
Log.d(TAG, "Start inflate");
binding = ActivityMainBinding.inflate(getLayoutInflater());
Log.d(TAG, "Finish inflate");
setContentView(binding.getRoot());
// getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);

@ -567,13 +567,16 @@ public class MicroPhotoService extends Service {
String path = intent.getStringExtra("path");
String md5 = intent.getStringExtra("md5");
} else if (TextUtils.equals(ACTION_GPS_TIMEOUT, action)) {
mService.mPreviousGpsTimer = null;
Log.i(TAG, action);
try {
mService.mLocationManager.removeUpdates(mService.mLocationListener);
Log.i(TAG, "After removeUpdates");
} catch (Exception ex) {
ex.printStackTrace();
}
mService.enableGps(false);
Log.i(TAG, "After disable GPS");
mService.mPreviousGpsTimer = null;
} else if (TextUtils.equals(ACTION_RESTART, action)) {
String reason = intent.getStringExtra("reason");

Loading…
Cancel
Save