YULTek/Otarcik_CAN/Sources/PCANInterface.cpp
2023-01-06 12:46:35 -05:00

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;
}