24 lines
459 B
C++
24 lines
459 B
C++
#include "PCANInterface.h"
|
|
|
|
CPCANInterface::CPCANInterface(QObject *parent) : QObject(parent)
|
|
{
|
|
}
|
|
|
|
int CPCANInterface::Init()
|
|
{
|
|
TPCANStatus Result;
|
|
Result = CAN_Initialize(PCAN_USBBUS1, PCAN_BAUD_500K);
|
|
|
|
if(Result != PCAN_ERROR_OK)
|
|
{
|
|
// An error occurred, get a text describing the error and show it
|
|
//
|
|
char strMsg[256];
|
|
CAN_GetErrorText(Result, 0, strMsg);
|
|
qDebug("%s",strMsg);
|
|
}
|
|
|
|
|
|
return 0;
|
|
}
|