Fix sending bug in UDS code

This commit is contained in:
Collin Kidder
2017-10-24 18:27:35 -04:00
parent 39d0173d64
commit 84f9a5083d
+3 -1
View File
@@ -349,9 +349,11 @@ void UDSScriptHelper::sendUDS(QJSValue bus, QJSValue id, QJSValue service, QJSVa
if (!data.isArray()) qDebug() << "data isn't an array"; if (!data.isArray()) qDebug() << "data isn't an array";
msg.data.reserve(msg.len);
for (unsigned int i = 0; i < msg.len; i++) for (unsigned int i = 0; i < msg.len; i++)
{ {
msg.data[i] = static_cast<uint8_t>(data.property(i).toInt()); msg.data.append(static_cast<uint8_t>(data.property(i).toInt()));
} }
msg.bus = (uint32_t)bus.toInt(); msg.bus = (uint32_t)bus.toInt();