Files
giesCANne/connections/canconfactory.cpp
T
Collin Kidder e7e65b7216 Fixed up a bunch of compiler warnings.
There should be no functional difference, just less noise when compiling
2019-08-08 21:15:51 -04:00

22 lines
589 B
C++

#include <QString>
#include "canconfactory.h"
#include "serialbusconnection.h"
#include "gvretserial.h"
using namespace CANCon;
CANConnection* CanConFactory::create(type pType, QString pPortName, QString pDriverName)
{
switch(pType) {
case SERIALBUS:
return new SerialBusConnection(pPortName, pDriverName);
case GVRET_SERIAL:
return new GVRetSerial(pPortName, false);
case REMOTE:
return new GVRetSerial(pPortName, true); //it's a special case of GVRET connected over TCP/IP so it uses the same class
default: {}
}
return nullptr;
}