-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":921,"versionName":"2111241057","enabled":true,"outputFile":"ICSer_V921_2111241057_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V921_2111241057_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":922,"versionName":"2111241457","enabled":true,"outputFile":"ICSer_V922_2111241457_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V922_2111241457_release.apk","properties":{}}]
\ No newline at end of file
}
} else {
StringMessage PPGDATA = protocolAPIHelper.getPPG_ECG_MSG(this.runtime);
+ if (PPGDATA != null) {
+ Deliver.sendLocationMSG(PPGDATA);
+ ICLogger.i("Send PPG " + PPGDATA.isFromCache());
+ }
+ PPGDATA = protocolAPIHelper.getJustBoodPresureMsg(this.runtime);
+ if (PPGDATA != null) {
+ Deliver.sendLocationMSG(PPGDATA);
+ ICLogger.i("Send PPG " + PPGDATA.isFromCache());
+ }
//发送给EQC服务器的
sendBroadcastPPGResult();
//因为协议中没有时间变量,所以只能实时传输,如果恰巧没有网络也只能丢弃,有时间变量的话,可以考虑通过deliver的buffer来进行缓存发送
Deliver.sendLocationMSG(oxd);
checkWarning();
} else {
- Deliver.sendLocationMSG(PPGDATA);
- ICLogger.i("Send PPG " + PPGDATA.isFromCache());
checkWarning();
}
}
import android.content.ContentUris;
import android.content.ContentValues;
import android.content.Context;
+import android.content.IClipboard;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
}
+ private int insertCount = 0;
+
public long insertCMDRecord(StringMessage msg) {
+ //判断命令数量,如果超出了100个,那么就删除后面的数据
+ //减少删除和查询的次数,10个里头再操作一次
+ if (insertCount == 0 || insertCount >= 10) {
+ Cursor query = cr.query(ICContentProvider.PROTOCOL_CMD_RECORDS_URI, new String[]{"_id"}, null, null, null);
+ if (query != null) {
+ int count = query.getCount();
+ ICLogger.d("count ==> " + count);
+ //超过100个,把后面的删除了,默认没有排序,先添加的会参前面
+ if (count > 100) {
+ query.moveToFirst();
+ while (query.moveToNext() && insertCount > 1) {
+ ICLogger.d("insertCount ==> " + insertCount);
+ int id = query.getInt(0);
+ ICLogger.d("delete id ==> " + id);
+ insertCount--;
+ //删除数据
+ cr.delete(ICContentProvider.PROTOCOL_CMD_RECORDS_URI, "_id=?",
+ new String[]{String.valueOf(id)});
+ }
+ }
+ query.close();
+ }
+ }
+ //以上代码,删除过多的数据,库里保持0~110条
ContentValues values = new ContentValues();
values.put("FLAG", msg.haveSent());
- if (msg.getDate() == null || msg.getTime() == null)
+ if (msg.getDate() == null || msg.getTime() == null) {
msg.setDate(TimeUtil.getSystemDateYYMMDD(), TimeUtil.getSystemTimeHHmmss());
+ }
values.put("DATE", msg.getDate());
values.put("TIME", msg.getTime());
values.put("TOPIC", msg.cmd());
values.put("CMD", msg.isFromCache());
long raw_contactID = ContentUris.parseId(cr.insert(ICContentProvider.PROTOCOL_CMD_RECORDS_URI, values));
- if (Config.LOG_TOFILE)
+ if (Config.LOG_TOFILE) {
ICLogger.logToFile("APILog", " insert db " + raw_contactID + " " + msg.getDate() + msg.getTime() + " " + msg.cmd() + " " + msg.isFromCache());
-
+ }
return raw_contactID;
}
}
}
+ public static StringMessage getJustBoodPresureMsg(Runtime runtime) {
+ if (is_protocol_not_Initialled()) return null;
+ StringMessage ret = null;
+
+ if (runtime == null || runtime.getHRS().getBPH() <= 0) {
+ ICLogger.d(" 血压 值 <=0 跳过异常数据!");
+ return null;
+ }
+ switch (Config.protocol_no) {
+ case Config.PROTOCOL_BEEHOME:
+ ret = protocol_beehome.APJK(1, runtime);
+ break;
+ }
+ return ret;
+ }
+
/*
返回true 表示 cmd 全部解析成功
返回false表示 cmd至少有一条解析失败,失败的数据归入buffer,下一次识别接着使用
ret = protocol_jiai.APHT(runtime);
break;
case Config.PROTOCOL_BEEHOME:
- ret = protocol_beehome.APJK(1, runtime);
ret = protocol_beehome.APJK(2, runtime);
break;
case Config.PROTOCOL_IC: