Changed a lot of pointer references to const (it's more correct and
fixes a weird problem), fixed a problem with JSON to DBC, a few other fixes
This commit is contained in:
@@ -59,12 +59,13 @@ void ISOTP_HANDLER::sendISOTPFrame(int bus, int ID, QByteArray data)
|
||||
lastSenderID = ID;
|
||||
lastSenderBus = bus;
|
||||
|
||||
frame.bus = bus;
|
||||
frame.setFrameId(ID);
|
||||
if (ID > 0x7FF) frame.setExtendedFrameFormat(true);
|
||||
else frame.setExtendedFrameFormat(false);
|
||||
|
||||
if (data.length() < 8)
|
||||
{
|
||||
frame.bus = bus;
|
||||
frame.setFrameId(ID);
|
||||
if (ID > 0x7FF) frame.setExtendedFrameFormat(true);
|
||||
else frame.setExtendedFrameFormat(false);
|
||||
QByteArray bytes(8,0);
|
||||
bytes.resize(8);
|
||||
bytes[0] = data.length();
|
||||
@@ -74,10 +75,6 @@ void ISOTP_HANDLER::sendISOTPFrame(int bus, int ID, QByteArray data)
|
||||
}
|
||||
else //need to send a multi-part ISO_TP message - Respects timing and frame number based flow control
|
||||
{
|
||||
frame.bus = bus;
|
||||
frame.setFrameId(ID);
|
||||
if (ID > 0x7FF) frame.setExtendedFrameFormat(true);
|
||||
else frame.setExtendedFrameFormat(false);
|
||||
QByteArray bytes(8, 0);
|
||||
bytes[0] = 0x10 + (data.length() / 256);
|
||||
bytes[1] = data.length() & 0xFF;
|
||||
@@ -159,7 +156,7 @@ void ISOTP_HANDLER::processFrame(const CANFrame &frame)
|
||||
//int offset;
|
||||
ISOTP_MESSAGE msg;
|
||||
ISOTP_MESSAGE *pMsg;
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(frame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(frame.payload().constData());
|
||||
//int dataLen = frame.payload().count();
|
||||
|
||||
frameType = 0;
|
||||
|
||||
@@ -177,7 +177,7 @@ UDS_HANDLER::~UDS_HANDLER()
|
||||
void UDS_HANDLER::gotISOTPFrame(ISOTP_MESSAGE msg)
|
||||
{
|
||||
qDebug() << "UDS handler got ISOTP frame";
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg.payload().constData());
|
||||
int dataLen = msg.payload().count();
|
||||
UDS_MESSAGE udsMsg;
|
||||
udsMsg.bus = msg.bus;
|
||||
@@ -258,6 +258,8 @@ void UDS_HANDLER::sendUDSFrame(const UDS_MESSAGE &msg)
|
||||
data.append(msg.payload());
|
||||
isoHandler->sendISOTPFrame(msg.bus, msg.frameId(), data);
|
||||
|
||||
//qDebug() << "Data sending: " << data;
|
||||
|
||||
qDebug() << "Sent UDS service: " << getServiceShortDesc(msg.service) << " on bus " << msg.bus;
|
||||
}
|
||||
|
||||
@@ -327,7 +329,7 @@ QString UDS_HANDLER::getDetailedMessageAnalysis(const UDS_MESSAGE &msg)
|
||||
bool isResponse = true;
|
||||
int dataSize;
|
||||
int addrSize;
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg.payload().constData());
|
||||
int dataLen = msg.payload().length();
|
||||
|
||||
if (msg.isErrorReply)
|
||||
|
||||
+2
-1
@@ -360,7 +360,7 @@ QVariant CANFrameModel::data(const QModelIndex &index, int role) const
|
||||
|
||||
thisFrame = filteredFrames.at(index.row());
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(thisFrame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(thisFrame.payload().constData());
|
||||
int dataLen = thisFrame.payload().count();
|
||||
|
||||
if (role == Qt::BackgroundColorRole)
|
||||
@@ -551,6 +551,7 @@ void CANFrameModel::addFrame(const CANFrame& frame, bool autoRefresh = false)
|
||||
mutex.lock();
|
||||
CANFrame tempFrame;
|
||||
tempFrame = frame;
|
||||
|
||||
tempFrame.setTimeStamp(QCanBusFrame::TimeStamp(0, tempFrame.timeStamp().microSeconds() - timeOffset));
|
||||
|
||||
lastUpdateNumFrames++;
|
||||
|
||||
@@ -77,6 +77,12 @@ public:
|
||||
*/
|
||||
CANCon::status getStatus();
|
||||
|
||||
/**
|
||||
* @brief setConsoleOutput
|
||||
* @param state - set whether to send debugging info to the console or not
|
||||
*/
|
||||
void setConsoleOutput(bool state);
|
||||
|
||||
|
||||
signals:
|
||||
/*not implemented yet */
|
||||
@@ -194,6 +200,7 @@ public slots:
|
||||
protected:
|
||||
int mNumBuses; //protected to allow connected device to figure out how many buses are available
|
||||
QVector<BusData> mBusData;
|
||||
bool mConsoleOutput; //send debugging info to the console?
|
||||
|
||||
//determine if the passed frame is part of a filter or not.
|
||||
void checkTargettedFrame(CANFrame &frame);
|
||||
|
||||
@@ -119,6 +119,8 @@ bool SerialBusConnection::piSendFrame(const CANFrame& pFrame)
|
||||
return false;
|
||||
if (!mDev_p) return false;
|
||||
|
||||
qDebug() << "Data bytes at lowlevel: " << pFrame.payload().toBase64();
|
||||
|
||||
return mDev_p->writeFrame(pFrame);
|
||||
}
|
||||
|
||||
@@ -179,7 +181,7 @@ void SerialBusConnection::framesReceived()
|
||||
continue;
|
||||
|
||||
/* check frame */
|
||||
if (recFrame.payload().length() <= 8) {
|
||||
//if (recFrame.payload().length() <= 8) {
|
||||
CANFrame* frame_p = getQueue().get();
|
||||
if(frame_p) {
|
||||
frame_p->setPayload(recFrame.payload());
|
||||
@@ -241,7 +243,7 @@ void SerialBusConnection::framesReceived()
|
||||
|
||||
/* enqueue frame */
|
||||
getQueue().queue();
|
||||
}
|
||||
//}
|
||||
#if 0
|
||||
else
|
||||
qDebug() << "can't get a frame, ERROR";
|
||||
|
||||
+1
-1
@@ -1556,7 +1556,7 @@ DBCFile* DBCHandler::loadJSONFile(int idx)
|
||||
{
|
||||
qDebug() << iter.key();
|
||||
DBC_MESSAGE msg;
|
||||
msg.ID = static_cast<uint32_t>(iter->toObject().find("origin_id").value().toInt());
|
||||
msg.ID = static_cast<uint32_t>(iter->toObject().find("message_id").value().toInt());
|
||||
msg.name = QString(iter.key().toUtf8());
|
||||
msg.len = static_cast<unsigned int>(iter->toObject().find("length_bytes").value().toInt());
|
||||
msg.sender = thisFile->findNodeByIdx(0);
|
||||
|
||||
@@ -77,7 +77,7 @@ void FirmwareUploaderWindow::updatedFrames(int numFrames)
|
||||
|
||||
void FirmwareUploaderWindow::gotTargettedFrame(CANFrame frame)
|
||||
{
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(frame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(frame.payload().constData());
|
||||
int dataLen = frame.payload().count();
|
||||
|
||||
qDebug() << "FUW: Got targetted frame with id " << frame.frameId();
|
||||
|
||||
+25
-25
@@ -947,7 +947,7 @@ bool FrameFileIO::saveCRTDFile(QString filename, const QVector<CANFrame>* frames
|
||||
QFile *outFile = new QFile(filename);
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -971,7 +971,7 @@ bool FrameFileIO::saveCRTDFile(QString filename, const QVector<CANFrame>* frames
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
outFile->write(QString::number(frame->timeStamp().microSeconds() / 1000000.0, 'f', 6).toUtf8());
|
||||
@@ -1346,7 +1346,7 @@ bool FrameFileIO::saveCanalyzerASC(QString filename, const QVector<CANFrame>* fr
|
||||
int lineCounter = 0;
|
||||
int64_t offsetTime = frames->at(0).timeStamp().microSeconds();
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -1383,7 +1383,7 @@ bool FrameFileIO::saveCanalyzerASC(QString filename, const QVector<CANFrame>* fr
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
uint64_t timeStamp = (frame->timeStamp().microSeconds() - offsetTime) / 1000000ull;
|
||||
@@ -1614,7 +1614,7 @@ bool FrameFileIO::saveNativeCSVFile(QString filename, const QVector<CANFrame>* f
|
||||
QFile *outFile = new QFile(filename);
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -1637,7 +1637,7 @@ bool FrameFileIO::saveNativeCSVFile(QString filename, const QVector<CANFrame>* f
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
outFile->write(QString::number(frame->timeStamp().microSeconds()).toUtf8());
|
||||
@@ -1720,7 +1720,7 @@ bool FrameFileIO::closeContinuousNative()
|
||||
bool FrameFileIO::writeContinuousNative(const QVector<CANFrame>* frames, int beginningFrame)
|
||||
{
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -1729,7 +1729,7 @@ bool FrameFileIO::writeContinuousNative(const QVector<CANFrame>* frames, int beg
|
||||
for (int c = beginningFrame; c < frames->count(); c++)
|
||||
{
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
continuousFile.write(QString::number(frame->timeStamp().microSeconds()).toUtf8());
|
||||
@@ -1880,7 +1880,7 @@ bool FrameFileIO::saveGenericCSVFile(QString filename, const QVector<CANFrame>*
|
||||
QFile *outFile = new QFile(filename);
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -1903,7 +1903,7 @@ bool FrameFileIO::saveGenericCSVFile(QString filename, const QVector<CANFrame>*
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
outFile->write(QString::number(frame->frameId(), 16).toUpper().rightJustified(8, '0').toUtf8());
|
||||
@@ -2086,7 +2086,7 @@ bool FrameFileIO::saveLogFile(QString filename, const QVector<CANFrame>* frames)
|
||||
QDateTime timestamp, tempStamp;
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2124,7 +2124,7 @@ bool FrameFileIO::saveLogFile(QString filename, const QVector<CANFrame>* frames)
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
tempStamp = QDateTime::fromMSecsSinceEpoch(frame->timeStamp().microSeconds() / 1000);
|
||||
@@ -2282,7 +2282,7 @@ bool FrameFileIO::saveIXXATFile(QString filename, const QVector<CANFrame>* frame
|
||||
QDateTime timestamp, tempStamp;
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2313,7 +2313,7 @@ bool FrameFileIO::saveIXXATFile(QString filename, const QVector<CANFrame>* frame
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
tempStamp = QDateTime::fromMSecsSinceEpoch(frame->timeStamp().microSeconds() / 1000);
|
||||
@@ -2418,7 +2418,7 @@ bool FrameFileIO::loadCANDOFile(QString filename, QVector<CANFrame>* frames)
|
||||
}
|
||||
|
||||
data = inFile->read(12);
|
||||
unsigned char *uData = reinterpret_cast<unsigned char *>(data.data());
|
||||
const unsigned char *uData = reinterpret_cast<const unsigned char *>(data.constData());
|
||||
|
||||
thisFrame.bus = 0;
|
||||
thisFrame.isReceived = true;
|
||||
@@ -2460,7 +2460,7 @@ bool FrameFileIO::saveCANDOFile(QString filename, const QVector<CANFrame>* frame
|
||||
int id;
|
||||
qint64 ms;
|
||||
|
||||
unsigned char *inData;
|
||||
const unsigned char *inData;
|
||||
int inDataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2492,7 +2492,7 @@ bool FrameFileIO::saveCANDOFile(QString filename, const QVector<CANFrame>* frame
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
inData = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
inData = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
inDataLen = frame->payload().count();
|
||||
|
||||
for (int j = 0; j < 8; j++) data[4 + j] = (char)0xFF;
|
||||
@@ -2660,7 +2660,7 @@ bool FrameFileIO::saveMicrochipFile(QString filename, const QVector<CANFrame>* f
|
||||
QDateTime timestamp, tempStamp;
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2691,7 +2691,7 @@ bool FrameFileIO::saveMicrochipFile(QString filename, const QVector<CANFrame>* f
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
outFile->write(QString::number((frame->timeStamp().microSeconds() / 1000)).toUtf8());
|
||||
@@ -2875,7 +2875,7 @@ bool FrameFileIO::saveTraceFile(QString filename, const QVector<CANFrame> * fram
|
||||
int64_t tempTime;
|
||||
int tempTimePiece;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2918,7 +2918,7 @@ bool FrameFileIO::saveTraceFile(QString filename, const QVector<CANFrame> * fram
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
//1F D3 3F FF 08 FF E0 CB
|
||||
@@ -2970,7 +2970,7 @@ bool FrameFileIO::saveCanDumpFile(QString filename, const QVector<CANFrame> * fr
|
||||
int lineCounter = 0;
|
||||
double tempTime;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -2991,7 +2991,7 @@ bool FrameFileIO::saveCanDumpFile(QString filename, const QVector<CANFrame> * fr
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
outFile->write("(");
|
||||
@@ -3599,7 +3599,7 @@ bool FrameFileIO::saveCabanaFile(QString filename, const QVector<CANFrame>* fram
|
||||
QFile *outFile = new QFile(filename);
|
||||
int lineCounter = 0;
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -3622,7 +3622,7 @@ bool FrameFileIO::saveCabanaFile(QString filename, const QVector<CANFrame>* fram
|
||||
}
|
||||
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
double tempTimeStamp = frame->timeStamp().microSeconds();
|
||||
|
||||
@@ -792,7 +792,7 @@ void FrameSenderWindow::updateGridRow(int idx)
|
||||
int gridLine = idx;
|
||||
QString dataString;
|
||||
QTableWidgetItem *item = ui->tableSender->item(gridLine, 9);
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(temp->payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(temp->payload().constData());
|
||||
int dataLen = temp->payload().length();
|
||||
|
||||
if (item == nullptr) item = new QTableWidgetItem();
|
||||
|
||||
+2
-2
@@ -729,7 +729,7 @@ void MainWindow::saveDecodedTextFile(QString filename)
|
||||
QFile *outFile = new QFile(filename);
|
||||
const QVector<CANFrame> *frames = model->getFilteredListReference();
|
||||
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -743,7 +743,7 @@ Data Bytes: 88 10 00 13 BB 00 06 00
|
||||
for (int c = 0; c < frames->count(); c++)
|
||||
{
|
||||
frame = &frames->at(c);
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().count();
|
||||
|
||||
QString builderString;
|
||||
|
||||
@@ -123,7 +123,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
QTreeWidgetItem *interestedOnlyBase, *referenceOnlyBase = nullptr, *sharedBase, *bitmapBaseInterested, *bitmapBaseReference = nullptr;
|
||||
QTreeWidgetItem *valuesBase, *detail, *sharedItem, *valuesInterested, *valuesReference = nullptr;
|
||||
uint64_t tmp;
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen;
|
||||
|
||||
bool uniqueInterested = ui->ckUniqueToInterested->isChecked();
|
||||
@@ -154,7 +154,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
for (int x = 0; x < interestedFrames.count(); x++)
|
||||
{
|
||||
CANFrame frame = interestedFrames.at(x);
|
||||
data = reinterpret_cast<unsigned char *>(frame.payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame.payload().constData());
|
||||
dataLen = frame.payload().count();
|
||||
|
||||
if (interestedIDs.contains(frame.frameId())) //if we saw this ID before then add to the QList in there
|
||||
@@ -201,7 +201,7 @@ void FileComparatorWindow::calculateDetails()
|
||||
for (int x = 0; x < referenceFrames.count(); x++)
|
||||
{
|
||||
CANFrame frame = referenceFrames.at(x);
|
||||
data = reinterpret_cast<unsigned char *>(frame.payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame.payload().constData());
|
||||
dataLen = frame.payload().count();
|
||||
|
||||
if (referenceIDs.contains(frame.frameId())) //if we saw this ID before then add to the QList in there
|
||||
|
||||
@@ -397,7 +397,7 @@ void FlowViewWindow::updatedFrames(int numFrames)
|
||||
{
|
||||
QVector<double>newX[8];
|
||||
QVector<double>newY[8];
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen = 0;
|
||||
|
||||
const CANFrame *thisFrame;
|
||||
@@ -436,7 +436,7 @@ void FlowViewWindow::updatedFrames(int numFrames)
|
||||
for (int i = modelFrames->count() - numFrames; i < modelFrames->count(); i++)
|
||||
{
|
||||
thisFrame = &modelFrames->at(i);
|
||||
data = reinterpret_cast<unsigned char *>(thisFrame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(thisFrame->payload().constData());
|
||||
dataLen = thisFrame->payload().length();
|
||||
|
||||
if (!foundID.contains(thisFrame->frameId()))
|
||||
@@ -502,7 +502,7 @@ void FlowViewWindow::createGraph(int byteNum)
|
||||
{
|
||||
int tempVal;
|
||||
float minval=1000000, maxval = -100000;
|
||||
unsigned char *data;
|
||||
const unsigned char *data;
|
||||
int dataLen = 0;
|
||||
const CANFrame *frame;
|
||||
|
||||
@@ -520,7 +520,7 @@ void FlowViewWindow::createGraph(int byteNum)
|
||||
for (int j = 0; j < numEntries; j++)
|
||||
{
|
||||
frame = &frameCache[j];
|
||||
data = reinterpret_cast<unsigned char *>(frame->payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frame->payload().constData());
|
||||
dataLen = frame->payload().length();
|
||||
|
||||
tempVal = data[byteNum];
|
||||
|
||||
@@ -278,7 +278,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
if (thisFrame.frameId() == static_cast<uint32_t>(targettedID)) frameCache.append(thisFrame);
|
||||
}
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(frameCache.at(0).payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(frameCache.at(0).payload().constData());
|
||||
int dataLen = frameCache.at(0).payload().length();
|
||||
|
||||
ui->treeDetails->clear();
|
||||
@@ -367,7 +367,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
}
|
||||
for (int j = 0; j < 64; j++) bitfieldHistogram[j] = 0;
|
||||
|
||||
data = reinterpret_cast<unsigned char *>(frameCache.at(0).payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frameCache.at(0).payload().constData());
|
||||
dataLen = frameCache.at(0).payload().length();
|
||||
|
||||
for (int c = 0; c < dataLen; c++)
|
||||
@@ -383,7 +383,7 @@ void FrameInfoWindow::updateDetailsWindow(QString newID)
|
||||
//then find all data points
|
||||
for (int j = 0; j < frameCache.count(); j++)
|
||||
{
|
||||
data = reinterpret_cast<unsigned char *>(frameCache.at(j).payload().data());
|
||||
data = reinterpret_cast<const unsigned char *>(frameCache.at(j).payload().constData());
|
||||
dataLen = frameCache.at(j).payload().length();
|
||||
|
||||
byteGraphX.append(j);
|
||||
|
||||
@@ -208,7 +208,7 @@ void ISOTP_InterpreterWindow::showDetailView()
|
||||
|
||||
msg = &messages[rowNum];
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg->payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg->payload().constData());
|
||||
int dataLen = msg->payload().length();
|
||||
|
||||
if (msg->reportedLength != dataLen)
|
||||
@@ -266,7 +266,7 @@ void ISOTP_InterpreterWindow::newISOMessage(ISOTP_MESSAGE msg)
|
||||
int rowNum;
|
||||
QString tempString;
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg.payload().constData());
|
||||
int dataLen = msg.payload().length();
|
||||
|
||||
if ((msg.reportedLength != dataLen) && !ui->cbShowIncomplete->isChecked()) return;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
SnifferItem::SnifferItem(const CANFrame& pFrame, quint32 seq):
|
||||
mID(pFrame.frameId())
|
||||
{
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(pFrame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(pFrame.payload().constData());
|
||||
int dataLen = pFrame.payload().length();
|
||||
|
||||
for (int i = 0; i < 0; i++) {
|
||||
@@ -117,7 +117,7 @@ void SnifferItem::update(const CANFrame& pFrame, quint32 timeSeq, bool mute)
|
||||
mLastTime = mCurrentTime;
|
||||
mCurrSeqVal = timeSeq;
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(pFrame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(pFrame.payload().constData());
|
||||
int dataLen = pFrame.payload().length();
|
||||
|
||||
/* copy new value */
|
||||
|
||||
@@ -354,7 +354,7 @@ void UDSScanWindow::gotUDSReply(UDS_MESSAGE msg)
|
||||
int offset = ui->spinReplyOffset->value();
|
||||
UDS_MESSAGE sentFrame;
|
||||
bool gotReply = false;
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(msg.payload().constData());
|
||||
int dataLen = msg.payload().length();
|
||||
|
||||
int numSending = sendingFrames.length();
|
||||
@@ -488,6 +488,9 @@ void UDSScanWindow::sendNextMsg()
|
||||
else
|
||||
{
|
||||
waitTimer->stop();
|
||||
udsHandler->setReception(false);
|
||||
udsHandler->setProcessAllIDs(false);
|
||||
udsHandler->setFlowCtrl(false);
|
||||
ui->btnScan->setText("Start Scan");
|
||||
currentlyRunning = false;
|
||||
}
|
||||
|
||||
+2
-3
@@ -255,7 +255,7 @@ void CANScriptHelper::gotTargettedFrame(const CANFrame &frame)
|
||||
if (!gotFrameFunction.isCallable()) return; //nothing to do if we can't even call the function
|
||||
//qDebug() << "Got frame in script interface";
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(frame.payload().data());
|
||||
const unsigned char *data = reinterpret_cast<const unsigned char *>(frame.payload().constData());
|
||||
int dataLen = frame.payload().length();
|
||||
|
||||
for (int i = 0; i < filters.length(); i++)
|
||||
@@ -310,14 +310,13 @@ void ISOTPScriptHelper::sendISOTP(QJSValue bus, QJSValue id, QJSValue length, QJ
|
||||
msg.setFrameId(id.toUInt());
|
||||
msg.payload().resize(length.toInt());
|
||||
|
||||
unsigned char *data = reinterpret_cast<unsigned char *>(msg.payload().data());
|
||||
int dataLen = msg.payload().length();
|
||||
|
||||
if (!dataBytes.isArray()) qDebug() << "data isn't an array";
|
||||
|
||||
for (int i = 0; i < dataLen; i++)
|
||||
{
|
||||
data[i] = static_cast<uint8_t>(dataBytes.property(i).toInt());
|
||||
msg.payload()[i] = static_cast<int8_t>(dataBytes.property(i).toInt());
|
||||
}
|
||||
|
||||
msg.bus = bus.toInt();
|
||||
|
||||
Reference in New Issue
Block a user