|
@@ -626,7 +626,7 @@ void handleHCall(int id) {
|
|
|
}
|
|
|
else {
|
|
|
string errorMsg = LANGUAGEMANAGER->getValue("HandleError") +
|
|
|
- StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0") + ":h" + to_string(id) +
|
|
|
+ StoragePreferences::getString(STORE_MAC_ADDR, "0.0.0.0") + ":h" + to_string(id) + " \n" +
|
|
|
LANGUAGEMANAGER->getValue("NotAdd");
|
|
|
Intent* intent = new Intent();
|
|
|
intent->putExtra(functionWindows, "warn");
|
|
@@ -938,6 +938,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerHandle) {
|
|
|
isTriggerHandle = false;
|
|
|
+ isConnectHandle = true;
|
|
|
|
|
|
voip::CallInfo info = GetTelephone()->GetCallInfo();
|
|
|
//拨打 或 挂断
|
|
@@ -955,10 +956,10 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
isConnectHandle = true;
|
|
|
}
|
|
|
else if (data.state == "4") {
|
|
|
- if (!isConnectHandle) {
|
|
|
+ if (!isConnectHandle || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
return;
|
|
|
}
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("HandleDisconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("HandleDisconnected"));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -981,6 +982,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
}
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerSos) {
|
|
|
+ isConnectSos = true;
|
|
|
sendSosCall("");
|
|
|
|
|
|
// SOS亮红灯
|
|
@@ -999,11 +1001,11 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
isConnectSos = true;
|
|
|
}
|
|
|
else if (data.state == "4") {
|
|
|
- if (!isConnectSos) {
|
|
|
+ if (!isConnectSos || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("SosDisconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("SosDisconnected"));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -1052,6 +1054,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerHandle1) {
|
|
|
isTriggerHandle1 = false;
|
|
|
+ isConnectHandle1 = true;
|
|
|
|
|
|
handleHCall(1);
|
|
|
}
|
|
@@ -1061,10 +1064,10 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
isConnectHandle1 = true;
|
|
|
}
|
|
|
else if (data.state == "4") {
|
|
|
- if (!isConnectHandle1) {
|
|
|
+ if (!isConnectHandle1 || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
return;
|
|
|
}
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("Handle1Disconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("Handle1Disconnected"));
|
|
|
}
|
|
|
}
|
|
|
else if (data.cmd == "HANDKEY10") {
|
|
@@ -1079,6 +1082,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerHandle2) {
|
|
|
isTriggerHandle2 = false;
|
|
|
+ isConnectHandle2 = true;
|
|
|
|
|
|
handleHCall(2);
|
|
|
}
|
|
@@ -1087,11 +1091,11 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
LOGD("手柄2在线");
|
|
|
isConnectHandle2 = true;
|
|
|
}
|
|
|
- else if (data.state == "4") {
|
|
|
+ else if (data.state == "4" || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
if (!isConnectHandle2) {
|
|
|
return;
|
|
|
}
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("Handle2Disconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("Handle2Disconnected"));
|
|
|
}
|
|
|
}
|
|
|
else if (data.cmd == "HANDKEY20") {
|
|
@@ -1106,6 +1110,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerHandle3) {
|
|
|
isTriggerHandle3 = false;
|
|
|
+ isConnectHandle3 = true;
|
|
|
|
|
|
handleHCall(3);
|
|
|
}
|
|
@@ -1114,11 +1119,11 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
LOGD("手柄3在线");
|
|
|
isConnectHandle3 = true;
|
|
|
}
|
|
|
- else if (data.state == "4") {
|
|
|
+ else if (data.state == "4" || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
if (!isConnectHandle3) {
|
|
|
return;
|
|
|
}
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("Handle3Disconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("Handle3Disconnected"));
|
|
|
}
|
|
|
}
|
|
|
else if (data.cmd == "HANDKEY30") {
|
|
@@ -1133,6 +1138,7 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
else if (data.state == "1") {
|
|
|
if (isTriggerHandle4) {
|
|
|
isTriggerHandle4 = false;
|
|
|
+ isConnectHandle4 = true;
|
|
|
|
|
|
handleHCall(4);
|
|
|
}
|
|
@@ -1141,11 +1147,11 @@ static void onProtocolDataUpdate(const SProtocolData &data) {
|
|
|
LOGD("手柄4在线");
|
|
|
isConnectHandle4 = true;
|
|
|
}
|
|
|
- else if (data.state == "4") {
|
|
|
+ else if (data.state == "4" || StoragePreferences::getInt(STORE_DEVICE_ID, 0) == 0) {
|
|
|
if (!isConnectHandle4) {
|
|
|
return;
|
|
|
}
|
|
|
- sosCall(LANGUAGEMANAGER->getValue("Handle4Disconnected"));
|
|
|
+ sendDataRemindOhter(getFrameFullName() + " " + LANGUAGEMANAGER->getValue("Handle4Disconnected"));
|
|
|
}
|
|
|
}
|
|
|
else {
|