check if data can be split
This commit is contained in:
@@ -92,8 +92,10 @@ void SerialController::handleRecv()
|
|||||||
try {
|
try {
|
||||||
qDebug()<<str;
|
qDebug()<<str;
|
||||||
QStringList sl = str.split("|");
|
QStringList sl = str.split("|");
|
||||||
|
if (sl.size() == 2) {
|
||||||
a = sl[0].toInt();
|
a = sl[0].toInt();
|
||||||
d = sl[1].toInt();
|
d = sl[1].toInt();
|
||||||
|
}
|
||||||
qDebug()<<a<<","<<d;
|
qDebug()<<a<<","<<d;
|
||||||
emit sendPos(a, d);
|
emit sendPos(a, d);
|
||||||
} catch(...) {
|
} catch(...) {
|
||||||
|
|||||||
Reference in New Issue
Block a user