-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SocketCAN #8
SocketCAN #8
Conversation
src/canbus/elm327.cpp
Outdated
} | ||
if(this->_write(ss.str())>=0){ | ||
QCanBusFrame retFrame = this->receive(); | ||
if(retFrame.frameType()!=2){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QCanBusFrame::ErrorFrame
is better than 2
std::stringstream ss; | ||
|
||
//this is an obd message, so we can send it with the elm327 | ||
if(frame.frameId() == 0x7df){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0x7df
represents an OBD-II request message. That is not obvious from the code/comments. As a matter of style and readability, consider naming your magic numbers with #define
or enum
char buf[1]; | ||
std::string str; | ||
|
||
while (true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could put the exit condition here, e.g. while buf[0] != '>'
Urgh the pi is stuck on 5.11 isn't it.. readAllFrames was introduced in 5.12. |
Please try out the new commit, I've removed the readAllFrames call and written my own. It's working on a bunch of CAN logs I have from my car, but I don't have a live car to test on right now. |
excellent! Will try it out |
Built sucessfully with one warn |
…ghtness udev script
…ove last remains of ia
include/app/pages/vehicle.hpp
Outdated
|
||
obd_decoder_t decoder; | ||
std::vector<Command> cmds; | ||
std::map<int, double> dataMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataMap was a remnant.
src/app/theme.cpp
Outdated
@@ -12,6 +12,10 @@ | |||
#include <QRegularExpression> | |||
#include <QTextStream> | |||
#include <QTransform> | |||
#include <iostream> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these extra includes can be removed i think (they're not being usedanymore)
src/app/theme.cpp
Outdated
@@ -48,6 +52,8 @@ Theme::Theme() : QObject(qApp), palette() | |||
QFontDatabase::addApplicationFont(":/fonts/Montserrat/Montserrat-LightItalic.ttf"); | |||
QFontDatabase::addApplicationFont(":/fonts/Montserrat/Montserrat-Regular.ttf"); | |||
|
|||
qApp->setFont(Theme::font_14); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be removed (moved before i merged pages into develop, probs came back when you were resolving conflicts hah)
src/app/pages/vehicle.cpp
Outdated
@@ -75,14 +93,15 @@ QString Gauge::null_value() | |||
|
|||
VehiclePage::VehiclePage(QWidget *parent) : QTabWidget(parent) | |||
{ | |||
this->tabBar()->setFont(Theme::font_14); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be removed too (probs came from conflicts again)
@@ -1,29 +1,41 @@ | |||
#include <QPalette> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually in this whole file check to make sure anything font related matches whats in develop (i see a few deviations from it)
Adds a framework/support for SocketCAN. This allows dash (and vehicle plugins) to listen to, and query from, the car direct.
Reworks elm327 support to be based on common CANInterface