return ret;
}
- public static StringMessage getPPG_ECG_MSG(Runtime runtime, int ppg, int bph, int bpl) {
- if (is_protocol_not_Initialled()) return null;
- StringMessage ret = null;
- if (runtime == null || runtime.getHRS().getPPG() <= 0) {
- ICLogger.d(" 心率 值 <=0 跳过异常数据!");
- return null;
- }
- switch (Config.protocol_no) {
- case Config.PROTOCOL_JIAI:
- ret = protocol_jiai.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_BEEHOME:
- ret = protocol_beehome.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_IC:
- ret = protocol_ic.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_FZD:
- ret = null;
- break;
- case Config.PROTOCOL_MQTT:
- ret = null;
- break;
- case PROTOCOL_ANAN:
- ret = protocol_anan.APHT(runtime);
- break;
- case Config.PROTOCOL_S123:
- ret = protocol_s123.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_GATOR:
- ret = null;
- break;
- }
- return ret;
- }
-
public static StringMessage getBlood_MSG(int pbh, int pbl, Runtime runtime) {
if (is_protocol_not_Initialled()) return null;
if (runtime == null) {
return ret;
}
- public static StringMessage getPPG_ECG_MSG(int ppg, int bph, int bpl, int spo2, Runtime runtime) {
- if (is_protocol_not_Initialled()) return null;
-
- StringMessage ret = null;
- switch (Config.protocol_no) {
- case Config.PROTOCOL_JIAI:
- // ret=protocol_jiai.APHP(ppg,bph,bpl,spo2);
- ret = protocol_jiai.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_BEEHOME:
- ret = protocol_beehome.APHT(ppg, bph, bpl);
- break;
- case Config.PROTOCOL_IC:
- ret = protocol_ic.APHP(ppg, bph, bpl, spo2);
- break;
- case Config.PROTOCOL_FZD:
- ret = null;
- break;
- case Config.PROTOCOL_MQTT:
- ret = null;
- break;
- case Config.PROTOCOL_S123:
- ret = protocol_s123.APHP(ppg, bph, bpl, spo2);
- break;
- case Config.PROTOCOL_GATOR:
- ret = null;
- break;
- }
- return ret;
- }
public static StringMessage getWeatherMSG(Runtime runtime) {
if (is_protocol_not_Initialled()) return null;
}
- /**
- * 心率上传,返回协议字串
- *
- * @param ds
- * @return
- */
- public static StringMessage AP49(Runtime ds) {
- //示例数据:IWAP49,68##
- return genStringMessage(cmdMap.get(CMD_TYPE.AP49), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP49))
- .append(CMDSPLIT).append(ds.getHRS().getPPG())
- .append(CMDEND).toString());
-
- }
-
-
- /**
- * 返回上传心率血压的协议字串
- *
- * @param ds
- * @return
- */
- public static StringMessage APHT(Runtime ds) {
- //IWAPHT,60,130,85#
- //说明:
- //IW:标识符
- //APHT : 命令字符
- //60 : 表示心率
- //130: 血压高压 [收缩压]
- //85 : 血压低压 [舒张压]
- //平台响应: IWBPHT#
- //表示平台已接收,可不作响应
- return genStringMessage(cmdMap.get(CMD_TYPE.APHT), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APHT))
- .append(CMDSPLIT).append(ds.getHRS().getPPG())
- .append(CMDSPLIT).append(ds.getHRS().getBPH())
- .append(CMDSPLIT).append(ds.getHRS().getBPL())
- .append(CMDEND).toString());
- }
-
- public static StringMessage APHT(int ppg, int bph, int bpl) {
- //IWAPHT,60,130,85#
- //说明:
- //IW:标识符
- //APHT : 命令字符
- //60 : 表示心率
- //130: 血压高压 [收缩压]
- //85 : 血压低压 [舒张压]
- //平台响应: IWBPHT#
- //表示平台已接收,可不作响应
- return genStringMessage(cmdMap.get(CMD_TYPE.APHT), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APHT))
- .append(CMDSPLIT).append(ppg)
- .append(CMDSPLIT).append(bph)
- .append(CMDSPLIT).append(bpl)
- .append(CMDEND).toString());
- }
-
-
//立即定位反馈
public static StringMessage AP16(String cmdindex) {
//IWAP16,080835#
}
public static StringMessage APHP(Runtime ds) {
+ //如果数据小于60那么就不上传了
+ int ppg = ds.getHRS().getPPG();
+ if (ppg < 60) {
+ ICLogger.d("心跳慢于60,不再上传了...");
+ return null;
+ }
//IWAPHP,60,130,85,95,90, , , , , , , , #
//IW:标识符
//APHT : 命令字符
.append(CMDEND).toString());
}
- public static StringMessage APHP(int ppg, int bph, int bpl, int spo2) {
- //IWAPHP,60,130,85,95,90, , , , , , , , #
- //IW:标识符
- //APHT : 命令字符
- //60 : 表示心率
- //130: 血压高压 [收缩压]
- //85 : 血压低压 [舒张压]
- //95:血氧
- //90:血糖
-// 本消息适用所有终端,其中需要每项指标不一定全部有值,如果无值,则留空
- return genStringMessage(cmdMap.get(CMD_TYPE.APHP), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.APHP))
- .append(CMDSPLIT).append(ppg)
- .append(CMDSPLIT).append(bph)
- .append(CMDSPLIT).append(bpl)
- .append(CMDSPLIT).append(spo2)
- .append(CMDSPLIT).append(0)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDSPLIT)
- .append(CMDEND).toString());
- }
-
-
public void handleBPHP() {
ICLogger.i("服务器收到APHP 心率血压血氧 !");
}