QtCanBus is not limited to SocketCAN, it also supports various Windows CAN adapters directly. Also, add the term Connection to describe the inheritance hierarchy better.
20 lines
419 B
C++
20 lines
419 B
C++
#include <QString>
|
|
#include "canconfactory.h"
|
|
#include "serialbusconnection.h"
|
|
#include "gvretserial.h"
|
|
|
|
using namespace CANCon;
|
|
|
|
CANConnection* CanConFactory::create(type pType, QString pPortName)
|
|
{
|
|
switch(pType) {
|
|
case SOCKETCAN:
|
|
return new SerialBusConnection(pPortName);
|
|
case GVRET_SERIAL:
|
|
return new GVRetSerial(pPortName);
|
|
default: {}
|
|
}
|
|
|
|
return NULL;
|
|
}
|