Skip to content

Commit 7fa7f0b

Browse files
committed
Added line endings select to sendUDPDatagram
1 parent ac7d6e9 commit 7fa7f0b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/mainwindow.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,19 @@ void MainWindow::sendUDPDatagram(QString message)
10981098
return;
10991099
}
11001100

1101+
if (ui->comboBoxLineEnding->currentIndex() == 1)
1102+
{
1103+
message = message + "\n";
1104+
}
1105+
else if (ui->comboBoxLineEnding->currentIndex() == 2)
1106+
{
1107+
message = message + "\r";
1108+
}
1109+
else if (ui->comboBoxLineEnding->currentIndex() == 3)
1110+
{
1111+
message = message + "\r\n";
1112+
}
1113+
11011114
if (ui->comboBoxUDPSendMode->currentText().contains("Broadcast", Qt::CaseSensitivity::CaseInsensitive))
11021115
{
11031116
networkUDP.write(message, QHostAddress::Broadcast, ui->spinBoxUDPTargetPort->value());
@@ -1320,6 +1333,7 @@ void MainWindow::sendSerial(QString message) // TODO - move to serial - error vi
13201333
{
13211334
message = message + "\r\n";
13221335
}
1336+
13231337
if (!serial.send(message))
13241338
this->addLog("App >>\t Unable to send! Serial port closed !", true);
13251339
}

0 commit comments

Comments
 (0)