|
|
|
@ -527,7 +527,12 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
int preset = (int) ((val & 0xFF0L) >> 4);
|
|
|
|
|
int mediaType = (int)(val & 0xFL);
|
|
|
|
|
|
|
|
|
|
if (channel >= 256)
|
|
|
|
|
if (channel == 0x200)
|
|
|
|
|
{
|
|
|
|
|
// Heartbeat
|
|
|
|
|
infoLog("HB Timer Fired");
|
|
|
|
|
}
|
|
|
|
|
else if (channel >= 256)
|
|
|
|
|
{
|
|
|
|
|
infoLog("SERIAL Timer Fired: CH=" + (channel - 256) + " PR=" + preset);
|
|
|
|
|
}
|
|
|
|
@ -536,6 +541,16 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
infoLog("IMG Timer Fired: CH=" + channel + " PR=" + preset);
|
|
|
|
|
}
|
|
|
|
|
mService.notifyToTakePhoto(mService.mNativeHandle, channel, preset, ts, null, mediaType);
|
|
|
|
|
|
|
|
|
|
if (channel == 0x200)
|
|
|
|
|
{
|
|
|
|
|
// Try to turn off GPS
|
|
|
|
|
try {
|
|
|
|
|
mService.detectGpsStatus();
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -734,6 +749,9 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
|
|
|
|
|
private void registerHeartbeatTimer(long timeoutMs) {
|
|
|
|
|
|
|
|
|
|
if (true) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 创建延迟意图
|
|
|
|
|
long triggerTime = System.currentTimeMillis() + timeoutMs;
|
|
|
|
|
triggerTime -= (triggerTime % 1000);
|
|
|
|
@ -765,7 +783,13 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
val = schedules.get(idx).longValue();
|
|
|
|
|
channel = ((val & 0XFFFF000) >> 12);
|
|
|
|
|
intent.putExtra(EXTRA_PARAM_SCHEDULE + idx, schedules.get(idx).longValue());
|
|
|
|
|
if (channel > 0xFF)
|
|
|
|
|
if (channel == 0x200)
|
|
|
|
|
{
|
|
|
|
|
channelStr.append("(HB) ");
|
|
|
|
|
intent.putExtra("HeartbeatDuration", (int)((val & 0XFF0) >> 4) * 60000);
|
|
|
|
|
intent.putExtra("HeartbeatTime", scheduleTime * 1000);
|
|
|
|
|
}
|
|
|
|
|
else if (channel > 0xFF)
|
|
|
|
|
{
|
|
|
|
|
channel &= 0xFF;
|
|
|
|
|
channelStr.append("(" + channel + "-" + Long.toString (((val & 0XFF0) >> 4), 16).toUpperCase() + "/SERIAL) ");
|
|
|
|
|