summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorKarsten Heimrich <karsten.heimrich@qt.io>2018-02-14 22:43:10 +0100
committerKarsten Heimrich <karsten.heimrich@qt.io>2018-02-19 11:44:49 +0000
commit4f8d7c750ff968f7937a6c5978cfb866fb90c514 (patch)
tree329fb511a7c5d842dd9f9d58585052dbad914b6c /examples
parent7acb4c7b9cf3c50f0ecfeb23977c83392bde1fd8 (diff)
Fix broken example after moving to TPDU and LinkLayerFrame
Change-Id: I87b6d93c1c694090d2caa1b2bd26785a3bf3d383 Reviewed-by: Lucie Gerard <lucie.gerard@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/knx/knxeditor/tunneling.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/knx/knxeditor/tunneling.cpp b/examples/knx/knxeditor/tunneling.cpp
index d7d70ed..7bd9f6f 100644
--- a/examples/knx/knxeditor/tunneling.cpp
+++ b/examples/knx/knxeditor/tunneling.cpp
@@ -89,6 +89,8 @@ Tunneling::Tunneling(QWidget* parent)
setupMessageCodeComboBox();
updateAdditionalInfoTypesComboBox();
+ m_frame.setMediumType(QKnx::MediumType::NetIP);
+
connect(ui->connectTunneling, &QPushButton::clicked, this, [&]() {
m_tunnel.setLocalPort(0);
m_tunnel.connectToHost(m_server.controlEndpointAddress(), m_server.controlEndpointPort());
@@ -272,10 +274,11 @@ void Tunneling::updateFrame()
ui->data->setEnabled(true);
tpdu.setApplicationControlField(ui->apci->itemData(ui->apci->currentIndex())
.value<QKnxTpdu::ApplicationControlField>());
- QByteArray dataText = QByteArray::fromHex(ui->data->text().toLatin1());
- QVector<quint8> foo(dataText.size(), 0);
- std::copy(foo.begin(), foo.end(), dataText.begin());
- tpdu.setData(foo);
+
+ auto hex = QByteArray::fromHex(ui->data->text().toLatin1());
+ QVector<quint8> payload(hex.size());
+ std::copy(hex.begin(), hex.end(), payload.begin());
+ tpdu.setData(payload);
} else {
ui->apci->setEnabled(false);
ui->data->setEnabled(false);