A bit better debugging messages, fix up filtering for firmware updater
This commit is contained in:
@@ -278,7 +278,7 @@ bool CANConnection::addTargettedFrame(int pBusId, uint32_t ID, uint32_t mask, QO
|
|||||||
for (int i = 0; i < getNumBuses(); i++)
|
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";
|
qDebug() << "Connection is registering a new targetted frame filter, local bus " << i;
|
||||||
CANFlt target;
|
CANFlt target;
|
||||||
target.id = ID;
|
target.id = ID;
|
||||||
target.mask = mask;
|
target.mask = mask;
|
||||||
@@ -339,8 +339,10 @@ bool CANConnection::removeAllTargettedFrames(QObject *receiver)
|
|||||||
void CANConnection::checkTargettedFrame(CANFrame &frame)
|
void CANConnection::checkTargettedFrame(CANFrame &frame)
|
||||||
{
|
{
|
||||||
unsigned int maskedID;
|
unsigned int maskedID;
|
||||||
|
qDebug() << "Got frame with ID " << frame.ID << " on bus " << frame.bus;
|
||||||
foreach (const CANFlt filt, mBusData_p[frame.bus].mTargettedFrames)
|
foreach (const CANFlt filt, mBusData_p[frame.bus].mTargettedFrames)
|
||||||
{
|
{
|
||||||
|
qDebug() << "Checking filter with id " << filt.id << " mask " << filt.mask;
|
||||||
maskedID = frame.ID & filt.mask;
|
maskedID = frame.ID & filt.mask;
|
||||||
if (maskedID == filt.id) {
|
if (maskedID == filt.id) {
|
||||||
qDebug() << "In connection object I got a targetted frame. Forwarding it.";
|
qDebug() << "In connection object I got a targetted frame. Forwarding it.";
|
||||||
|
|||||||
@@ -25,10 +25,7 @@ FirmwareUploaderWindow::FirmwareUploaderWindow(const QVector<CANFrame> *frames,
|
|||||||
updateProgress();
|
updateProgress();
|
||||||
|
|
||||||
timer = new QTimer();
|
timer = new QTimer();
|
||||||
timer->setInterval(100); //100ms without a reply will cause us to attempt a resend
|
timer->setInterval(100); //100ms without a reply will cause us to attempt a resend
|
||||||
|
|
||||||
CANConManager::getInstance()->addTargettedFrame(-1, 0x100, 0x7F0, this);
|
|
||||||
//MainWindow::getReference()->setTargettedID(baseAddress + 0x10);
|
|
||||||
|
|
||||||
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
|
connect(MainWindow::getReference(), SIGNAL(framesUpdated(int)), this, SLOT(updatedFrames(int)));
|
||||||
connect(ui->btnLoadFile, SIGNAL(clicked(bool)), this, SLOT(handleLoadFile()));
|
connect(ui->btnLoadFile, SIGNAL(clicked(bool)), this, SLOT(handleLoadFile()));
|
||||||
@@ -170,7 +167,8 @@ void FirmwareUploaderWindow::handleStartStopTransfer()
|
|||||||
bus = ui->spinBus->value();
|
bus = ui->spinBus->value();
|
||||||
baseAddress = Utility::ParseStringToNum(ui->txtBaseAddr->text());
|
baseAddress = Utility::ParseStringToNum(ui->txtBaseAddr->text());
|
||||||
qDebug() << "Base address: " + QString::number(baseAddress);
|
qDebug() << "Base address: " + QString::number(baseAddress);
|
||||||
//MainWindow::getReference()->setTargettedID(baseAddress + 0x10);
|
CANConManager::getInstance()->addTargettedFrame(bus, baseAddress + 0x10, 0x7FF, this);
|
||||||
|
CANConManager::getInstance()->addTargettedFrame(bus, baseAddress + 0x20, 0x7FF, this);
|
||||||
CANFrame *output = new CANFrame;
|
CANFrame *output = new CANFrame;
|
||||||
output->extended = false;
|
output->extended = false;
|
||||||
output->len = 8;
|
output->len = 8;
|
||||||
@@ -190,7 +188,7 @@ void FirmwareUploaderWindow::handleStartStopTransfer()
|
|||||||
else //stop anything in process
|
else //stop anything in process
|
||||||
{
|
{
|
||||||
ui->btnStartStop->setText("Start Upload");
|
ui->btnStartStop->setText("Start Upload");
|
||||||
//MainWindow::getReference()->setTargettedID(-1);
|
CANConManager::getInstance()->removeAllTargettedFrames(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -105,8 +105,7 @@ void ScriptContainer::clearFilters()
|
|||||||
CANConnection* conn_p = CANConManager::getInstance()->getByName(mConName);
|
CANConnection* conn_p = CANConManager::getInstance()->getByName(mConName);
|
||||||
if(conn_p)
|
if(conn_p)
|
||||||
{
|
{
|
||||||
//for(int i=0 ; i<conn_p->getNumBuses() ; i++)
|
conn_p->removeAllTargettedFrames(this);
|
||||||
//conn_p->setFilters(i, QVector<CANFlt>(), false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user