#include "PCANInterface.h" #include "GeneralMessagesLogDispatcher.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); CGeneralMessagesLogDispatcher::instance()->AddLogMessage(strMsg); } return 0; }