<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
- android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
- <activity android:name="com.enqualcomm.support.MainActivity">
+ <activity android:name="com.enqualcomm.support.MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
\r
\r
public String getServerAlive(){\r
+ int ppg=ICJniUtils.getPPG();\r
return new StringBuilder()\r
- .append(TimeUtil.getLocalTime())\r
- .append(" Connecttion status is ").append(this.connection.isServerConnected())\r
- .append("\n KeepAlive ").append(KeepAlive.isConnected)\r
- .append( "\n Working Mode ").append(runtime.getLocationInstance().getWorkingMod()).append(" StepCount ").append(runtime.getTotalStepCount())\r
- .append("\n AP01 = ").append(protocolAPIHelper.AP01(runtime))\r
+ .append(TimeUtil.getSystemTime3())\r
+ .append("\n ppgExist ").append(ICJniUtils.isPPGavailable())\r
+ .append(", Started ").append(ICJniUtils.isPPGStarted())\r
+ .append(",weared ").append(ICJniUtils.isWeared())\r
+ .append(",ppg ").append(ppg)\r
+ .append(",bph ").append(ICJniUtils.getHighBloodPressure())\r
+ .append(",bpl ").append(ICJniUtils.getLowBloodPressure())\r
+ .append("\n Connecttion ").append(this.connection.isServerConnected())\r
+ .append(" KeepAlive ").append(KeepAlive.isConnected)\r
+ .append("\n ServerConnected is ").append(runtime.isServerProtocolConnected())\r
+ .append(" \n StepCount ").append(runtime.getTotalStepCount())\r
+ .append( "\n Working Mode ").append(runtime.getLocationInstance().getWorkingMod())\r
+ .append(" \n Location Cycle ").append(runtime.getLocationInstance().getLocation_cycle())\r
+ .append(" \n LocationType ").append(runtime.getLocationInstance().getLocationType())\r
+ .append(" at ").append(runtime.getLocationInstance().getLocationTime())\r
+ .append(" \n PPGTestCycle ").append(runtime.getPpgTestCycle())\r
.toString();\r
}\r
\r
\r
}\r
if(ACTION_HEATR_RATE_START.equals(paramIntent.getAction())){\r
- //此消息来源于BroadCaset以及Timer,收到开始测试的消息,马上发送消息给HeartRateManager开始测试。\r
- //此时需要重置HeartRateDetect Timer\r
- //倘若有 参数 PPGTestCycle,则根据这个数值进行设置\r
- int ppgtestCycle=paramIntent.getIntExtra("PPGTestCycle",-1);\r
- if (ppgtestCycle >0){\r
- Config.setPPGTestCycle(this,ppgtestCycle);\r
- runtime.setPpgTestCycle(Config.getPPGTestCycle(this));\r
- Logger.i("get and set PPGTestCycle "+ppgtestCycle);\r
- }\r
+\r
+ //此处消息从timer来\r
setHeartRateDetectAlarm(runtime.getPpgTestCycle());\r
this.invokeHandlerServiceChain.processUserRequest(paramIntent, this.connection, this.runtime);\r
\r
\r
Deliver.sendLocationMSG(AP01_CMD);\r
\r
+\r
+\r
if (mTimer!=null){\r
mTimer.cancel();\r
mTimer=null;\r
}\r
isLocating = false;\r
+ String locationtype="LBS";\r
+ if (gps_ok ){\r
+ locationtype="GPS";\r
+ }else if (wifi_ok){\r
+ locationtype="WiFi";\r
+ }\r
+ runtime.getLocationInstance().setLocationType(locationtype);\r
+ runtime.getLocationInstance().setLocationTime(TimeUtil.getSystemTime3());\r
}else if (timeout==true){\r
Logger.i("timeout no location ");\r
isLocating = false;\r
mTimer=null;\r
}\r
isLocating = false;\r
+\r
+ String locationtype="LBS";\r
+ if (wifi_ok){\r
+ locationtype="WiFi";\r
+ }\r
+ runtime.getLocationInstance().setLocationType(locationtype);\r
+ runtime.getLocationInstance().setLocationTime(TimeUtil.getSystemTime3());\r
+\r
}else if (timeout==true){\r
Logger.i("timeout no location ");\r
isLocating = false;\r
try {
if (showmessage) {
- sb.append("ppg is available ").append(ICJniUtils.isPPGavailable())
- .append(", ppg isstarted ").append(ICJniUtils.isPPGStarted())
- .append(",ppg ").append(ICJniUtils.getPPG())
- .append("weared ").append(ICJniUtils.isWeared())
- .append(",spo2 ").append(ICJniUtils.getSPO2())
- .append(",bph ").append(ICJniUtils.getHighBloodPressure())
- .append(",bpl ").append(ICJniUtils.getLowBloodPressure())
- .append("\n");
-
sb.append(CoreService.getInstance().getServerAlive());
tv.setText(sb.toString());
}
import android.util.Log;\r
\r
import com.enqualcomm.support.Config;\r
+import com.enqualcomm.support.Constants;\r
+import com.enqualcomm.support.LocationClient;\r
import com.enqualcomm.support.bean.Contact;\r
import com.enqualcomm.support.bean.Content;\r
import com.enqualcomm.support.bean.ICLocation;\r
}\r
//处理 心跳 BP03\r
public void handleBP03(String cmd){\r
+\r
log("BP03心跳接收成功");\r
}\r
\r
Config.setLocationCycle(runtime.getContextProxy().context,Cycle);\r
runtime.getLocationInstance().setLocation_cycle(Cycle);\r
runtime.getLocationInstance().setWorkingMod(mod);\r
+// CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());\r
//此处设置好配置后,会在LocationClient通过消息开始执行及时定位操作。\r
}\r
\r
String time=list[3];\r
connection.send(protocolAPIHelper.genStringMessage("AP15",AP15(index)));\r
Logger.i("BP15 , 定位周期="+time+"分钟");\r
+\r
+ Config.setLocationMode(runtime.getContextProxy().context, ICLocation.CUSTOM_MOD);\r
+ Config.setLocationCycle(runtime.getContextProxy().context,Integer.valueOf(time));\r
+ runtime.getLocationInstance().setWorkingMod(Config.getLocationMode(runtime.getContextProxy().context));\r
+ runtime.getLocationInstance().setLocation_cycle(Config.getLocationCycle(runtime.getContextProxy().context));\r
+ CoreService.getInstance().setLocationAlarm(runtime.getLocationInstance().getWorkingMod());\r
+\r
+\r
}else{\r
Logger.i("BP15 format error");\r
}\r
private int location_cycle;\r
\r
public void setWorkingMod(int wkmod){ mworkingMod=wkmod;}\r
- public void setLocation_cycle(int locatCycle){ locatCycle=locatCycle;}\r
+ public void setLocation_cycle(int _locatCycle){ location_cycle=_locatCycle;}\r
public int getWorkingMod(){return mworkingMod;}\r
public int getLocation_cycle(){return location_cycle;}\r
\r
public LOCATION_STAT getLocationStat(){\r
return currentStat;\r
}\r
+ private String LocationTime;\r
+ public void setLocationTime(String time){\r
\r
+ LocationTime=time;\r
+ }\r
+ public String getLocationTime(){\r
+ return LocationTime;\r
+ }\r
+ private String LocationType;\r
+ public void setLocationType(String type){\r
+\r
+ LocationType=type;\r
+ }\r
+ public String getLocationType(){\r
+ return LocationType;\r
+ }\r
public GPS_LocationPoint getLocation(){\r
return currentLP;\r
}\r
private String currentCellInfo;\r
\r
// public String currentWifiInfo="";\r
- private int ppgTestCycle;\r
+ private static int ppgTestCycle;\r
\r
private DBHelper dbHelper;\r
\r
private boolean UseQueue=false;\r
private boolean lockSimInfo=false;\r
\r
+ private boolean ServerHeartBeadReceived=false;\r
+\r
+ public void setServerProtocolConnected(boolean received){\r
+ ServerHeartBeadReceived=received;\r
+ }\r
+\r
+ public boolean isServerProtocolConnected(){\r
+ return ServerHeartBeadReceived;\r
+ }\r
\r
public void setPpgTestCycle(int cycle){\r
ppgTestCycle=cycle;\r
\r
public boolean getHaveBatteryChange() { return this.haveBatteryChange; }\r
\r
- \r
+\r
public String getHost() { return this.testServerProp ? srvIP : this.host; }\r
\r
public void setSrvIP(String ip) { this.srvIP=ip;}\r
import android.os.Messenger;\r
import android.os.PowerManager;\r
\r
+import com.enqualcomm.support.Config;\r
import com.enqualcomm.support.Constants;\r
+import com.enqualcomm.support.CoreService;\r
import com.ic.jni.ICJniUtils;\r
import com.enqualcomm.support.LocationClient;\r
import com.enqualcomm.support.adapter.protocolAPIHelper;\r
private BroadcastReceiver PPGStartReceiver = new BroadcastReceiver() {\r
public void onReceive(Context param1Context, Intent param1Intent) {\r
if (ACTION_HEATR_RATE_START.equals(param1Intent.getAction())) {\r
- HeartRateManager.this.startPPG();\r
+\r
+ //此消息来源于BroadCaset,收到开始测试的消息。\r
+ //此时需要重置HeartRateDetect Timer\r
+ //倘若有 参数 PPGTestCycle,则根据这个数值进行设置\r
+ int ppgtestCycle=param1Intent.getIntExtra("PPGTestCycle",-1);\r
+ if (ppgtestCycle >0){\r
+ Config.setPPGTestCycle(runtime.getContextProxy().context,ppgtestCycle);\r
+ runtime.setPpgTestCycle(Config.getPPGTestCycle(runtime.getContextProxy().context));\r
+ Logger.i("get and set PPGTestCycle "+ppgtestCycle);\r
+ }\r
+ CoreService.getInstance().setHeartRateDetectAlarm(runtime.getPpgTestCycle());\r
+ HeartRateManager.this.startPPG();\r
}\r
+\r
+\r
}\r
};\r
\r
Logger.i(stringBuilder.toString());\r
Config.sw_release_no = DeviceInfoUtil.getCustomId();\r
//发送登录包\r
- StringMessage stringMessage=new StringMessage(protocolAPIHelper.AP00(paramRuntime));\r
- paramConnection.send(stringMessage);\r
+ paramConnection.send(new StringMessage(protocolAPIHelper.AP00(paramRuntime)));\r
+// paramConnection.send(new StringMessage(protocolAPIHelper.AP00(paramRuntime)));\r
+// paramConnection.send(new StringMessage(protocolAPIHelper.AP00(paramRuntime)));\r
return false;\r
}\r
\r
CoreService.getInstance().startConnectionRetryTimer();\r
connectionError = true;\r
isConnected = false;\r
+ paramRuntime.setServerProtocolConnected(false);\r
paramRuntime.getContextProxy().sendBroadcast(isConnected);\r
StringBuilder stringBuilder = new StringBuilder();\r
stringBuilder.append("onConnectionClose=");\r
connectionError = false;\r
// connection.send(protocolAPIHelper.genStringMessage("AP00",protocolAPIHelper.AP00(paramRuntime)));\r
connection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(paramRuntime)));\r
+ connection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(paramRuntime)));\r
+ connection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(paramRuntime)));\r
// if (Deliver.haveSendH42) {\r
// ServiceUtil.offerQueue(new StringMessage(protocolAPIHelper.AP03(paramRuntime)));\r
// Deliver.haveSendH42 = false;\r
isConnected = true;\r
this.firstReConnected = true;\r
this.idleTimeMillis = SystemClock.elapsedRealtime();\r
- paramRuntime.getContextProxy().sendBroadcast(isConnected);\r
\r
- LauncherCtrl.getInstance(this.mContext).setStatusBarIcon("server_connected", STATUS_BAR_STATE_SERVER_CONNECTED_ON);\r
return false;\r
}\r
\r
// if (this.reCycleTimes == 0 && this.currentReConnectInterval != 11){\r
// paramNettyConnection.send(protocolAPIHelper.genStringMessage("AP00",protocolAPIHelper.AP00(paramRuntime)));\r
paramNettyConnection.send(protocolAPIHelper.genStringMessage("heart",protocolAPIHelper.AP03(paramRuntime)));\r
- // }\r
+\r
+ // }\r
\r
}\r
\r
if ("heart".equals(paramStringMessage.cmd())) {\r
AlarmWakeUp.isNeedWakeUpAlarm(paramRuntime);\r
return true;\r
+ }else if ("BP03".equals(paramStringMessage.cmd())){\r
+// 收到心跳才认为是已经连接了服务器\r
+ paramRuntime.setServerProtocolConnected(true);\r
+ paramRuntime.getContextProxy().sendBroadcast(isConnected);\r
+ LauncherCtrl.getInstance(this.mContext).setStatusBarIcon("server_connected", STATUS_BAR_STATE_SERVER_CONNECTED_ON);\r
}\r
return false;\r
}\r
API.handleBP03(cmd);\r
Logger.i("服务器收到心跳AP03");\r
DeliverCMDMessageToSystem("BP03",cmd);//通知下面线程状态变化\r
-\r
break;\r
\r
case BP07:\r
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:paddingBottom="@dimen/activity_vertical_margin"
+ android:isScrollContainer="false"
android:paddingLeft="@dimen/activity_horizontal_margin"
- android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.enqualcomm.support.MainActivity">
<LinearLayout
</LinearLayout>
<HorizontalScrollView
+ style="@android:style/Widget.DeviceDefault.Light.HorizontalScrollView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="horizontal|vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:orientation="horizontal">
+ android:orientation="vertical"
+ android:scrollbarStyle="insideOverlay"
+ android:scrollbars="horizontal|vertical">
- <TextView
- android:id="@+id/textView"
+ <ScrollView
android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scrollbarAlwaysDrawVerticalTrack="true"
- android:scrollbarSize="10dp"
- android:scrollbarStyle="outsideOverlay"
- android:scrollbars="vertical"
- android:textAlignment="viewStart"
- android:textSize="18sp"
- android:verticalScrollbarPosition="right"
- android:visibility="visible" />
+ android:layout_height="match_parent">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/textView"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:scrollbarAlwaysDrawVerticalTrack="true"
+ android:scrollbarSize="10dp"
+ android:scrollbarStyle="outsideOverlay"
+ android:scrollbars="horizontal|vertical"
+ android:textAlignment="viewStart"
+ android:textSize="18sp"
+ android:verticalScrollbarPosition="defaultPosition"
+ android:visibility="visible" />
+ </LinearLayout>
+ </ScrollView>
+
</LinearLayout>
</HorizontalScrollView>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
+ <item name="android:windowFullscreen">true</item>
+ <item name="android:windowNoTitle">true</item>
+
</style>
</resources>
-#Wed Feb 05 20:55:30 CST 2020\r
-VERSION_CODE=343\r
+#Thu Feb 06 18:30:25 CST 2020\r
+VERSION_CODE=344\r