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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user