|
@@ -31,7 +31,7 @@ SerialTool* SerialTool::getInstance(QObject *parent, bool* success)
|
|
|
if (success) {
|
|
|
*success = true;
|
|
|
}
|
|
|
- globalMutex.unlock();
|
|
|
+// globalMutex.unlock();
|
|
|
return instance;
|
|
|
}
|
|
|
// 打开串口的函数
|
|
@@ -90,11 +90,11 @@ void SerialTool::readData()
|
|
|
QByteArray command = buffer.mid(startIndex + 2, endIndex - startIndex - 2);
|
|
|
emit dataReceived(newData);
|
|
|
// 根据 command 的值发射相应的信号
|
|
|
- if (command == "DISABLE_BUTTON") {
|
|
|
+ if (command == "BUTTON_DISABLED") {
|
|
|
emit disableButtonReceived();
|
|
|
} else if (command == "BUTTON_PRESSED") {
|
|
|
emit buttonPressedReceived();
|
|
|
- } else if (command == "ENABLE_BUTTON") {
|
|
|
+ } else if (command == "BUTTON_ENABLE") {
|
|
|
emit enableButtonReceived();
|
|
|
}
|
|
|
|