<action android:name="com.enqualcomm.support.ACTION_RETRY_SERVER_CONNECT" />
<action android:name="com.enqualcomm.support.ACTION_CHECK_LOCATION_RESULT" />
<action android:name= "com.ic.action.message_sent" />
+ <action android:name= "com.ic.action.temp_result" />
+
<!-- <action android:name="com.eqc.heartrate.action.SILENT_START" /> -->
</intent-filter>
</receiver>
public static final String KEY_MESSAGE_FROM = "msgFrom"; // 消息来源(发送者名称),预留,暂时不用。\r
\r
\r
+\r
+ public static final String ACTION_TEMP_RESULT = "com.ic.action.temp_result";\r
+ public static final String KEY_TEMP_BODY = "body"; // double 体温\r
+ public static final String KEY_TEMP_WRIST= "wrist"; // double 腕温\r
+\r
+\r
}\r
\r
import static com.enqualcomm.support.Constants.HEART_ALARM;\r
import static com.enqualcomm.support.Constants.KEY_SAVE_STEP_COUNT;\r
import static com.enqualcomm.support.Constants.KEY_STEP_COUNT;\r
+import static com.enqualcomm.support.Constants.KEY_TEMP_BODY;\r
+import static com.enqualcomm.support.Constants.KEY_TEMP_WRIST;\r
import static com.enqualcomm.support.Constants.STEP_COUNT_ALARM_ACTION;\r
import static com.enqualcomm.support.Constants.TEMP_ALARM;\r
import static com.enqualcomm.support.bean.ICLocation.*;\r
+import static com.ic.protocols.protocolAPIHelper.getTemperatureMSG;\r
\r
\r
public class CoreService extends Service {\r
return Service.START_STICKY;\r
}\r
} else if (TEMP_ALARM.equals(paramIntent.getAction())) {\r
-\r
if (this.mKeepAlive != null) {\r
-\r
if (connection.isServerConnected() && runtime.isServerProtocolConnected()) {\r
//测试温度并上报\r
- String temperatureMsg=protocolAPIHelper.getTemperatureMSG(TemperatureUtil.get_temp_value_adjusted());\r
+ double wrist_temp=paramIntent.getDoubleExtra(KEY_TEMP_WRIST,0.0f);\r
+ double body_temp=paramIntent.getDoubleExtra(KEY_TEMP_BODY,0.0f);\r
+ String temperatureMsg=getTemperatureMSG(wrist_temp,body_temp);\r
ICLogger.i("发送体温测量值 "+temperatureMsg);\r
Deliver.sendLocationMSG(temperatureMsg);\r
}\r
}\r
if (current_anti_status==0){\r
//佩戴\r
- play_notify();\r
+ // play_notify();\r
mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED);\r
String msg=protocolAPIHelper.getWarningMSG(mRuntime);\r
Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
// send_anti_event_broadcast(0);\r
}else{\r
//脱腕\r
- play_notify();\r
+ // play_notify();\r
// screen_on();\r
mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF);\r
String msg=protocolAPIHelper.getWarningMSG(mRuntime);\r
\r
public static void sendLocationMSG( String Msg){\r
\r
+ if(Msg.trim().isEmpty()){\r
+ ICLogger.i("命令为空,跳过发送!");\r
+ return ;\r
+ }\r
if(mRuntime.getUseQueue()){\r
if(!ServiceUtil.offerQueue(protocolAPIHelper.genStringMessage("queue",Msg))) {\r
ICLogger.i(" MessageQueue 已满,数据将被丢弃," + Msg);\r
if (Config.LOG_TOFILE)ICLogger.logToFile( "APILog", " queueFullskip " + Msg);\r
-\r
}\r
-\r
// if(queue.size()>5) //测试queue 发送逻辑用\r
triggerSendThread();\r
-\r
}else {\r
if (checkNetwork()) {\r
ICLogger.i(" first send " + Msg);\r
import com.enqualcomm.support.R;\r
import com.enqualcomm.support.bean.NotificationParam;\r
import com.enqualcomm.support.bean.VoiceContent;\r
+import com.enqualcomm.support.service.Deliver;\r
import com.ic.jni.ICJniUtils;\r
import com.enqualcomm.support.bean.Contact;\r
import com.enqualcomm.support.service.AudioService;\r
import static com.enqualcomm.support.Constants.ACTION_SEND_EMEGENCY_LOCATION_START;\r
import static com.enqualcomm.support.Constants.ACTION_SEND_SOS_MSG;\r
import static com.enqualcomm.support.Constants.ACTION_SHUTDOWN;\r
+import static com.enqualcomm.support.Constants.ACTION_TEMP_RESULT;\r
import static com.enqualcomm.support.Constants.DIALOG_ACTION;\r
import static com.enqualcomm.support.Constants.KEY_MESSAGE_FROM;\r
import static com.enqualcomm.support.Constants.KEY_MESSAGE_TYPE;\r
import static com.enqualcomm.support.Constants.KEY_MESSAGE_URL;\r
+import static com.enqualcomm.support.Constants.KEY_TEMP_BODY;\r
+import static com.enqualcomm.support.Constants.KEY_TEMP_WRIST;\r
import static com.enqualcomm.support.Constants.RESUME_ACTION;\r
import static com.enqualcomm.support.Constants.SOS_ACTION;\r
import static com.enqualcomm.support.Constants.STEP_COUNT_ALARM_ACTION;\r
import static com.enqualcomm.support.bean.Content.CONTACT_CATEGORY_GROUP;\r
+import static com.ic.protocols.protocolAPIHelper.genStringMessage;\r
+import static com.ic.protocols.protocolAPIHelper.getTemperatureMSG;\r
+import static com.ic.protocols.protocol_beehome.APTP;\r
\r
public class ProcessReceiver extends BroadcastReceiver {\r
private static final int MICRO_CHAT = 2;\r
if (mCustomDialog != null && mCustomDialog.isShowing()) {\r
mCustomDialog.dismiss();\r
}\r
-\r
- } else {\r
+ }else if (ACTION_TEMP_RESULT.equals(str)) {\r
+ double wrist_temp=paramIntent.getDoubleExtra(KEY_TEMP_WRIST,0.0f);\r
+ double body_temp=paramIntent.getDoubleExtra(KEY_TEMP_BODY,0.0f);\r
+ String temperatureMsg=getTemperatureMSG(wrist_temp,body_temp);\r
+ ICLogger.i("发送体温测量值 "+temperatureMsg);\r
+ Deliver.sendLocationMSG(temperatureMsg);\r
+\r
+ } else {\r
if (mCustomDialog != null && mCustomDialog.isShowing()) {\r
mCustomDialog.dismiss();\r
}\r
\r
private static double temp_value_orig =0.0f;\r
private static double temp_adjust_value=0.0f;\r
+ private static double body_temp_value=0.0f;\r
public static double get_temp_value_origin()\r
{\r
temp_value_orig= ICJniUtils.getTemperature();\r
return temp_adjust_value;\r
\r
}\r
+ public static double getBodyTemp(double wristtemp,double envtemp){\r
+ body_temp_value=ICJniUtils.getBodyTempFromWristTemp(wristtemp,envtemp);\r
+ ICLogger.i("get body Temperature value="+body_temp_value);\r
+ return body_temp_value;\r
+ }\r
}\r
/*此操作仅仅为了检查标志状态设置成功与否,标志已经在内部被使用*/\r
public static native int getTemperatureValidFlag();\r
\r
+ /*根据环境参考温度和腕温换算 体温*/\r
+ public static native double getBodyTempFromWristTemp(double wrist_temp,double ref_temp);\r
\r
}\r
return sm;\r
}\r
\r
- public static String getTemperatureMSG(double temp_adusted){\r
+ public static String getTemperatureMSG(double temp_adusted,double body_temp){\r
String ret="";\r
switch(Config.protocol_no)\r
{\r
ret="";\r
break;\r
case 1:\r
- ret=protocol_beehome.APTP(temp_adusted);\r
+ ret=protocol_beehome.APTP(temp_adusted,body_temp);\r
break;\r
}\r
return ret;\r
ICLogger.i("收到服务器指令:测量体温 "+freq+"分钟一次。");\r
Config.setTemperatureTestCycle(runtime,freq);\r
CoreService.getInstance().setTempAlarm();\r
- String temperatureMsg=APTP(TemperatureUtil.get_temp_value_adjusted());\r
- connection.send(genStringMessage("APTP",temperatureMsg));\r
+ double wrist_temp,body_temp;\r
+ wrist_temp=TemperatureUtil.get_temp_value_adjusted();\r
+ body_temp=TemperatureUtil.getBodyTemp(wrist_temp,26.0f);\r
+ String temperatureMsg=APTP(wrist_temp,body_temp);\r
+ connection.send(genStringMessage("APTP",temperatureMsg));\r
ICLogger.i("发送体温测量值 "+temperatureMsg);\r
}else{\r
ICLogger.i("BP89 format error!");\r
\r
}\r
\r
-\r
//体温上行(上行协议号:APTP,响应:BPTP)\r
- public static String APTP(double temperature){\r
+ public static String APTP(double wrist_temp,double body_temp){\r
\r
//设备: IWAPTP,36.3,33,132#\r
//IW:标识符\r
//35.3:测量体温 (摄氏度)\r
//33,132:温补用的参数,此处不用,可以用0 来代替。\r
return new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APTP))\r
- .append(CMDSPLIT).append(String.format("%1$.2f",temperature))\r
- .append(CMDSPLIT).append(0).append(CMDSPLIT).append(0)\r
+ .append(CMDSPLIT).append(String.format("%1$.2f",wrist_temp))\r
+ .append(CMDSPLIT).append(String.format("%1$.2f",body_temp))\r
+ .append(CMDSPLIT).append(0)\r
.append(CMDEND).toString();\r
}\r
\r
-#Thu Jul 02 18:42:10 CST 2020\r
-VERSION_CODE=433\r
+#Sat Jul 04 11:54:24 CST 2020\r
+VERSION_CODE=434\r