Bug fixes in connection code, some commented out debugging statements used only for specific debugging

This commit is contained in:
Collin Kidder
2016-12-19 20:46:59 -05:00
parent 0f3f9e0fad
commit cdfb7661a1
2 changed files with 9 additions and 3 deletions
+6 -1
View File
@@ -103,6 +103,8 @@ CANConnection* CANConManager::getByName(const QString& pName) const
void CANConManager::refreshConnection(CANConnection* pConn_p)
{
if (pConn_p->getQueue().peek() == NULL) return;
CANFrame* frame_p = NULL;
QVector<CANFrame> frames;
@@ -117,8 +119,11 @@ void CANConManager::refreshConnection(CANConnection* pConn_p)
else break;
}
//qDebug() << "Bus fixup number: " << busBase;
while( (frame_p = pConn_p->getQueue().peek() ) ) {
frame_p->bus += busBase;
//qDebug() << "Rx of frame from bus: " << frame_p->bus;
frames.append(*frame_p);
pConn_p->getQueue().dequeue();
}
@@ -147,7 +152,7 @@ bool CANConManager::sendFrame(const CANFrame& pFrame)
foreach (CANConnection* conn, mConns)
{
//check if this CAN connection is supposed to handle the requested bus
if (pFrame.bus <= busBase + conn->getNumBuses())
if (pFrame.bus < busBase + conn->getNumBuses())
{
workingFrame.bus -= busBase;
workingFrame.isReceived = false;