Skip to content

Commit b3963b3

Browse files
committed
Convert QVector<double> to QByteArray
1 parent 5e7c59c commit b3963b3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

logger.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,13 @@ void Logger::updateWaveValue(const QLowEnergyCharacteristic &info, const QByteAr
303303
// qInfo() << qChart->plotArea().width();
304304
// qChart->scroll(x, 0);
305305

306+
// Converts QVector<double> to QByteArray
307+
QByteArray line;
308+
QDataStream stream(&line, QIODevice::WriteOnly);
309+
stream << realValues;
310+
306311
if (doStream) {
307-
udpSocket->writeDatagram(reinterpret_cast<const char *>(realValues.constData()), realValues.size(), QHostAddress::Broadcast, 4545);
312+
udpSocket->writeDatagram(line, QHostAddress::Broadcast, 45454);
308313
}
309314
}
310315

0 commit comments

Comments
 (0)