|
@@ -1116,6 +1116,24 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
Log.e(TAG, "error func: ?拔针按键")
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ "P" -> {
|
|
|
+ //紧急按钮取消
|
|
|
+ Log.e(TAG,"sos call list size: " + Constant.sosInteractions.size)
|
|
|
+ if (Constant.sosInteractions.size > 0) {
|
|
|
+ val iterator = Constant.sosInteractions.iterator()
|
|
|
+ while (iterator.hasNext()) {
|
|
|
+ val it = iterator.next()
|
|
|
+ Log.e(TAG, "mac: " + it.fromEthIp + ", click mac: " + addr)
|
|
|
+ if (addr.equals(it.fromEthIp, true)) {
|
|
|
+ val tcpModel = OtherUtil.SOSButtonCancel(it.fromDeviceId, it.id)
|
|
|
+ TcpClient.getInstance().sendMsg(tcpModel.toJson())
|
|
|
+
|
|
|
+ iterator.remove()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
//这里实际上是执行了“E”指令
|
|
@@ -2113,6 +2131,14 @@ class MainActivity :BaseActivity<MainActivityPresenter, MainActivityLayoutBindin
|
|
|
val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
nursingMap.set(interactionVO.fromEthIp.toUpperCase(Locale.ROOT), interactionVO.id)
|
|
|
} else {
|
|
|
+ if (tcpModel.action == TcpAction.SideAction.SOS_CALL) {
|
|
|
+ //记录交互id用于取消紧急呼叫
|
|
|
+ if (tcpModel.data != null) {
|
|
|
+ val interactionVO = Gson().fromJson(tcpModel.data.toString(), InteractionVO::class.java)
|
|
|
+ Constant.sosInteractions.add(interactionVO)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//门灯控制
|
|
|
controlDoorLight(tcpModel)
|
|
|
}
|