|
@@ -354,12 +354,8 @@ void handleMsg(byte* inBytes){
|
|
|
else if (tcpModel.type == TcpType::SOS) {
|
|
|
if (tcpModel.action == SosAction::CANCEL) {
|
|
|
// SOS还原成无灯光的状态
|
|
|
-// std::string heartStr = "ULED,0F";
|
|
|
-// const char* sendMsg = heartStr.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
|
|
|
lightControl("ULED", "0F");
|
|
|
// 进行门灯还原
|
|
|
-// doorLampRestoration();
|
|
|
lightControl("DOORLED", "000F");
|
|
|
mActivityPtr->unregisterUserTimer(SOS_LAMP_TIME_HANDLE);
|
|
|
}
|
|
@@ -385,16 +381,6 @@ void handleMsg(byte* inBytes){
|
|
|
EASYUICONTEXT->goBack();
|
|
|
}
|
|
|
|
|
|
-// std::string color = StoragePreferences::getString(STORE_NURSING_COLOR_RGB, "010");
|
|
|
-// std::string heartStr;
|
|
|
-// if (color != "" && color.size() == 3) {
|
|
|
-// heartStr = "DOORLED," + color + "F";
|
|
|
-// } else {
|
|
|
-// heartStr = "DOORLED,010F";
|
|
|
-// }
|
|
|
-// const char* sendMsg = heartStr.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
|
|
|
-
|
|
|
std::string color = StoragePreferences::getString(STORE_NURSING_COLOR_RGB, "010");
|
|
|
if (color != "" && color.size() == 3) {
|
|
|
color = color + "F";
|
|
@@ -405,16 +391,10 @@ void handleMsg(byte* inBytes){
|
|
|
}
|
|
|
else if (tcpModel.action == SideAction::NURSING_END) {
|
|
|
// 收到nursing_end
|
|
|
-// std::string heartStr = "DOORLED,000F";
|
|
|
-// const char* sendMsg = heartStr.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
|
|
|
lightControl("DOORLED", "000F");
|
|
|
}
|
|
|
else if (tcpModel.action == SideAction::CALL) {
|
|
|
// 收到CALL,需要亮红灯
|
|
|
-// std::string heartStr = "DOORLED,200F"; // 红灯闪烁
|
|
|
-// const char* sendMsg = heartStr.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg), strlen(sendMsg));
|
|
|
|
|
|
lightControl("DOORLED", "200F");
|
|
|
|
|
@@ -439,7 +419,6 @@ void handleMsg(byte* inBytes){
|
|
|
}
|
|
|
}
|
|
|
// 进行门灯还原
|
|
|
-// doorLampRestoration();
|
|
|
lightControl("DOORLED", "000F");
|
|
|
}
|
|
|
else if (tcpModel.action == SideAction::CANCEL) {
|
|
@@ -461,18 +440,12 @@ void handleMsg(byte* inBytes){
|
|
|
}
|
|
|
}
|
|
|
// 进行门灯还原
|
|
|
-// doorLampRestoration();
|
|
|
lightControl("DOORLED", "000F");
|
|
|
|
|
|
}
|
|
|
else if (tcpModel.action == SideAction::SOS_CALL) {
|
|
|
// 收到SOS_CALL,需要亮红灯
|
|
|
- // SOS亮红灯
|
|
|
-// string heartStr = "ULED,1F";
|
|
|
// 门灯亮红灯
|
|
|
-// std::string heartStr2 = "DOORLED,200F";
|
|
|
-// const char* sendMsg2 = heartStr2.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg2), strlen(sendMsg2));
|
|
|
lightControl("DOORLED", "200F");
|
|
|
|
|
|
sosTimerRegistered = false;
|
|
@@ -499,9 +472,31 @@ void handleMsg(byte* inBytes){
|
|
|
}
|
|
|
}
|
|
|
// 进行门灯还原
|
|
|
-// doorLampRestoration();
|
|
|
lightControl("DOORLED", "000F");
|
|
|
}
|
|
|
+ else if (tcpModel.action == SideAction::SHOW) {
|
|
|
+ int deviceId = tcpModel.json["fromDeviceId"].asInt();
|
|
|
+ string fromFrameFullName = tcpModel.json["fromFrameFullName"].asString();
|
|
|
+ string actionType = tcpModel.json["actionType"].asString();
|
|
|
+ if (actionType == TcpType::VOICE) {
|
|
|
+ setPainterInfo(deviceId, 0xFF2F9DF1, fromFrameFullName + " " + LANGUAGEMANAGER->getValue("CallInfo"), "VOICE", "ADD", 60);
|
|
|
+ }
|
|
|
+ else if (actionType == TcpType::SOS) {
|
|
|
+ setPainterInfo(deviceId, 0xFFFF0000, fromFrameFullName + " " + LANGUAGEMANAGER->getValue("SOSCallInfo"), "SOS", "ADD", 120);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ else if (tcpModel.action == SideAction::CLEAR) {
|
|
|
+ int deviceId = tcpModel.json["fromDeviceId"].asInt();
|
|
|
+ string fromFrameFullName = tcpModel.json["fromFrameFullName"].asString();
|
|
|
+ string actionType = tcpModel.json["actionType"].asString();
|
|
|
+ if (actionType == TcpType::VOICE) {
|
|
|
+ setPainterInfo(deviceId, 0xFFFFFFFF, "", "VOICE", "DELETE", 0);
|
|
|
+ }
|
|
|
+ else if (actionType == TcpType::SOS) {
|
|
|
+ setPainterInfo(deviceId, 0xFFFFFFFF, "", "SOS", "DELETE", 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
else if (tcpModel.type == TcpType::CALLBACK) {
|
|
|
if (tcpModel.action == CallbackAction::ACK) {
|
|
@@ -795,6 +790,11 @@ static void onUI_quit() {
|
|
|
*/
|
|
|
static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
LOGD("cmd = %s", data.cmd.c_str());
|
|
|
+ if (getIsUpdate()) {
|
|
|
+ LOGD("处于升级过程中,串口不可使用");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (data.state!=""){
|
|
|
LOGD("state = %s",data.state.c_str());
|
|
|
}
|
|
@@ -889,12 +889,8 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
TcpClient::instance()->sendMsg(req.c_str());
|
|
|
|
|
|
// SOS亮红灯
|
|
|
-// heartStr = "ULED,1F";
|
|
|
lightControl("ULED", "1F");
|
|
|
// 门灯亮红灯
|
|
|
-// std::string heartStr2 = "DOORLED,200F";
|
|
|
-// const char* sendMsg2 = heartStr2.c_str();
|
|
|
-// sendProtocolTo(UART_TTYS2, (byte*)(sendMsg2), strlen(sendMsg2));
|
|
|
lightControl("DOORLED", "200F");
|
|
|
|
|
|
mActivityPtr->registerUserTimer(SOS_CLICK_TIME_HANDLE, 10000); // 10秒后才能触发
|
|
@@ -909,7 +905,6 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
if (isSleep) {
|
|
|
scrrenOn();
|
|
|
}
|
|
|
-// heartStr = "DOORLED,000F";
|
|
|
}
|
|
|
else if (data.cmd == "KEY>") { // key>是面板挂断按钮
|
|
|
if (!StoragePreferences::getInt(STORE_SCREEN_LIGHT, 0)) {
|