forked from vedderb/vesc_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvescinterface.cpp
810 lines (683 loc) · 21.6 KB
/
vescinterface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
/*
Copyright 2016 - 2017 Benjamin Vedder benjamin@vedder.se
This file is part of VESC Tool.
VESC Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
VESC Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "vescinterface.h"
#include <QDebug>
#include <QHostInfo>
#include <QFileInfo>
#include <QThread>
#include <QEventLoop>
#include <utility.h>
#ifdef HAS_SERIALPORT
#include <QSerialPortInfo>
#endif
VescInterface::VescInterface(QObject *parent) : QObject(parent)
{
mMcConfig = new ConfigParams(this);
mAppConfig = new ConfigParams(this);
mInfoConfig = new ConfigParams(this);
mPacket = new Packet(this);
mCommands = new Commands(this);
// Compatible firmwares
mFwVersionReceived = false;
mFwRetries = 0;
mFwPollCnt = 0;
mFwTxt = "x.x";
mIsUploadingFw = false;
mTimer = new QTimer(this);
mTimer->setInterval(20);
mTimer->start();
mLastConnType = CONN_NONE;
mSendCanBefore = false;
mCanIdBefore = 0;
mWasConnected = false;
mAutoconnectOngoing = false;
mAutoconnectProgress = 0.0;
// Serial
#ifdef HAS_SERIALPORT
mSerialPort = new QSerialPort(this);
mLastSerialPort = "";
mLastSerialBaud = 0;
connect(mSerialPort, SIGNAL(readyRead()),
this, SLOT(serialDataAvailable()));
connect(mSerialPort, SIGNAL(error(QSerialPort::SerialPortError)),
this, SLOT(serialPortError(QSerialPort::SerialPortError)));
#endif
// TCP
mTcpSocket = new QTcpSocket(this);
mTcpConnected = false;
mLastTcpServer = "";
mLastTcpPort = 0;
connect(mTcpSocket, SIGNAL(readyRead()), this, SLOT(tcpInputDataAvailable()));
connect(mTcpSocket, SIGNAL(connected()), this, SLOT(tcpInputConnected()));
connect(mTcpSocket, SIGNAL(disconnected()),
this, SLOT(tcpInputDisconnected()));
connect(mTcpSocket, SIGNAL(error(QAbstractSocket::SocketError)),
this, SLOT(tcpInputError(QAbstractSocket::SocketError)));
// BLE
#ifdef HAS_BLUETOOTH
mBleUart = new BleUart(this);
int size = mSettings.beginReadArray("bleNames");
for (int i = 0; i < size; ++i) {
mSettings.setArrayIndex(i);
QString address = mSettings.value("address").toString();
QString name = mSettings.value("name").toString();
mBleNames.insert(address, name);
}
mSettings.endArray();
connect(mBleUart, SIGNAL(dataRx(QByteArray)), this, SLOT(bleDataRx(QByteArray)));
#endif
mCommands->setAppConfig(mAppConfig);
mCommands->setMcConfig(mMcConfig);
// Other signals/slots
connect(mTimer, SIGNAL(timeout()), this, SLOT(timerSlot()));
connect(mPacket, SIGNAL(dataToSend(QByteArray&)),
this, SLOT(packetDataToSend(QByteArray&)));
connect(mPacket, SIGNAL(packetReceived(QByteArray&)),
this, SLOT(packetReceived(QByteArray&)));
connect(mCommands, SIGNAL(dataToSend(QByteArray&)),
this, SLOT(cmdDataToSend(QByteArray&)));
connect(mCommands, SIGNAL(fwVersionReceived(int,int,QString,QByteArray)),
this, SLOT(fwVersionReceived(int,int,QString,QByteArray)));
connect(mCommands, SIGNAL(ackReceived(QString)), this, SLOT(ackReceived(QString)));
connect(mMcConfig, SIGNAL(updated()), this, SLOT(mcconfUpdated()));
connect(mAppConfig, SIGNAL(updated()), this, SLOT(appconfUpdated()));
}
VescInterface::~VescInterface()
{
mSettings.beginWriteArray("bleNames");
QHashIterator<QString, QString> i(mBleNames);
int ind = 0;
while (i.hasNext()) {
i.next();
mSettings.setArrayIndex(ind);
mSettings.setValue("address", i.key());
mSettings.setValue("name", i.value());
ind++;
}
mSettings.endArray();
}
Commands *VescInterface::commands() const
{
return mCommands;
}
ConfigParams *VescInterface::mcConfig()
{
return mMcConfig;
}
ConfigParams *VescInterface::appConfig()
{
return mAppConfig;
}
ConfigParams *VescInterface::infoConfig()
{
return mInfoConfig;
}
QStringList VescInterface::getSupportedFirmwares()
{
QList<QPair<int, int> > fwPairs = getSupportedFirmwarePairs();
QStringList fws;
for (int i = 0;i < fwPairs.size();i++) {
QString tmp;
tmp.sprintf("%d.%d", fwPairs.at(i).first, fwPairs.at(i).second);
fws.append(tmp);
}
return fws;
}
QList<QPair<int, int> > VescInterface::getSupportedFirmwarePairs()
{
QList<QPair<int, int> > fws;
ConfigParam *p = mInfoConfig->getParam("fw_version");
if (p) {
QStringList strs = p->enumNames;
for (int i = 0;i < strs.size();i++) {
QStringList mami = strs.at(i).split(".");
QPair<int, int> fw = qMakePair(mami.at(0).toInt(), mami.at(1).toInt());
fws.append(fw);
}
}
return fws;
}
QString VescInterface::getFirmwareNow()
{
return mFwTxt;
}
void VescInterface::emitStatusMessage(const QString &msg, bool isGood)
{
emit statusMessage(msg, isGood);
}
void VescInterface::emitMessageDialog(const QString &title, const QString &msg, bool isGood, bool richText)
{
emit messageDialog(title, msg, isGood, richText);
}
bool VescInterface::fwRx()
{
return mFwVersionReceived;
}
#ifdef HAS_BLUETOOTH
BleUart *VescInterface::bleDevice()
{
return mBleUart;
}
void VescInterface::storeBleName(QString address, QString name)
{
mBleNames.insert(address, name);
}
QString VescInterface::getBleName(QString address)
{
QString res;
if(mBleNames.contains(address)) {
res = mBleNames[address];
}
return res;
}
#endif
bool VescInterface::isPortConnected()
{
bool res = false;
#ifdef HAS_SERIALPORT
if (mSerialPort->isOpen()) {
res = true;
}
#endif
if (mTcpConnected) {
res = true;
}
#ifdef HAS_BLUETOOTH
if (mBleUart->isConnected()) {
res = true;
}
#endif
return res;
}
void VescInterface::disconnectPort()
{
#ifdef HAS_SERIALPORT
if(mSerialPort->isOpen()) {
mSerialPort->close();
updateFwRx(false);
}
#endif
if (mTcpConnected) {
mTcpSocket->close();
updateFwRx(false);
}
#ifdef HAS_BLUETOOTH
if (mBleUart->isConnected()) {
mBleUart->disconnectBle();
updateFwRx(false);
}
#endif
mFwRetries = 0;
}
bool VescInterface::reconnectLastPort()
{
if (mLastConnType == CONN_SERIAL) {
#ifdef HAS_SERIALPORT
return connectSerial(mLastSerialPort, mLastSerialBaud);
#else
return false;
#endif
} else if (mLastConnType == CONN_TCP) {
connectTcp(mLastTcpServer, mLastTcpPort);
return true;
} else if (mLastConnType == CONN_BLE) {
#ifdef HAS_BLUETOOTH
mBleUart->startConnect(mLastBleAddr);
#endif
return true;
} else {
#ifdef HAS_SERIALPORT
QList<VSerialInfo_t> ports = listSerialPorts();
if (!ports.isEmpty()) {
return connectSerial(ports.first().systemPath);
} else {
emit messageDialog(tr("Reconnect"), tr("No ports found"), false, false);
return false;
}
#else
emit messageDialog(tr("Reconnect"),
tr("Please specify the connection manually "
"the first time you are connecting."),
false, false);
return false;
#endif
}
}
bool VescInterface::autoconnect()
{
bool res = false;
#ifdef HAS_SERIALPORT
QList<VSerialInfo_t> ports = listSerialPorts();
mAutoconnectOngoing = true;
mAutoconnectProgress = 0.0;
disconnectPort();
disconnect(mCommands, SIGNAL(fwVersionReceived(int,int,QString,QByteArray)),
this, SLOT(fwVersionReceived(int,int,QString,QByteArray)));
for (int i = 0;i < ports.size();i++) {
VSerialInfo_t serial = ports[i];
if (!connectSerial(serial.systemPath)) {
continue;
}
QEventLoop loop;
QTimer timeoutTimer;
timeoutTimer.setSingleShot(true);
timeoutTimer.start(500);
connect(mCommands, SIGNAL(fwVersionReceived(int,int,QString,QByteArray)), &loop, SLOT(quit()));
connect(&timeoutTimer, SIGNAL(timeout()), &loop, SLOT(quit()));
loop.exec();
if (timeoutTimer.isActive()) {
// If the timer is still running a firmware version was received.
res = true;
break;
} else {
mAutoconnectProgress = (double)i / (double)ports.size();
emit autoConnectProgressUpdated(mAutoconnectProgress, false);
disconnectPort();
}
}
connect(mCommands, SIGNAL(fwVersionReceived(int,int,QString,QByteArray)),
this, SLOT(fwVersionReceived(int,int,QString,QByteArray)));
#endif
emit autoConnectProgressUpdated(1.0, true);
emit autoConnectFinished();
mAutoconnectOngoing = false;
return res;
}
QString VescInterface::getConnectedPortName()
{
QString res = tr("Not connected");
bool connected = false;
#ifdef HAS_SERIALPORT
if (mSerialPort->isOpen()) {
res = tr("Connected (serial) to %1").arg(mSerialPort->portName());
connected = true;
}
#endif
if (mTcpConnected) {
res = tr("Connected (TCP) to %1:%2").arg(mLastTcpServer).arg(mLastTcpPort);
connected = true;
}
#ifdef HAS_BLUETOOTH
if (mBleUart->isConnected()) {
res = tr("Connected (BLE) to %1").arg(mLastBleAddr);
connected = true;
}
#endif
if (connected && mCommands->isLimitedMode()) {
res += tr(", limited mode");
}
return res;
}
bool VescInterface::connectSerial(QString port, int baudrate)
{
#ifdef HAS_SERIALPORT
mLastSerialPort = port;
mLastSerialBaud = baudrate;
mLastConnType = CONN_SERIAL;
bool found = false;
for (VSerialInfo_t ser: listSerialPorts()) {
if (ser.systemPath == port) {
found = true;
break;
}
}
if (!found) {
emit statusMessage(tr("Invalid serial port: %1").arg(port), false);
return false;
}
if(mSerialPort->isOpen()) {
return true;
}
// TODO: Maybe this test works on other OSes as well
#ifdef Q_OS_UNIX
QFileInfo fi(port);
if (fi.exists()) {
if (!fi.isWritable()) {
emit statusMessage(tr("Serial port is not writable"), false);
emit serialPortNotWritable(port);
return false;
}
}
#endif
mSerialPort->setPortName(port);
mSerialPort->open(QIODevice::ReadWrite);
if(!mSerialPort->isOpen()) {
return false;
}
mSerialPort->setBaudRate(baudrate);
mSerialPort->setDataBits(QSerialPort::Data8);
mSerialPort->setParity(QSerialPort::NoParity);
mSerialPort->setStopBits(QSerialPort::OneStop);
mSerialPort->setFlowControl(QSerialPort::NoFlowControl);
// For nrf
mSerialPort->setRequestToSend(true);
mSerialPort->setDataTerminalReady(true);
QThread::msleep(5);
mSerialPort->setDataTerminalReady(false);
QThread::msleep(100);
return true;
#else
(void)port;
(void)baudrate;
emit messageDialog(tr("Connect serial"),
tr("Serial port support is not enabled in this build "
"of VESC Tool."),
false, false);
return false;
#endif
}
QList<VSerialInfo_t> VescInterface::listSerialPorts()
{
QList<VSerialInfo_t> res;
#ifdef HAS_SERIALPORT
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
foreach(const QSerialPortInfo &port, ports) {
VSerialInfo_t info;
info.name = port.portName();
info.systemPath = port.systemLocation();
int index = res.size();
if(port.manufacturer().startsWith("STMicroelectronics")) {
info.name.insert(0, "VESC - ");
info.isVesc = true;
index = 0;
} else {
info.isVesc = false;
}
res.insert(index, info);
}
#endif
return res;
}
void VescInterface::connectTcp(QString server, int port)
{
mLastTcpServer = server;
mLastTcpPort = port;
mLastConnType = CONN_TCP;
QHostAddress host;
host.setAddress(server);
// Try DNS lookup
if (host.isNull()) {
QList<QHostAddress> addresses = QHostInfo::fromName(server).addresses();
if (!addresses.isEmpty()) {
host.setAddress(addresses.first().toString());
}
}
mTcpSocket->abort();
mTcpSocket->connectToHost(host, port);
}
void VescInterface::connectBle(QString address)
{
#ifdef HAS_BLUETOOTH
mBleUart->startConnect(address);
mLastConnType = CONN_BLE;
mLastBleAddr = address;
#else
(void)address;
#endif
}
bool VescInterface::isAutoconnectOngoing() const
{
return mAutoconnectOngoing;
}
double VescInterface::getAutoconnectProgress() const
{
return mAutoconnectProgress;
}
#ifdef HAS_SERIALPORT
void VescInterface::serialDataAvailable()
{
while (mSerialPort->bytesAvailable() > 0) {
mPacket->processData(mSerialPort->readAll());
}
}
void VescInterface::serialPortError(QSerialPort::SerialPortError error)
{
QString message;
switch (error) {
case QSerialPort::NoError:
break;
default:
message = "Serial port error: " + mSerialPort->errorString();
break;
}
if(!message.isEmpty()) {
emit statusMessage(message, false);
if (mSerialPort->isOpen()) {
mSerialPort->close();
}
updateFwRx(false);
}
}
#endif
void VescInterface::tcpInputConnected()
{
mTcpConnected = true;
updateFwRx(false);
}
void VescInterface::tcpInputDisconnected()
{
mTcpConnected = false;
updateFwRx(false);
}
void VescInterface::tcpInputDataAvailable()
{
while (mTcpSocket->bytesAvailable() > 0) {
mPacket->processData(mTcpSocket->readAll());
}
}
void VescInterface::tcpInputError(QAbstractSocket::SocketError socketError)
{
(void)socketError;
QString errorStr = mTcpSocket->errorString();
emit statusMessage(tr("TCP Error") + errorStr, false);
mTcpSocket->close();
updateFwRx(false);
}
#ifdef HAS_BLUETOOTH
void VescInterface::bleDataRx(QByteArray data)
{
mPacket->processData(data);
}
#endif
void VescInterface::timerSlot()
{
// Poll the serial port as well since readyRead is not emitted recursively. This
// can be a problem when waiting for input with an additional event loop, such as
// when using QMessageBox.
#ifdef HAS_SERIALPORT
serialDataAvailable();
#endif
if (isPortConnected()) {
if (mSendCanBefore != mCommands->getSendCan() ||
mCanIdBefore != mCommands->getCanSendId()) {
updateFwRx(false);
mFwRetries = 0;
}
mFwPollCnt++;
if (mFwPollCnt >= 4) {
mFwPollCnt = 0;
if (!mFwVersionReceived) {
mCommands->getFwVersion();
mFwRetries++;
// Timeout if the firmware cannot be read
if (mFwRetries >= 25) {
emit statusMessage(tr("No firmware read response"), false);
emit messageDialog(tr("Read Firmware Version"),
tr("Could not read firmware version. Make sure "
"that selected port really belongs to the VESC. "),
false, false);
disconnectPort();
}
}
}
} else {
updateFwRx(false);
mFwRetries = 0;
}
mSendCanBefore = mCommands->getSendCan();
mCanIdBefore = mCommands->getCanSendId();
// Update fw upload bar and label
double fwProg = mCommands->getFirmwareUploadProgress();
QString fwStatus = mCommands->getFirmwareUploadStatus();
if (fwProg > -0.1) {
mIsUploadingFw = true;
emit fwUploadStatus(fwStatus, fwProg, true);
} else {
// If the firmware upload just finished or failed
if (mIsUploadingFw) {
updateFwRx(false);
mFwRetries = 0;
if (fwStatus.compare("FW Upload Done") == 0) {
emit fwUploadStatus(fwStatus, 1.0, false);
} else {
emit fwUploadStatus(fwStatus, 0.0, false);
}
}
mIsUploadingFw = false;
}
if (mWasConnected != isPortConnected()) {
mWasConnected = isPortConnected();
emit portConnectedChanged();
}
}
void VescInterface::packetDataToSend(QByteArray &data)
{
#ifdef HAS_SERIALPORT
if (mSerialPort->isOpen()) {
mSerialPort->write(data);
}
#endif
if (mTcpConnected && mTcpSocket->isOpen()) {
mTcpSocket->write(data);
}
#ifdef HAS_BLUETOOTH
if (mBleUart->isConnected()) {
mBleUart->writeData(data);
}
#endif
}
void VescInterface::packetReceived(QByteArray &data)
{
mCommands->processPacket(data);
}
void VescInterface::cmdDataToSend(QByteArray &data)
{
mPacket->sendPacket(data);
}
void VescInterface::fwVersionReceived(int major, int minor, QString hw, QByteArray uuid)
{
QList<QPair<int, int> > fwPairs = getSupportedFirmwarePairs();
QString strUuid = Utility::uuid2Str(uuid, true);
if (fwPairs.isEmpty()) {
emit messageDialog(tr("No Supported Firmwares"),
tr("This version of VESC Tool does not seem to have any supported "
"firmwares. Something is probably wrong with the motor configuration "
"file."),
false, false);
updateFwRx(false);
mFwRetries = 0;
disconnectPort();
return;
}
QPair<int, int> highest_supported = *std::max_element(fwPairs.begin(), fwPairs.end());
QPair<int, int> fw_connected = qMakePair(major, minor);
bool wasReceived = mFwVersionReceived;
mCommands->setLimitedMode(false);
if (major < 0) {
updateFwRx(false);
mFwRetries = 0;
disconnectPort();
emit messageDialog(tr("Error"), tr("The firmware on the connected VESC is too old. Please"
" update it using a programmer."), false, false);
} else if (fw_connected > highest_supported) {
mCommands->setLimitedMode(true);
updateFwRx(true);
if (!wasReceived) {
emit messageDialog(tr("Warning"), tr("The connected VESC has newer firmware than this version of"
" VESC Tool supports. It is recommended that you update VESC "
" Tool to the latest version. Alternatively, the firmware on"
" the connected VESC can be downgraded in the firmware page."
" Until then, limited communication mode will be used where"
" only the firmware can be changed."), false, false);
}
} else if (!fwPairs.contains(fw_connected)) {
if (fw_connected >= qMakePair(1, 1)) {
mCommands->setLimitedMode(true);
updateFwRx(true);
if (!wasReceived) {
emit messageDialog(tr("Warning"), tr("The connected VESC has too old firmware. Since the"
" connected VESC has firmware with bootloader support, it can be"
" updated from the Firmware page."
" Until then, limited communication mode will be used where only the"
" firmware can be changed."), false, false);
}
} else {
updateFwRx(false);
mFwRetries = 0;
disconnectPort();
if (!wasReceived) {
emit messageDialog(tr("Error"), tr("The firmware on the connected VESC is too old. Please"
" update it using a programmer."), false, false);
}
}
} else {
updateFwRx(true);
if (fw_connected < highest_supported) {
if (!wasReceived) {
emit messageDialog(tr("Warning"), tr("The connected VESC has compatible, but old"
" firmware. It is recommended that you update it."), false, false);
}
}
QString fwStr;
fwStr.sprintf("VESC Firmware Version %d.%d", major, minor);
if (!hw.isEmpty()) {
fwStr += ", Hardware: " + hw;
}
if (!strUuid.isEmpty()) {
fwStr += ", UUID: " + strUuid;
}
emit statusMessage(fwStr, true);
}
if (major >= 0) {
mFwTxt.sprintf("Fw: %d.%d", major, minor);
mHwTxt = hw;
if (!hw.isEmpty()) {
mFwTxt += ", Hw: " + hw;
}
if (!strUuid.isEmpty()) {
mFwTxt += "\n" + strUuid;
}
}
}
void VescInterface::appconfUpdated()
{
emit statusMessage(tr("App configuration updated"), true);
}
void VescInterface::mcconfUpdated()
{
emit statusMessage(tr("MC configuration updated"), true);
}
void VescInterface::ackReceived(QString ackType)
{
emit statusMessage(ackType, true);
}
void VescInterface::updateFwRx(bool fwRx)
{
bool change = mFwVersionReceived != fwRx;
mFwVersionReceived = fwRx;
if (change) {
emit fwRxChanged(mFwVersionReceived, mCommands->isLimitedMode());
}
}