Update to V169 - Now compiles under QT 5.9 (LTS). Fixed some warnings,
switched to using system QTScintilla library on Linux. This prevents you from needing to compile it yourself, added preliminary support for three buses with a GVRET device (for Macchina M2 boards)
This commit is contained in:
+3
-1
@@ -14,7 +14,9 @@ CONFIG += c++11 qscintilla2
|
||||
|
||||
TARGET = SavvyCAN
|
||||
TEMPLATE = app
|
||||
INCLUDEPATH +=/usr/include/qt5/
|
||||
#you are fairly likely to have to change this next include to match your linux distro
|
||||
#this works on Linux Mint 18.1
|
||||
unix:!macx: INCLUDEPATH +=/usr/include/x86_64-linux-gnu/qt5
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp \
|
||||
|
||||
@@ -107,6 +107,7 @@ void ISOTP_HANDLER::updatedFrames(int numFrames)
|
||||
|
||||
void ISOTP_HANDLER::rapidFrames(const CANConnection* conn, const QVector<CANFrame>& pFrames)
|
||||
{
|
||||
Q_UNUSED(conn)
|
||||
if (pFrames.length() <= 0) return;
|
||||
|
||||
qDebug() << "received messages in ISOTP handler";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef CONFIG
|
||||
#define CONFIG
|
||||
|
||||
#define VERSION 168
|
||||
#define VERSION 169
|
||||
|
||||
//try to keep this in sync.
|
||||
//SavvyCAN will complain if you connect a GVRET board with a revision
|
||||
|
||||
@@ -104,7 +104,7 @@ CANConnection* CANConManager::getByName(const QString& pName) const
|
||||
|
||||
void CANConManager::refreshConnection(CANConnection* pConn_p)
|
||||
{
|
||||
int buses = 0;
|
||||
unsigned int buses = 0;
|
||||
foreach(CANConnection* conn_p, mConns)
|
||||
{
|
||||
if (conn_p->getStatus() == CANCon::CONNECTED) buses += conn_p->getNumBuses();
|
||||
|
||||
@@ -257,7 +257,7 @@ void CANConnection::setCapSuspended(bool pIsSuspended) {
|
||||
}
|
||||
|
||||
void CANConnection::debugInput(QByteArray bytes) {
|
||||
|
||||
Q_UNUSED(bytes)
|
||||
}
|
||||
|
||||
bool CANConnection::addTargettedFrame(int pBusId, uint32_t ID, uint32_t mask, QObject *receiver)
|
||||
|
||||
@@ -183,6 +183,7 @@ public slots:
|
||||
void debugInput(QByteArray bytes);
|
||||
|
||||
protected:
|
||||
int mNumBuses; //protected to allow connected device to figure out how many buses are available
|
||||
|
||||
//determine if the passed frame is part of a filter or not.
|
||||
void checkTargettedFrame(CANFrame &frame);
|
||||
@@ -290,7 +291,6 @@ protected:
|
||||
|
||||
private:
|
||||
LFQueue<CANFrame> mQueue;
|
||||
const int mNumBuses;
|
||||
const QString mPort;
|
||||
const CANCon::type mType;
|
||||
bool mIsCapSuspended;
|
||||
|
||||
@@ -485,10 +485,7 @@ void ConnectionWindow::handleRevert()
|
||||
bool ConnectionWindow::isSocketCanAvailable()
|
||||
{
|
||||
#ifdef Q_OS_LINUX
|
||||
for (const auto &backend : QCanBus::instance()->plugins()) {
|
||||
if (backend == "socketcan")
|
||||
return true;
|
||||
}
|
||||
if (QCanBus::instance()->plugins().contains(QStringLiteral("socketcan"))) return true;
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "gvretserial.h"
|
||||
|
||||
GVRetSerial::GVRetSerial(QString portName) :
|
||||
CANConnection(portName, CANCon::GVRET_SERIAL, 2, 4000, true),
|
||||
CANConnection(portName, CANCon::GVRET_SERIAL, 3, 4000, true),
|
||||
mTimer(this) /*NB: set this as parent of timer to manage it from working thread */
|
||||
{
|
||||
qDebug() << "GVRetSerial()";
|
||||
@@ -170,7 +170,7 @@ bool GVRetSerial::piSendFrame(const CANFrame& frame)
|
||||
buffer[3] = (unsigned char)(ID >> 8);
|
||||
buffer[4] = (unsigned char)(ID >> 16);
|
||||
buffer[5] = (unsigned char)(ID >> 24);
|
||||
buffer[6] = (unsigned char)((frame.bus) & 1);
|
||||
buffer[6] = (unsigned char)((frame.bus) & 3);
|
||||
buffer[7] = (unsigned char)frame.len;
|
||||
for (c = 0; c < frame.len; c++)
|
||||
{
|
||||
@@ -255,6 +255,10 @@ void GVRetSerial::connectDevice()
|
||||
output.append((char)0xF1); //and another command
|
||||
output.append((char)0x01); //Time Sync - Not implemented until 333 but we can try
|
||||
|
||||
output.append((char)0xF1);
|
||||
output.append((char)0x12); //get number of actually implemented buses. Not implemented except on M2RET
|
||||
mNumBuses = 2; //the proper number if 0x12 is not implemented
|
||||
|
||||
continuousTimeSync = true;
|
||||
|
||||
serial->write(output);
|
||||
@@ -374,6 +378,10 @@ void GVRetSerial::procRXChar(unsigned char c)
|
||||
//qDebug() << "Got validated";
|
||||
rx_state = IDLE;
|
||||
break;
|
||||
case 12:
|
||||
rx_state = GET_NUM_BUSES;
|
||||
rx_step = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case BUILD_CAN_FRAME:
|
||||
@@ -593,7 +601,10 @@ void GVRetSerial::procRXChar(unsigned char c)
|
||||
case SET_SINGLEWIRE_MODE:
|
||||
rx_state = IDLE;
|
||||
break;
|
||||
|
||||
case GET_NUM_BUSES:
|
||||
mNumBuses = c;
|
||||
rx_state = IDLE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,8 @@ enum STATE //keep this enum synchronized with the Arduino firmware project
|
||||
SETUP_CANBUS,
|
||||
GET_CANBUS_PARAMS,
|
||||
GET_DEVICE_INFO,
|
||||
SET_SINGLEWIRE_MODE
|
||||
SET_SINGLEWIRE_MODE,
|
||||
GET_NUM_BUSES
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ void UDSScanWindow::dumpNode(QTreeWidgetItem* item, QFile *file, int indent)
|
||||
|
||||
void UDSScanWindow::sendOnBuses(UDS_MESSAGE test, int buses)
|
||||
{
|
||||
int busList = buses;
|
||||
//int busList = buses;
|
||||
//if (busList < ui->cbBuses->count() - 1)
|
||||
//{
|
||||
test.bus = buses;
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ void ScriptContainer::compileScript()
|
||||
errorWidget->clear();
|
||||
|
||||
if (result.isError() && errorWidget)
|
||||
{
|
||||
{
|
||||
errorWidget->addItem("SCRIPT EXCEPTION!");
|
||||
errorWidget->addItem("Line: " + result.property("lineNumber").toString());
|
||||
errorWidget->addItem(result.property("message").toString());
|
||||
@@ -71,7 +71,7 @@ void ScriptContainer::setFilter(QJSValue id, QJSValue mask, QJSValue bus)
|
||||
CANConnection* conn_p = CANConManager::getInstance()->getByName(mConName);
|
||||
if(conn_p)
|
||||
{
|
||||
CANFlt canFlt;
|
||||
//CANFlt canFlt;
|
||||
for(int i=0 ; i<conn_p->getNumBuses() ; i++)
|
||||
{
|
||||
foreach(const CANFilter& flt, filters)
|
||||
|
||||
Reference in New Issue
Block a user