-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":903,"versionName":"2109252333","enabled":true,"outputFile":"ICSer_V903_2109252333_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V903_2109252333_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":904,"versionName":"2110142133","enabled":true,"outputFile":"ICSer_V904_2110142133_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V904_2110142133_release.apk","properties":{}}]
\ No newline at end of file
import com.ic.s123.IS123WeatherCallback;
import com.ic.s123.IS123WeatherService;
-import org.apache.harmony.misc.SystemUtils;
-
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
}
}
- private Runnable mupdatePracticeData = new Runnable() {
- @Override
- public void run() {
- //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
- Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
- //发送过后重置
- Runtime.healthInfo.resetBuffer();
- }
+ private Runnable mUpdatePracticeData = () -> {
+ //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
+ Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
+ //发送过后重置
+ Runtime.healthInfo.resetBuffer();
};
private final BroadcastReceiver broadcastPracticeCMDReceiver = new BroadcastReceiver() {
if (Runtime.healthInfo.getInfoCount() >= 0) {
//超过30次发送数据给服务器
ICLogger.i("自由锻炼结束,发送数据给服务器 " + Runtime.healthInfo.getBufferData().length);
- mHandler.post(mupdatePracticeData);
+ mHandler.post(mUpdatePracticeData);
}
}
package com.ic.protocols;
import android.content.ComponentName;
+import android.content.ContentResolver;
+import android.content.ContentValues;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
APSQ,
BPMC,//专门控制skipmovecheck
APMC,//
+ BPPH,//拨号功能开关
+ APPH,
}
private static HashMap<CMD_TYPE, String> cmdMap = null;
cmdMap.put(CMD_TYPE.APSQ, "APSQ");
cmdMap.put(CMD_TYPE.BPMC, "BPMC");
cmdMap.put(CMD_TYPE.APMC, "APMC");
+ cmdMap.put(CMD_TYPE.BPPH, "BPPH");
+ cmdMap.put(CMD_TYPE.APPH, "APPH");
}
.append(CMDEND).toString());
}
+ /**
+ * 处理拨号开关,数据入库,进入拨号前要获取一下,是否可以拨号,
+ *
+ * @param cmd IWBPPH,353456789012345,080835,1#
+ * IWAPPH,080835,1#
+ */
+ private void handleBPPH(String cmd) {
+ //解析数据
+ String[] split = cmd.split(CMDSPLIT);
+ if (split.length == 4) {
+ try {
+ String id = split[2];
+ String value = split[3];
+ //1 : 表示设备可以拨号 0:表示设备不可拨号, 用于同步平台设置。
+ Util.setSystemProperties("persist.sys.phone.enable", value);
+ //返回结果
+ responseWithId(cmdMap.get(CMD_TYPE.APPH), id, value);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ } else {
+ ICLogger.d("handleBPPH error...");
+ }
+ }
+
+ private void responseWithId(String cmd, String id, String... args) {
+ StringBuilder append = new StringBuilder(CMDHEADER).append(cmd)
+ .append(CMDSPLIT).append(id);
+ for (String arg : args) {
+ append.append(CMDSPLIT).append(arg);
+ }
+ append.append(CMDEND);
+ ICLogger.d("response content ==> " + append.toString());
+ StringMessage stringMessage = genStringMessage(cmd, append.toString());
+ mConnection.send(stringMessage);
+ }
+
+
public static StringMessage APHP(int ppg, int bph, int bpl, int spo2) {
//IWAPHP,60,130,85,95,90, , , , , , , , #
//IW:标识符
}
public void handleBPHP() {
-
ICLogger.i("服务器收到APHP 心率血压血氧 !");
-
}
public boolean handleCmd(CMD_TYPE type, String cmd) {
//报警包
mConnection.DeliverCMDMessageToSystem("AP10", cmd);//通知下面线程状态变化
break;
-
case BPTM:
//校时命令
handleBPTM(cmd);
ICLogger.d("收到服务器下发的修改skipmovecheck");
handleBPMC(cmd);
break;
+ case BPPH:
+ //收到服务器拨号功能开关
+ ICLogger.d("收到服务器拨号功能开关.");
+ handleBPPH(cmd);
+ break;
}
return ret;