include the fw version in widget info struct
This commit is contained in:
parent
c12044326f
commit
3ab0c1141c
@ -60,19 +60,23 @@ void DmxWidget::close()
|
||||
QList<WidgetInfo> DmxWidget::availableWidgets()
|
||||
{
|
||||
QList<WidgetInfo> wdgts;
|
||||
// evaluate all system serial ports
|
||||
const auto ports = QSerialPortInfo::availablePorts();
|
||||
for (const QSerialPortInfo &port : ports) {
|
||||
auto widget = new DmxWidget();
|
||||
widget->setPort(port);
|
||||
widget->open();
|
||||
if (widget->isConnected())
|
||||
{
|
||||
WidgetInfo wdgt;
|
||||
wdgt.serialNo = widget->serialNumber();
|
||||
wdgt.port = port;
|
||||
wdgts.push_back(wdgt);
|
||||
}
|
||||
delete widget;
|
||||
// try to open a widget on each port
|
||||
auto widget = new DmxWidget();
|
||||
widget->setPort(port);
|
||||
widget->open();
|
||||
if (widget->isConnected())
|
||||
{
|
||||
// add ports with valid widgets to the list
|
||||
WidgetInfo wdgt;
|
||||
wdgt.serialNo = widget->serialNumber();
|
||||
wdgt.fwVersion = widget->firmwareVersion();
|
||||
wdgt.port = port;
|
||||
wdgts.push_back(wdgt);
|
||||
}
|
||||
delete widget;
|
||||
}
|
||||
return wdgts;
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ using ENTTEC::Pro::DMX_RX_MODE;
|
||||
struct WidgetInfo
|
||||
{
|
||||
uint32_t serialNo;
|
||||
uint16_t fwVersion;
|
||||
QSerialPortInfo port;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user