From 84f9a5083d19287b957bbc65a7f69d0402c84aca Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 24 Oct 2017 18:27:35 -0400 Subject: [PATCH] Fix sending bug in UDS code --- scriptcontainer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scriptcontainer.cpp b/scriptcontainer.cpp index c225b1d..cf5f285 100644 --- a/scriptcontainer.cpp +++ b/scriptcontainer.cpp @@ -349,9 +349,11 @@ void UDSScriptHelper::sendUDS(QJSValue bus, QJSValue id, QJSValue service, QJSVa if (!data.isArray()) qDebug() << "data isn't an array"; + msg.data.reserve(msg.len); + for (unsigned int i = 0; i < msg.len; i++) { - msg.data[i] = static_cast(data.property(i).toInt()); + msg.data.append(static_cast(data.property(i).toInt())); } msg.bus = (uint32_t)bus.toInt();