Switch ISOTP and UDS handlers to no longer be static.

Now each can be instantiated multiple times with each instance handling
a different ISOTP or UDS stream. This should streamline some upcoming
code
This commit is contained in:
Collin Kidder
2017-08-20 21:34:05 -04:00
parent 0fd4ca9b3f
commit d869b6a126
7 changed files with 46 additions and 52 deletions
+7 -13
View File
@@ -1,19 +1,6 @@
#include "isotp_handler.h"
#include "connections/canconmanager.h"
ISOTP_HANDLER* ISOTP_HANDLER::mInstance = NULL;
ISOTP_HANDLER* ISOTP_HANDLER::getInstance()
{
if(!mInstance)
{
mInstance = new ISOTP_HANDLER();
mInstance->modelFrames = MainWindow::getReference()->getCANFrameModel()->getListReference();
}
return mInstance;
}
ISOTP_HANDLER::ISOTP_HANDLER()
{
useExtendedAddressing = false;
@@ -23,9 +10,16 @@ ISOTP_HANDLER::ISOTP_HANDLER()
lastSenderBus = 0;
lastSenderID = 0;
modelFrames = MainWindow::getReference()->getCANFrameModel()->getListReference();
connect(&frameTimer, SIGNAL(timeout()), this, SLOT(frameTimerTick()));
}
ISOTP_HANDLER::~ISOTP_HANDLER()
{
disconnect(&frameTimer, SIGNAL(timeout()), this, SLOT(frameTimerTick()));
}
void ISOTP_HANDLER::setExtendedAddressing(bool mode)
{
useExtendedAddressing = mode;