Many little fixes to clean up warnings and bugs.
This commit is contained in:
@@ -155,7 +155,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 < (uint32_t)(busBase + conn->getNumBuses()))
|
||||
{
|
||||
workingFrame.bus -= busBase;
|
||||
workingFrame.isReceived = false;
|
||||
@@ -203,6 +203,7 @@ bool CANConManager::addTargettedFrame(int pBusId, const CANFlt &target)
|
||||
}
|
||||
busBase += conn->getNumBuses();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CANConManager::removeTargettedFrame(int pBusId, const CANFlt &target)
|
||||
@@ -221,6 +222,7 @@ bool CANConManager::removeTargettedFrame(int pBusId, const CANFlt &target)
|
||||
}
|
||||
busBase += conn->getNumBuses();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -275,7 +275,7 @@ bool CANConnection::addTargettedFrame(int pBusId, const CANFlt &target)
|
||||
|
||||
for (int i = 0; i < getNumBuses(); i++)
|
||||
{
|
||||
if (pBusId == -1 || pBusId && (1 << i)) {
|
||||
if ( (pBusId == -1) || (pBusId && (1 << i)) ) {
|
||||
qDebug() << "Connection is registering a new targetted frame filter";
|
||||
mBusData_p[i].mTargettedFrames.append(target);
|
||||
}
|
||||
@@ -312,7 +312,7 @@ bool CANConnection::removeTargettedFrame(int pBusId, const CANFlt &target)
|
||||
|
||||
void CANConnection::checkTargettedFrame(CANFrame &frame)
|
||||
{
|
||||
int maskedID;
|
||||
unsigned int maskedID;
|
||||
foreach (const CANFlt filt, mBusData_p[frame.bus].mTargettedFrames)
|
||||
{
|
||||
maskedID = frame.ID & filt.mask;
|
||||
|
||||
@@ -146,10 +146,8 @@ void GVRetSerial::piSetBusSettings(int pBusIdx, CANBus bus)
|
||||
bool GVRetSerial::piSendFrame(const CANFrame& frame)
|
||||
{
|
||||
QByteArray buffer;
|
||||
int c;
|
||||
unsigned int c;
|
||||
int ID;
|
||||
CANFrame tempFrame = frame;
|
||||
tempFrame.isReceived = false;
|
||||
|
||||
//qDebug() << "Sending out GVRET frame with id " << frame.ID << " on bus " << frame.bus;
|
||||
|
||||
@@ -386,7 +384,7 @@ void GVRetSerial::procRXChar(unsigned char c)
|
||||
break;
|
||||
case 7:
|
||||
buildFrame.ID |= c << 24;
|
||||
if ((buildFrame.ID & 1 << 31) == 1 << 31)
|
||||
if ((buildFrame.ID & 1 << 31) == 1u << 31)
|
||||
{
|
||||
buildFrame.ID &= 0x7FFFFFFF;
|
||||
buildFrame.extended = true;
|
||||
|
||||
@@ -77,7 +77,7 @@ protected:
|
||||
QSerialPort *serial;
|
||||
int framesRapid;
|
||||
STATE rx_state;
|
||||
int rx_step;
|
||||
uint32_t rx_step;
|
||||
CANFrame buildFrame;
|
||||
int can0Baud, can1Baud;
|
||||
bool can0Enabled, can1Enabled;
|
||||
|
||||
@@ -150,6 +150,7 @@ void SocketCan::errorReceived(QCanBusDevice::CanBusError error) const
|
||||
|
||||
void SocketCan::framesWritten(qint64 count)
|
||||
{
|
||||
Q_UNUSED(count);
|
||||
//qDebug() << "Number of frames written:" << count;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user