diff --git a/plugins/freeems/freeemscomms.cpp b/plugins/freeems/freeemscomms.cpp index ca7d861..9c5f637 100644 --- a/plugins/freeems/freeemscomms.cpp +++ b/plugins/freeems/freeemscomms.cpp @@ -594,6 +594,26 @@ int FreeEmsComms::getOperatingSystem() m_reqList.append(req); return m_sequenceNumber-1; } +int FreeEmsComms::getSupportEmail() +{ + QMutexLocker locker(&m_reqListMutex); + RequestClass req; + req.type = GET_SUPPORT_EMAIL; + req.sequencenumber = m_sequenceNumber; + m_sequenceNumber++; + m_reqList.append(req); + return m_sequenceNumber-1; +} +int FreeEmsComms::getBuiltByName() +{ + QMutexLocker locker(&m_reqListMutex); + RequestClass req; + req.type = GET_BUILT_BY_NAME; + req.sequencenumber = m_sequenceNumber; + m_sequenceNumber++; + m_reqList.append(req); + return m_sequenceNumber-1; +} int FreeEmsComms::retrieveBlockFromFlash(unsigned short location, unsigned short offset, unsigned short size) { QMutexLocker locker(&m_reqListMutex); @@ -1120,6 +1140,14 @@ void FreeEmsComms::run() emit interrogateTaskStart("Ecu Info Operating System",seq); m_interrogatePacketList.append(seq); + seq = getBuiltByName(); + emit interrogateTaskStart("Ecu Info Built By Name",seq); + m_interrogatePacketList.append(seq); + + seq = getSupportEmail(); + emit interrogateTaskStart("Ecu Info Support Email",seq); + m_interrogatePacketList.append(seq); + seq = getLocationIdList(0x00,0x00); emit interrogateTaskStart("Ecu Info Location ID List",seq); m_interrogatePacketList.append(seq); @@ -1206,6 +1234,44 @@ void FreeEmsComms::run() } m_waitingInfoMutex.unlock(); } + else if (m_threadReqList[i].type == GET_BUILT_BY_NAME) + { + m_waitingInfoMutex.lock(); + if (!m_waitingForResponse) + { + m_waitingForResponse = true; + m_timeoutMsecs = QDateTime::currentDateTime().currentMSecsSinceEpoch(); + m_currentWaitingRequest = m_threadReqList[i]; + m_payloadWaitingForResponse = GET_BUILT_BY_NAME; + if (!sendPacket(GET_BUILT_BY_NAME)) + { + QLOG_FATAL() << "Error writing packet. Quitting thread"; + return; + } + m_threadReqList.removeAt(i); + i--; + } + m_waitingInfoMutex.unlock(); + } + else if (m_threadReqList[i].type == GET_SUPPORT_EMAIL) + { + m_waitingInfoMutex.lock(); + if (!m_waitingForResponse) + { + m_waitingForResponse = true; + m_timeoutMsecs = QDateTime::currentDateTime().currentMSecsSinceEpoch(); + m_currentWaitingRequest = m_threadReqList[i]; + m_payloadWaitingForResponse = GET_SUPPORT_EMAIL; + if (!sendPacket(GET_SUPPORT_EMAIL)) + { + QLOG_FATAL() << "Error writing packet. Quitting thread"; + return; + } + m_threadReqList.removeAt(i); + i--; + } + m_waitingInfoMutex.unlock(); + } else if (m_threadReqList[i].type == GET_OPERATING_SYSTEM) { m_waitingInfoMutex.lock(); diff --git a/plugins/freeems/freeemscomms.h b/plugins/freeems/freeemscomms.h index ab521c7..397478b 100644 --- a/plugins/freeems/freeemscomms.h +++ b/plugins/freeems/freeemscomms.h @@ -68,6 +68,8 @@ class FreeEmsComms : public EmsComms int getDecoderName(); int getFirmwareBuildDate(); int getCompilerVersion(); + int getSupportEmail(); + int getBuiltByName(); int getOperatingSystem(); int echoPacket(QByteArray packet); Q_INVOKABLE int startBenchTest(unsigned char eventspercycle,unsigned short numcycles,unsigned short ticksperevent,QVariantList pineventmask,QVariantList pinmode); diff --git a/plugins/freeems/packet.h b/plugins/freeems/packet.h index d047e90..96c487f 100644 --- a/plugins/freeems/packet.h +++ b/plugins/freeems/packet.h @@ -39,6 +39,8 @@ enum RequestType GET_FIRMWARE_BUILD_DATE=0xEEF0, GET_COMPILER_VERSION=0xEEF2, GET_OPERATING_SYSTEM=0xEEF4, + GET_BUILT_BY_NAME=0xEEF6, + GET_SUPPORT_EMAIL=0xEEF8, GET_LOCATION_ID_INFO=0xF8E0, SERIAL_CONNECT=0xFFFF01, SERIAL_DISCONNECT=0xFFFF02,