1.0
This commit is contained in:
parent
4c8f0066fd
commit
da8e2e797b
BIN
CetHub.exe
Normal file
BIN
CetHub.exe
Normal file
Binary file not shown.
@ -1,31 +0,0 @@
|
||||
QT += core gui
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any Qt feature that has been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if it uses deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
hubmainwidget.cpp
|
||||
|
||||
HEADERS += \
|
||||
hubmainwidget.h
|
||||
|
||||
FORMS += \
|
||||
hubmainwidget.ui
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
@ -1,124 +0,0 @@
|
||||
#include "hubmainwidget.h"
|
||||
#include "ui_hubmainwidget.h"
|
||||
#include "QtNetwork/QNetworkReply"
|
||||
|
||||
HubMainWidget::HubMainWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, ui(new Ui::HubMainWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(&sysTimer, &QTimer::timeout, this, [this]()
|
||||
{
|
||||
ui->dateTimeEdit->setTime(QTime::currentTime());
|
||||
ui->dateTimeEdit->setDate(QDate::currentDate());
|
||||
});
|
||||
sysTimer.start(1000);
|
||||
|
||||
getModules();
|
||||
}
|
||||
|
||||
bool HubMainWidget::getModules()
|
||||
{
|
||||
dllInfo UnionCom;
|
||||
UnionCom.libName = "Терминал CAN, RS, Modbus";
|
||||
UnionCom.fileName = "UnionCom";
|
||||
UnionCom.initFuncName = "init";
|
||||
UnionCom.adr = "https://git.arktika.cyou/Tenocha/UnionComDLL";
|
||||
UnionCom.downloadAdr = "https://git.arktika.cyou/Tenocha/UnionComDLL/archive/Release.zip";
|
||||
connectLibrary(UnionCom);
|
||||
|
||||
dllInfo M3KTE_TERM;
|
||||
M3KTE_TERM.libName = "МЗКТЕ Терминал";
|
||||
M3KTE_TERM.fileName = "M3KTE_TERM";
|
||||
M3KTE_TERM.initFuncName = "init";
|
||||
M3KTE_TERM.adr = "https://git.arktika.cyou/Tenocha/M3KTE_TERM";
|
||||
M3KTE_TERM.downloadAdr = "https://git.arktika.cyou/Tenocha/M3KTE_TERM/releases/download/Pre-release/M3KTETERM.rar";
|
||||
connectLibrary(M3KTE_TERM);
|
||||
|
||||
dllInfo LineRingerLib;
|
||||
LineRingerLib.libName = "Поиск modbus устройств";
|
||||
LineRingerLib.fileName = "LineRingerLib32Bit";
|
||||
LineRingerLib.initFuncName = "init";
|
||||
LineRingerLib.adr = "https://git.arktika.cyou/Tenocha/LineRingerDLL";
|
||||
LineRingerLib.downloadAdr = "https://git.arktika.cyou/Tenocha/LineRingerDLL/archive/Release.zip";
|
||||
connectLibrary(LineRingerLib);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool HubMainWidget::connectLibrary(dllInfo modul)
|
||||
{
|
||||
QLibrary myLib(modul.fileName);
|
||||
myLib.load();
|
||||
//QString check = myLib.errorString();
|
||||
unsigned newRow = ui->libraryTable->rowCount();
|
||||
ui->libraryTable->insertRow(newRow);
|
||||
ui->libraryTable->setItem(newRow, 0, new QTableWidgetItem(modul.libName));
|
||||
ui->libraryTable->setItem(newRow, 1, new QTableWidgetItem(modul.fileName));
|
||||
QTableWidgetItem *item = new QTableWidgetItem();
|
||||
item->setText("");
|
||||
QLabel *url = new QLabel();
|
||||
url->setText(tr("<a href=\"%1\">Source</a>").arg(modul.adr.toString()));
|
||||
url->setTextFormat(Qt::RichText);
|
||||
url->setTextInteractionFlags(Qt::TextBrowserInteraction);
|
||||
url->setOpenExternalLinks(true);
|
||||
ui->libraryTable->setCellWidget(newRow, 3, url);
|
||||
//ui->libraryTable->setItem(newRow, 2, new QTableWidgetItem(modul.adr));
|
||||
if(myLib.isLoaded())
|
||||
{
|
||||
typedef QWidget* (*DLL_Init_Function)(QWidget*);
|
||||
DLL_Init_Function DLL_Init = (DLL_Init_Function) myLib.resolve(modul.initFuncName.toUtf8());
|
||||
if(DLL_Init)
|
||||
{
|
||||
item->setCheckState(Qt::Checked);
|
||||
ui->libraryTable->setItem(newRow, 2, item);
|
||||
modul.widget = DLL_Init(nullptr);
|
||||
connectedModules.append(modul);
|
||||
ui->appBox->addItem(modul.libName);
|
||||
ui->libraryTable->resizeColumnsToContents();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setCheckState(Qt::Unchecked);
|
||||
ui->libraryTable->setItem(newRow, 2, item);
|
||||
connectedModules.append(modul);
|
||||
ui->appBox->addItem(modul.libName);
|
||||
ui->libraryTable->resizeColumnsToContents();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
HubMainWidget::~HubMainWidget()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
||||
void HubMainWidget::on_openOrDownloadButton_clicked()
|
||||
{
|
||||
if(ui->appBox->count()!=0)
|
||||
{
|
||||
if(connectedModules.at(ui->appBox->currentIndex()).widget != nullptr)
|
||||
{
|
||||
connectedModules.at(ui->appBox->currentIndex()).widget->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
QDesktopServices::openUrl(connectedModules.at(ui->appBox->currentIndex()).adr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HubMainWidget::on_appBox_currentIndexChanged(int index)
|
||||
{
|
||||
if(connectedModules.at(index).widget == nullptr)
|
||||
{
|
||||
ui->openOrDownloadButton->setText("Скачать");
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->openOrDownloadButton->setText("Открыть");
|
||||
}
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
#ifndef HUBMAINWIDGET_H
|
||||
#define HUBMAINWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QTime>
|
||||
#include <QTimer>
|
||||
#include <QLibrary>
|
||||
#include <QUrl>
|
||||
#include <QLabel>
|
||||
#include <QDesktopServices>
|
||||
#include "QtNetwork/QNetworkAccessManager"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class HubMainWidget; }
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class HubMainWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
HubMainWidget(QWidget *parent = nullptr);
|
||||
~HubMainWidget();
|
||||
|
||||
private slots:
|
||||
void on_openOrDownloadButton_clicked();
|
||||
|
||||
void on_appBox_currentIndexChanged(int index);
|
||||
|
||||
private:
|
||||
QTimer sysTimer;
|
||||
|
||||
struct dllInfo
|
||||
{
|
||||
QWidget* widget = nullptr;
|
||||
QString libName;
|
||||
QString fileName;
|
||||
QString initFuncName;
|
||||
QUrl adr;
|
||||
QUrl downloadAdr;
|
||||
};
|
||||
|
||||
QVector<dllInfo>connectedModules;
|
||||
|
||||
bool getModules();
|
||||
bool connectLibrary(dllInfo modul);
|
||||
|
||||
Ui::HubMainWidget *ui;
|
||||
};
|
||||
#endif // HUBMAINWIDGET_H
|
@ -1,128 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>HubMainWidget</class>
|
||||
<widget class="QWidget" name="HubMainWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>399</width>
|
||||
<height>327</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>HubMainWidget</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="1" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="0">
|
||||
<widget class="QComboBox" name="appBox"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="openOrDownloadButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QDateTimeEdit" name="dateTimeEdit">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>100</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="buttonSymbols">
|
||||
<enum>QAbstractSpinBox::NoButtons</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTableWidget" name="libraryTable">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="sizeAdjustPolicy">
|
||||
<enum>QAbstractScrollArea::AdjustIgnored</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderVisible">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Modul</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>DLL</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Finded</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Link</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
@ -1,11 +0,0 @@
|
||||
#include "hubmainwidget.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
HubMainWidget w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
QMAKE_CXX.QT_COMPILER_STDCXX = 201402L
|
||||
QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 7
|
||||
QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 3
|
||||
QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 0
|
||||
QMAKE_CXX.COMPILER_MACROS = \
|
||||
QT_COMPILER_STDCXX \
|
||||
QMAKE_GCC_MAJOR_VERSION \
|
||||
QMAKE_GCC_MINOR_VERSION \
|
||||
QMAKE_GCC_PATCH_VERSION
|
||||
QMAKE_CXX.INCDIRS = \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++ \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/x86_64-w64-mingw32 \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/backward \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include-fixed \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/x86_64-w64-mingw32/include
|
||||
QMAKE_CXX.LIBDIRS = \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0 \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib/gcc \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/x86_64-w64-mingw32/lib \
|
||||
C:/Qt/Qt5.14.2/Tools/mingw730_64/lib
|
Binary file not shown.
@ -1,510 +0,0 @@
|
||||
#ifndef __SLCAN_H__
|
||||
#define __SLCAN_H__
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define STDCALL __stdcall
|
||||
#ifdef SLCAN_EXPORT
|
||||
#define SLCANAPI __declspec(dllexport)
|
||||
#else
|
||||
#define SLCANAPI __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define SLCAN_PROPERTY_INDEX_LINKNAME 0
|
||||
#define SLCAN_PROPERTY_INDEX_INSTANCEID 1
|
||||
|
||||
#define SLCAN_PROPERTY_INDEX_DEVICEDESC 2
|
||||
#define SLCAN_PROPERTY_INDEX_FRIENDLYNAME 3
|
||||
#define SLCAN_PROPERTY_INDEX_PHOBJECTNAME 4
|
||||
#define SLCAN_PROPERTY_INDEX_MFG 5
|
||||
#define SLCAN_PROPERTY_INDEX_LOCATIONINFO 6
|
||||
#define SLCAN_PROPERTY_INDEX_ENUMERATOR 7
|
||||
#define SLCAN_PROPERTY_INDEX_CLASS 8
|
||||
#define SLCAN_PROPERTY_INDEX_CLASSGUID 9
|
||||
#define SLCAN_PROPERTY_INDEX_SERVICE 10
|
||||
#define SLCAN_PROPERTY_INDEX_DRIVER 11
|
||||
#define SLCAN_PROPERTY_INDEX_PORTNAME 12
|
||||
#define SLCAN_PROPERTY_INDEX_PRODUCT 13L
|
||||
#define SLCAN_PROPERTY_INDEX_MANUFACTURER 14L
|
||||
#define SLCAN_PROPERTY_INDEX_CONFIGURATION 15L
|
||||
#define SLCAN_PROPERTY_INDEX_INTERFACE 16L
|
||||
#define SLCAN_PROPERTY_INDEX_SERIAL 17L
|
||||
#define SLCAN_PROPERTY_INDEX_ALIAS 18L
|
||||
#define SLCAN_PROPERTY_INDEX_CHANNELLINK 19L
|
||||
#define SLCAN_PROPERTY_INDEX_SERIALID 20L
|
||||
|
||||
|
||||
#define SLCAN_MODE_CONFIG 0x00
|
||||
#define SLCAN_MODE_NORMAL 0x01
|
||||
#define SLCAN_MODE_LISTENONLY 0x02
|
||||
#define SLCAN_MODE_LOOPBACK 0x03
|
||||
#define SLCAN_MODE_SLEEP 0x04
|
||||
|
||||
#define SLCAN_BR_CIA_1000K 0x8000
|
||||
#define SLCAN_BR_CIA_800K 0x8001
|
||||
#define SLCAN_BR_CIA_500K 0x8002
|
||||
#define SLCAN_BR_CIA_250K 0x8003
|
||||
#define SLCAN_BR_CIA_125K 0x8004
|
||||
#define SLCAN_BR_CIA_50K 0x8005
|
||||
#define SLCAN_BR_CIA_20K 0x8006
|
||||
#define SLCAN_BR_CIA_10K 0x8007
|
||||
#define SLCAN_BR_400K 0x8008
|
||||
#define SLCAN_BR_200K 0x8009
|
||||
#define SLCAN_BR_100K 0x800A
|
||||
#define SLCAN_BR_83333 0x800B
|
||||
#define SLCAN_BR_33333 0x800C
|
||||
#define SLCAN_BR_25K 0x800D
|
||||
#define SLCAN_BR_5K 0x800E
|
||||
#define SLCAN_BR_30K 0x800F
|
||||
#define SLCAN_BR_300K 0x8010
|
||||
#define SLCAN_BR_LASTINDEX SLCAN_BR_300K
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SLCAN_CAP_MODE_NORMAL 0x01
|
||||
#define SLCAN_CAP_MODE_LISTEN_ONLY 0x02
|
||||
#define SLCAN_CAP_MODE_LOOP_BACK 0x04
|
||||
#define SLCAN_CAP_MODE_SLEEP 0x08
|
||||
|
||||
#define SLCAN_CAP_TXMODE_ONE_SHOT 0x01
|
||||
#define SLCAN_CAP_TXMODE_TIMESTAMP 0x02
|
||||
|
||||
|
||||
#define SLCAN_CAP_CONTR_EXTERNAL 0x00
|
||||
#define SLCAN_CAP_CONTR_MCP2515 0x01
|
||||
#define SLCAN_CAP_CONTR_SJA1000 0x02
|
||||
|
||||
#define SLCAN_CAP_CONTR_INTERNAL 0x80
|
||||
#define SLCAN_CAP_CONTR_LPC 0x81
|
||||
#define SLCAN_CAP_CONTR_STM32 0x82
|
||||
#define SLCAN_CAP_CONTR_STM8 0x83
|
||||
#define SLCAN_CAP_CONTR_PIC 0x84
|
||||
#define SLCAN_CAP_CONTR_PIC_ECAN 0x85
|
||||
|
||||
#define SLCAN_CAP_PHYS_HS 0x01
|
||||
#define SLCAN_CAP_PHYS_LS 0x02
|
||||
#define SLCAN_CAP_PHYS_SW 0x04
|
||||
#define SLCAN_CAP_PHYS_J1708 0x08
|
||||
#define SLCAN_CAP_PHYS_LIN 0x10
|
||||
#define SLCAN_CAP_PHYS_KLINE 0x20
|
||||
|
||||
#define SLCAN_CAP_PHYS_LOAD 0x01
|
||||
|
||||
#define SLCAN_CAP_BITRATE_INDEX 0x01
|
||||
#define SLCAN_CAP_BITRATE_CUSTOM 0x02
|
||||
#define SLCAN_CAP_BITRATE_AUTOMATIC 0x04
|
||||
|
||||
|
||||
#define SLCAN_EVT_LEVEL_RX_MSG 0
|
||||
#define SLCAN_EVT_LEVEL_TIME_STAMP 1
|
||||
#define SLCAN_EVT_LEVEL_TX_MSG 2
|
||||
#define SLCAN_EVT_LEVEL_BUS_STATE 3
|
||||
#define SLCAN_EVT_LEVEL_COUNTS 4
|
||||
#define SLCAN_EVT_LEVEL_ERRORS 5
|
||||
|
||||
#define SLCAN_EVT_TYPE_RX 0x0
|
||||
#define SLCAN_EVT_TYPE_START_TX 0x1
|
||||
#define SLCAN_EVT_TYPE_END_TX 0x2
|
||||
#define SLCAN_EVT_TYPE_ABORT_TX 0x3
|
||||
#define SLCAN_EVT_TYPE_BUS_STATE 0x4
|
||||
#define SLCAN_EVT_TYPE_ERROR_COUNTS 0x5
|
||||
#define SLCAN_EVT_TYPE_BUS_ERROR 0x6
|
||||
#define SLCAN_EVT_TYPE_ARBITRATION_ERROR 0x7
|
||||
#define SLCAN_EVT_STAMP_INC 0xF
|
||||
|
||||
#define SLCAN_BUS_STATE_ERROR_ACTIVE 0x00
|
||||
#define SLCAN_BUS_STATE_ERROR_ACTIVE_WARN 0x01
|
||||
#define SLCAN_BUS_STATE_ERROR_PASSIVE 0x02
|
||||
#define SLCAN_BUS_STATE_BUSOFF 0x03
|
||||
|
||||
#define SLCAN_MES_INFO_EXT 0x01
|
||||
#define SLCAN_MES_INFO_RTR 0x02
|
||||
#define SLCAN_MES_INFO_ONESHOT 0x04
|
||||
|
||||
|
||||
|
||||
#define SLCAN_DEVOP_CREATE 0x00000000
|
||||
#define SLCAN_DEVOP_CREATEHANDLE 0x00000001
|
||||
#define SLCAN_DEVOP_OPEN 0x00000002
|
||||
#define SLCAN_DEVOP_CLOSE 0x00000003
|
||||
#define SLCAN_DEVOP_DESTROYHANDLE 0x00000004
|
||||
#define SLCAN_DEVOP_DESTROY 0x00000005
|
||||
|
||||
|
||||
#define SLCAN_INVALID_HANDLE_ERROR 0xE0001001
|
||||
#define SLCAN_DEVICE_INVALID_HANDLE_ERROR 0xE0001120
|
||||
#define SLCAN_HANDLE_INIT_ERROR 0xE0001017
|
||||
#define SLCAN_DEVICE_NOTOPEN_ERROR 0xE0001121
|
||||
|
||||
#define SLCAN_EVT_ERR_TYPE_BIT 0x00
|
||||
#define SLCAN_EVT_ERR_TYPE_FORM 0x01
|
||||
#define SLCAN_EVT_ERR_TYPE_STUFF 0x02
|
||||
#define SLCAN_EVT_ERR_TYPE_OTHER 0x03
|
||||
|
||||
#define SLCAN_EVT_ERR_DIR_TX 0x00
|
||||
#define SLCAN_EVT_ERR_DIR_RX 0x01
|
||||
|
||||
#define SLCAN_EVT_ERR_FRAME_SOF 0x03
|
||||
#define SLCAN_EVT_ERR_FRAME_ID28_ID21 0x02
|
||||
#define SLCAN_EVT_ERR_FRAME_ID20_ID18 0x06
|
||||
#define SLCAN_EVT_ERR_FRAME_SRTR 0x04
|
||||
#define SLCAN_EVT_ERR_FRAME_IDE 0x05
|
||||
#define SLCAN_EVT_ERR_FRAME_ID17_ID13 0x07
|
||||
#define SLCAN_EVT_ERR_FRAME_ID12_ID5 0x0F
|
||||
#define SLCAN_EVT_ERR_FRAME_ID4_ID0 0x0E
|
||||
#define SLCAN_EVT_ERR_FRAME_RTR 0x0C
|
||||
#define SLCAN_EVT_ERR_FRAME_RSRV0 0x0D
|
||||
#define SLCAN_EVT_ERR_FRAME_RSRV1 0x09
|
||||
#define SLCAN_EVT_ERR_FRAME_DLC 0x0B
|
||||
#define SLCAN_EVT_ERR_FRAME_DATA 0x0A
|
||||
#define SLCAN_EVT_ERR_FRAME_CRC_SEQ 0x08
|
||||
#define SLCAN_EVT_ERR_FRAME_CRC_DEL 0x18
|
||||
#define SLCAN_EVT_ERR_FRAME_ACK_SLOT 0x19
|
||||
#define SLCAN_EVT_ERR_FRAME_ACK_DEL 0x1B
|
||||
#define SLCAN_EVT_ERR_FRAME_EOF 0x1A
|
||||
#define SLCAN_EVT_ERR_FRAME_INTER 0x12
|
||||
#define SLCAN_EVT_ERR_FRAME_AER_FLAG 0x11
|
||||
#define SLCAN_EVT_ERR_FRAME_PER_FLAG 0x16
|
||||
#define SLCAN_EVT_ERR_FRAME_TDB 0x13
|
||||
#define SLCAN_EVT_ERR_FRAME_ERR_DEL 0x17
|
||||
#define SLCAN_EVT_ERR_FRAME_OVER_FLAG 0x1C
|
||||
|
||||
#define SLCAN_TX_STATUS_OK 0x00
|
||||
#define SLCAN_TX_STATUS_TIMEOUT 0x01
|
||||
#define SLCAN_TX_STATUS_BUSOFF 0x02
|
||||
#define SLCAN_TX_STATUS_ABORT 0x03
|
||||
#define SLCAN_TX_STATUS_NOT_ENA 0x04
|
||||
#define SLCAN_TX_STATUS_ERROR_ONE_SHOT 0x05
|
||||
#define SLCAN_TX_STATUS_INVALID_MODE 0x06
|
||||
#define SLCAN_TX_STATUS_UNKNOWN 0x0F
|
||||
|
||||
#define SLCAN_PURGE_TX_ABORT 0x01
|
||||
#define SLCAN_PURGE_RX_ABORT 0x02
|
||||
#define SLCAN_PURGE_TX_CLEAR 0x04
|
||||
#define SLCAN_PURGE_RX_CLEAR 0x08
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
typedef PVOID HSLCAN;
|
||||
|
||||
typedef struct _SLCAN_CAPABILITIES{
|
||||
|
||||
BYTE bModes;
|
||||
BYTE bTXModes;
|
||||
BYTE bMaxEventLevel;
|
||||
BYTE bController;
|
||||
BYTE bPhysical;
|
||||
BYTE bPhysicalLoad;
|
||||
BYTE bBitrates;
|
||||
BYTE bAdvancedModes;
|
||||
DWORD dwCanBaseClk;
|
||||
DWORD dwTimeStampClk;
|
||||
WORD wMaxBRP;
|
||||
}SLCAN_CAPABILITIES,*PSLCAN_CAPABILITIES;
|
||||
|
||||
typedef struct _SLCAN_BITRATE {
|
||||
WORD BRP;
|
||||
BYTE TSEG1;
|
||||
BYTE TSEG2;
|
||||
BYTE SJW;
|
||||
BYTE SAM;
|
||||
}SLCAN_BITRATE,*PSLCAN_BITRATE;
|
||||
|
||||
|
||||
typedef void (STDCALL* SLCAN_DEVICE_CALLBACK)(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
DWORD dwOperation,
|
||||
PVOID pContext,
|
||||
DWORD dwContextSize
|
||||
);
|
||||
|
||||
typedef VOID (STDCALL* SLCAN_DEVICELIST_CALLBACK)(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PVOID pContext,
|
||||
DWORD dwContextSize
|
||||
);
|
||||
|
||||
typedef struct _SLCAN_MESSAGE{
|
||||
BYTE Info;
|
||||
DWORD ID;
|
||||
BYTE DataCount;
|
||||
BYTE Data[8];
|
||||
}SLCAN_MESSAGE,*PSLCAN_MESSAGE;
|
||||
|
||||
typedef struct _SLCAN_TXMESSAGE{
|
||||
LONG dwDelay;
|
||||
SLCAN_MESSAGE Msg;
|
||||
}SLCAN_TXMESSAGE,*PSLCAN_TXMESSAGE;
|
||||
|
||||
typedef struct _SLCAN_EVENT{
|
||||
BYTE EventType;
|
||||
DWORD TimeStampLo;
|
||||
union {
|
||||
SLCAN_MESSAGE Msg;
|
||||
DWORD TimeStamp[2];
|
||||
DWORD64 TimeStamp64;
|
||||
struct {
|
||||
BYTE BusMode;
|
||||
BYTE Dummy1;
|
||||
BYTE ErrCountRx;
|
||||
BYTE ErrCountTx;
|
||||
BYTE ErrType;
|
||||
BYTE ErrDir;
|
||||
BYTE ErrFrame;
|
||||
BYTE LostArbitration;
|
||||
};
|
||||
};
|
||||
}SLCAN_EVENT,*PSLCAN_EVENT;
|
||||
|
||||
typedef struct _SLCAN_STATE{
|
||||
BYTE BusMode;
|
||||
BYTE Dummy1;
|
||||
BYTE ErrCountRX;
|
||||
BYTE ErrCountTX;
|
||||
}SLCAN_STATE,*PSLCAN_STATE;
|
||||
|
||||
typedef union _SLCAN_TIMESTAMP{
|
||||
UINT64 Value;
|
||||
DWORD dwValue[2];
|
||||
USHORT wValue[4];
|
||||
BYTE bValue[8];
|
||||
}SLCAN_TIMESTAMP,*PSLCAN_TIMESTAMP;
|
||||
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Load(
|
||||
SLCAN_DEVICE_CALLBACK DeviceProc,
|
||||
SLCAN_DEVICELIST_CALLBACK DeviceListProc
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Free(
|
||||
BOOL bDoCallBack
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Update();
|
||||
|
||||
SLCANAPI HSLCAN STDCALL SlCan_GetDevice(
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_GetDeviceCount();
|
||||
|
||||
|
||||
SLCANAPI HANDLE STDCALL SlCan_DeviceGetHandle(
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetProperty(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetPropertyW(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PWCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI HKEY STDCALL SlCan_DeviceGetRegKey(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI PVOID STDCALL SlCan_DeviceSetContext(
|
||||
HSLCAN hDevice,
|
||||
PVOID pBuf,
|
||||
DWORD dwBufSize
|
||||
);
|
||||
|
||||
SLCANAPI PVOID STDCALL SlCan_DeviceGetContext(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetContextSize(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetAlias(
|
||||
HSLCAN hDevice,
|
||||
PCHAR pBuf
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetAliasW(
|
||||
HSLCAN hDevice,
|
||||
PWCHAR pBuf
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetAlias(
|
||||
HSLCAN hDevice,
|
||||
PCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetAliasW(
|
||||
HSLCAN hDevice,
|
||||
PWCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetCapabilities(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_CAPABILITIES pCapabilities
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceOpen(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceClose(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetMode(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwMode
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetMode(
|
||||
HSLCAN hDevice,
|
||||
PDWORD pdwMode
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetState(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_STATE pState
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetTXTimeOut(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwMillisecond
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTXTimeOut(
|
||||
HSLCAN hDevice,
|
||||
PDWORD pdwMillisecond
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetBitRate(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_BITRATE pBitRate
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetBitRate(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_BITRATE pBitRate
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceEnaRec(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetLatency(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetLatency(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DevicePurge(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetEventLevel(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetEventLevel(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetStartTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetStartTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetTimeStampPeriod(
|
||||
HSLCAN hDevice,
|
||||
LONG lValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStampPeriod(
|
||||
HSLCAN hDevice,
|
||||
PLONG plValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetExMode(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetExMode(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessages(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_MESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PBYTE pbStatus
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessagesEx(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TXMESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PBYTE pbStatus,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceReadMessages(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwTimeOut,
|
||||
PSLCAN_MESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceReadEvents(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwTimeOut,
|
||||
PSLCAN_EVENT pEvent,
|
||||
DWORD dwCount,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif //__SLCAN_H
|
Binary file not shown.
BIN
Dependencies/Qt5Core.dll
vendored
BIN
Dependencies/Qt5Core.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5Gui.dll
vendored
BIN
Dependencies/Qt5Gui.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5Network.dll
vendored
BIN
Dependencies/Qt5Network.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5SerialBus.dll
vendored
BIN
Dependencies/Qt5SerialBus.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5SerialPort.dll
vendored
BIN
Dependencies/Qt5SerialPort.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5Svg.dll
vendored
BIN
Dependencies/Qt5Svg.dll
vendored
Binary file not shown.
BIN
Dependencies/Qt5Widgets.dll
vendored
BIN
Dependencies/Qt5Widgets.dll
vendored
Binary file not shown.
BIN
Dependencies/libgcc_s_seh-1.dll
vendored
BIN
Dependencies/libgcc_s_seh-1.dll
vendored
Binary file not shown.
BIN
Dependencies/libstdc++-6.dll
vendored
BIN
Dependencies/libstdc++-6.dll
vendored
Binary file not shown.
BIN
Dependencies/libwinpthread-1.dll
vendored
BIN
Dependencies/libwinpthread-1.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qgif.dll
vendored
BIN
Dependencies/plugins/imageformats/qgif.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qicns.dll
vendored
BIN
Dependencies/plugins/imageformats/qicns.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qico.dll
vendored
BIN
Dependencies/plugins/imageformats/qico.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qjpeg.dll
vendored
BIN
Dependencies/plugins/imageformats/qjpeg.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qsvg.dll
vendored
BIN
Dependencies/plugins/imageformats/qsvg.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qtga.dll
vendored
BIN
Dependencies/plugins/imageformats/qtga.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qtiff.dll
vendored
BIN
Dependencies/plugins/imageformats/qtiff.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qwbmp.dll
vendored
BIN
Dependencies/plugins/imageformats/qwbmp.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/imageformats/qwebp.dll
vendored
BIN
Dependencies/plugins/imageformats/qwebp.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/platforms/qwindows.dll
vendored
BIN
Dependencies/plugins/platforms/qwindows.dll
vendored
Binary file not shown.
BIN
Dependencies/plugins/styles/qwindowsvistastyle.dll
vendored
BIN
Dependencies/plugins/styles/qwindowsvistastyle.dll
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,510 +0,0 @@
|
||||
#ifndef __SLCAN_H__
|
||||
#define __SLCAN_H__
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#define STDCALL __stdcall
|
||||
#ifdef SLCAN_EXPORT
|
||||
#define SLCANAPI __declspec(dllexport)
|
||||
#else
|
||||
#define SLCANAPI __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#define SLCAN_PROPERTY_INDEX_LINKNAME 0
|
||||
#define SLCAN_PROPERTY_INDEX_INSTANCEID 1
|
||||
|
||||
#define SLCAN_PROPERTY_INDEX_DEVICEDESC 2
|
||||
#define SLCAN_PROPERTY_INDEX_FRIENDLYNAME 3
|
||||
#define SLCAN_PROPERTY_INDEX_PHOBJECTNAME 4
|
||||
#define SLCAN_PROPERTY_INDEX_MFG 5
|
||||
#define SLCAN_PROPERTY_INDEX_LOCATIONINFO 6
|
||||
#define SLCAN_PROPERTY_INDEX_ENUMERATOR 7
|
||||
#define SLCAN_PROPERTY_INDEX_CLASS 8
|
||||
#define SLCAN_PROPERTY_INDEX_CLASSGUID 9
|
||||
#define SLCAN_PROPERTY_INDEX_SERVICE 10
|
||||
#define SLCAN_PROPERTY_INDEX_DRIVER 11
|
||||
#define SLCAN_PROPERTY_INDEX_PORTNAME 12
|
||||
#define SLCAN_PROPERTY_INDEX_PRODUCT 13L
|
||||
#define SLCAN_PROPERTY_INDEX_MANUFACTURER 14L
|
||||
#define SLCAN_PROPERTY_INDEX_CONFIGURATION 15L
|
||||
#define SLCAN_PROPERTY_INDEX_INTERFACE 16L
|
||||
#define SLCAN_PROPERTY_INDEX_SERIAL 17L
|
||||
#define SLCAN_PROPERTY_INDEX_ALIAS 18L
|
||||
#define SLCAN_PROPERTY_INDEX_CHANNELLINK 19L
|
||||
#define SLCAN_PROPERTY_INDEX_SERIALID 20L
|
||||
|
||||
|
||||
#define SLCAN_MODE_CONFIG 0x00
|
||||
#define SLCAN_MODE_NORMAL 0x01
|
||||
#define SLCAN_MODE_LISTENONLY 0x02
|
||||
#define SLCAN_MODE_LOOPBACK 0x03
|
||||
#define SLCAN_MODE_SLEEP 0x04
|
||||
|
||||
#define SLCAN_BR_CIA_1000K 0x8000
|
||||
#define SLCAN_BR_CIA_800K 0x8001
|
||||
#define SLCAN_BR_CIA_500K 0x8002
|
||||
#define SLCAN_BR_CIA_250K 0x8003
|
||||
#define SLCAN_BR_CIA_125K 0x8004
|
||||
#define SLCAN_BR_CIA_50K 0x8005
|
||||
#define SLCAN_BR_CIA_20K 0x8006
|
||||
#define SLCAN_BR_CIA_10K 0x8007
|
||||
#define SLCAN_BR_400K 0x8008
|
||||
#define SLCAN_BR_200K 0x8009
|
||||
#define SLCAN_BR_100K 0x800A
|
||||
#define SLCAN_BR_83333 0x800B
|
||||
#define SLCAN_BR_33333 0x800C
|
||||
#define SLCAN_BR_25K 0x800D
|
||||
#define SLCAN_BR_5K 0x800E
|
||||
#define SLCAN_BR_30K 0x800F
|
||||
#define SLCAN_BR_300K 0x8010
|
||||
#define SLCAN_BR_LASTINDEX SLCAN_BR_300K
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#define SLCAN_CAP_MODE_NORMAL 0x01
|
||||
#define SLCAN_CAP_MODE_LISTEN_ONLY 0x02
|
||||
#define SLCAN_CAP_MODE_LOOP_BACK 0x04
|
||||
#define SLCAN_CAP_MODE_SLEEP 0x08
|
||||
|
||||
#define SLCAN_CAP_TXMODE_ONE_SHOT 0x01
|
||||
#define SLCAN_CAP_TXMODE_TIMESTAMP 0x02
|
||||
|
||||
|
||||
#define SLCAN_CAP_CONTR_EXTERNAL 0x00
|
||||
#define SLCAN_CAP_CONTR_MCP2515 0x01
|
||||
#define SLCAN_CAP_CONTR_SJA1000 0x02
|
||||
|
||||
#define SLCAN_CAP_CONTR_INTERNAL 0x80
|
||||
#define SLCAN_CAP_CONTR_LPC 0x81
|
||||
#define SLCAN_CAP_CONTR_STM32 0x82
|
||||
#define SLCAN_CAP_CONTR_STM8 0x83
|
||||
#define SLCAN_CAP_CONTR_PIC 0x84
|
||||
#define SLCAN_CAP_CONTR_PIC_ECAN 0x85
|
||||
|
||||
#define SLCAN_CAP_PHYS_HS 0x01
|
||||
#define SLCAN_CAP_PHYS_LS 0x02
|
||||
#define SLCAN_CAP_PHYS_SW 0x04
|
||||
#define SLCAN_CAP_PHYS_J1708 0x08
|
||||
#define SLCAN_CAP_PHYS_LIN 0x10
|
||||
#define SLCAN_CAP_PHYS_KLINE 0x20
|
||||
|
||||
#define SLCAN_CAP_PHYS_LOAD 0x01
|
||||
|
||||
#define SLCAN_CAP_BITRATE_INDEX 0x01
|
||||
#define SLCAN_CAP_BITRATE_CUSTOM 0x02
|
||||
#define SLCAN_CAP_BITRATE_AUTOMATIC 0x04
|
||||
|
||||
|
||||
#define SLCAN_EVT_LEVEL_RX_MSG 0
|
||||
#define SLCAN_EVT_LEVEL_TIME_STAMP 1
|
||||
#define SLCAN_EVT_LEVEL_TX_MSG 2
|
||||
#define SLCAN_EVT_LEVEL_BUS_STATE 3
|
||||
#define SLCAN_EVT_LEVEL_COUNTS 4
|
||||
#define SLCAN_EVT_LEVEL_ERRORS 5
|
||||
|
||||
#define SLCAN_EVT_TYPE_RX 0x0
|
||||
#define SLCAN_EVT_TYPE_START_TX 0x1
|
||||
#define SLCAN_EVT_TYPE_END_TX 0x2
|
||||
#define SLCAN_EVT_TYPE_ABORT_TX 0x3
|
||||
#define SLCAN_EVT_TYPE_BUS_STATE 0x4
|
||||
#define SLCAN_EVT_TYPE_ERROR_COUNTS 0x5
|
||||
#define SLCAN_EVT_TYPE_BUS_ERROR 0x6
|
||||
#define SLCAN_EVT_TYPE_ARBITRATION_ERROR 0x7
|
||||
#define SLCAN_EVT_STAMP_INC 0xF
|
||||
|
||||
#define SLCAN_BUS_STATE_ERROR_ACTIVE 0x00
|
||||
#define SLCAN_BUS_STATE_ERROR_ACTIVE_WARN 0x01
|
||||
#define SLCAN_BUS_STATE_ERROR_PASSIVE 0x02
|
||||
#define SLCAN_BUS_STATE_BUSOFF 0x03
|
||||
|
||||
#define SLCAN_MES_INFO_EXT 0x01
|
||||
#define SLCAN_MES_INFO_RTR 0x02
|
||||
#define SLCAN_MES_INFO_ONESHOT 0x04
|
||||
|
||||
|
||||
|
||||
#define SLCAN_DEVOP_CREATE 0x00000000
|
||||
#define SLCAN_DEVOP_CREATEHANDLE 0x00000001
|
||||
#define SLCAN_DEVOP_OPEN 0x00000002
|
||||
#define SLCAN_DEVOP_CLOSE 0x00000003
|
||||
#define SLCAN_DEVOP_DESTROYHANDLE 0x00000004
|
||||
#define SLCAN_DEVOP_DESTROY 0x00000005
|
||||
|
||||
|
||||
#define SLCAN_INVALID_HANDLE_ERROR 0xE0001001
|
||||
#define SLCAN_DEVICE_INVALID_HANDLE_ERROR 0xE0001120
|
||||
#define SLCAN_HANDLE_INIT_ERROR 0xE0001017
|
||||
#define SLCAN_DEVICE_NOTOPEN_ERROR 0xE0001121
|
||||
|
||||
#define SLCAN_EVT_ERR_TYPE_BIT 0x00
|
||||
#define SLCAN_EVT_ERR_TYPE_FORM 0x01
|
||||
#define SLCAN_EVT_ERR_TYPE_STUFF 0x02
|
||||
#define SLCAN_EVT_ERR_TYPE_OTHER 0x03
|
||||
|
||||
#define SLCAN_EVT_ERR_DIR_TX 0x00
|
||||
#define SLCAN_EVT_ERR_DIR_RX 0x01
|
||||
|
||||
#define SLCAN_EVT_ERR_FRAME_SOF 0x03
|
||||
#define SLCAN_EVT_ERR_FRAME_ID28_ID21 0x02
|
||||
#define SLCAN_EVT_ERR_FRAME_ID20_ID18 0x06
|
||||
#define SLCAN_EVT_ERR_FRAME_SRTR 0x04
|
||||
#define SLCAN_EVT_ERR_FRAME_IDE 0x05
|
||||
#define SLCAN_EVT_ERR_FRAME_ID17_ID13 0x07
|
||||
#define SLCAN_EVT_ERR_FRAME_ID12_ID5 0x0F
|
||||
#define SLCAN_EVT_ERR_FRAME_ID4_ID0 0x0E
|
||||
#define SLCAN_EVT_ERR_FRAME_RTR 0x0C
|
||||
#define SLCAN_EVT_ERR_FRAME_RSRV0 0x0D
|
||||
#define SLCAN_EVT_ERR_FRAME_RSRV1 0x09
|
||||
#define SLCAN_EVT_ERR_FRAME_DLC 0x0B
|
||||
#define SLCAN_EVT_ERR_FRAME_DATA 0x0A
|
||||
#define SLCAN_EVT_ERR_FRAME_CRC_SEQ 0x08
|
||||
#define SLCAN_EVT_ERR_FRAME_CRC_DEL 0x18
|
||||
#define SLCAN_EVT_ERR_FRAME_ACK_SLOT 0x19
|
||||
#define SLCAN_EVT_ERR_FRAME_ACK_DEL 0x1B
|
||||
#define SLCAN_EVT_ERR_FRAME_EOF 0x1A
|
||||
#define SLCAN_EVT_ERR_FRAME_INTER 0x12
|
||||
#define SLCAN_EVT_ERR_FRAME_AER_FLAG 0x11
|
||||
#define SLCAN_EVT_ERR_FRAME_PER_FLAG 0x16
|
||||
#define SLCAN_EVT_ERR_FRAME_TDB 0x13
|
||||
#define SLCAN_EVT_ERR_FRAME_ERR_DEL 0x17
|
||||
#define SLCAN_EVT_ERR_FRAME_OVER_FLAG 0x1C
|
||||
|
||||
#define SLCAN_TX_STATUS_OK 0x00
|
||||
#define SLCAN_TX_STATUS_TIMEOUT 0x01
|
||||
#define SLCAN_TX_STATUS_BUSOFF 0x02
|
||||
#define SLCAN_TX_STATUS_ABORT 0x03
|
||||
#define SLCAN_TX_STATUS_NOT_ENA 0x04
|
||||
#define SLCAN_TX_STATUS_ERROR_ONE_SHOT 0x05
|
||||
#define SLCAN_TX_STATUS_INVALID_MODE 0x06
|
||||
#define SLCAN_TX_STATUS_UNKNOWN 0x0F
|
||||
|
||||
#define SLCAN_PURGE_TX_ABORT 0x01
|
||||
#define SLCAN_PURGE_RX_ABORT 0x02
|
||||
#define SLCAN_PURGE_TX_CLEAR 0x04
|
||||
#define SLCAN_PURGE_RX_CLEAR 0x08
|
||||
|
||||
#pragma pack(push,1)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"{
|
||||
#endif
|
||||
|
||||
typedef PVOID HSLCAN;
|
||||
|
||||
typedef struct _SLCAN_CAPABILITIES{
|
||||
|
||||
BYTE bModes;
|
||||
BYTE bTXModes;
|
||||
BYTE bMaxEventLevel;
|
||||
BYTE bController;
|
||||
BYTE bPhysical;
|
||||
BYTE bPhysicalLoad;
|
||||
BYTE bBitrates;
|
||||
BYTE bAdvancedModes;
|
||||
DWORD dwCanBaseClk;
|
||||
DWORD dwTimeStampClk;
|
||||
WORD wMaxBRP;
|
||||
}SLCAN_CAPABILITIES,*PSLCAN_CAPABILITIES;
|
||||
|
||||
typedef struct _SLCAN_BITRATE {
|
||||
WORD BRP;
|
||||
BYTE TSEG1;
|
||||
BYTE TSEG2;
|
||||
BYTE SJW;
|
||||
BYTE SAM;
|
||||
}SLCAN_BITRATE,*PSLCAN_BITRATE;
|
||||
|
||||
|
||||
typedef void (STDCALL* SLCAN_DEVICE_CALLBACK)(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
DWORD dwOperation,
|
||||
PVOID pContext,
|
||||
DWORD dwContextSize
|
||||
);
|
||||
|
||||
typedef VOID (STDCALL* SLCAN_DEVICELIST_CALLBACK)(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PVOID pContext,
|
||||
DWORD dwContextSize
|
||||
);
|
||||
|
||||
typedef struct _SLCAN_MESSAGE{
|
||||
BYTE Info;
|
||||
DWORD ID;
|
||||
BYTE DataCount;
|
||||
BYTE Data[8];
|
||||
}SLCAN_MESSAGE,*PSLCAN_MESSAGE;
|
||||
|
||||
typedef struct _SLCAN_TXMESSAGE{
|
||||
LONG dwDelay;
|
||||
SLCAN_MESSAGE Msg;
|
||||
}SLCAN_TXMESSAGE,*PSLCAN_TXMESSAGE;
|
||||
|
||||
typedef struct _SLCAN_EVENT{
|
||||
BYTE EventType;
|
||||
DWORD TimeStampLo;
|
||||
union {
|
||||
SLCAN_MESSAGE Msg;
|
||||
DWORD TimeStamp[2];
|
||||
DWORD64 TimeStamp64;
|
||||
struct {
|
||||
BYTE BusMode;
|
||||
BYTE Dummy1;
|
||||
BYTE ErrCountRx;
|
||||
BYTE ErrCountTx;
|
||||
BYTE ErrType;
|
||||
BYTE ErrDir;
|
||||
BYTE ErrFrame;
|
||||
BYTE LostArbitration;
|
||||
};
|
||||
};
|
||||
}SLCAN_EVENT,*PSLCAN_EVENT;
|
||||
|
||||
typedef struct _SLCAN_STATE{
|
||||
BYTE BusMode;
|
||||
BYTE Dummy1;
|
||||
BYTE ErrCountRX;
|
||||
BYTE ErrCountTX;
|
||||
}SLCAN_STATE,*PSLCAN_STATE;
|
||||
|
||||
typedef union _SLCAN_TIMESTAMP{
|
||||
UINT64 Value;
|
||||
DWORD dwValue[2];
|
||||
USHORT wValue[4];
|
||||
BYTE bValue[8];
|
||||
}SLCAN_TIMESTAMP,*PSLCAN_TIMESTAMP;
|
||||
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Load(
|
||||
SLCAN_DEVICE_CALLBACK DeviceProc,
|
||||
SLCAN_DEVICELIST_CALLBACK DeviceListProc
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Free(
|
||||
BOOL bDoCallBack
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_Update();
|
||||
|
||||
SLCANAPI HSLCAN STDCALL SlCan_GetDevice(
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_GetDeviceCount();
|
||||
|
||||
|
||||
SLCANAPI HANDLE STDCALL SlCan_DeviceGetHandle(
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetProperty(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetPropertyW(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex,
|
||||
PWCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI HKEY STDCALL SlCan_DeviceGetRegKey(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwIndex
|
||||
);
|
||||
|
||||
SLCANAPI PVOID STDCALL SlCan_DeviceSetContext(
|
||||
HSLCAN hDevice,
|
||||
PVOID pBuf,
|
||||
DWORD dwBufSize
|
||||
);
|
||||
|
||||
SLCANAPI PVOID STDCALL SlCan_DeviceGetContext(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetContextSize(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetAlias(
|
||||
HSLCAN hDevice,
|
||||
PCHAR pBuf
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetAliasW(
|
||||
HSLCAN hDevice,
|
||||
PWCHAR pBuf
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetAlias(
|
||||
HSLCAN hDevice,
|
||||
PCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
|
||||
SLCANAPI DWORD STDCALL SlCan_DeviceGetAliasW(
|
||||
HSLCAN hDevice,
|
||||
PWCHAR pBuf,
|
||||
DWORD dwSize
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetCapabilities(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_CAPABILITIES pCapabilities
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceOpen(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceClose(
|
||||
HSLCAN hDevice
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetMode(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwMode
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetMode(
|
||||
HSLCAN hDevice,
|
||||
PDWORD pdwMode
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetState(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_STATE pState
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetTXTimeOut(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwMillisecond
|
||||
);
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTXTimeOut(
|
||||
HSLCAN hDevice,
|
||||
PDWORD pdwMillisecond
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetBitRate(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_BITRATE pBitRate
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetBitRate(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_BITRATE pBitRate
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceEnaRec(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetLatency(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetLatency(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DevicePurge(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetEventLevel(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetEventLevel(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetStartTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetStartTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStamp(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TIMESTAMP pValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetTimeStampPeriod(
|
||||
HSLCAN hDevice,
|
||||
LONG lValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetTimeStampPeriod(
|
||||
HSLCAN hDevice,
|
||||
PLONG plValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceSetExMode(
|
||||
HSLCAN hDevice,
|
||||
BYTE bValue
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceGetExMode(
|
||||
HSLCAN hDevice,
|
||||
PBYTE pbValue
|
||||
);
|
||||
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessages(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_MESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PBYTE pbStatus
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceWriteMessagesEx(
|
||||
HSLCAN hDevice,
|
||||
PSLCAN_TXMESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PBYTE pbStatus,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceReadMessages(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwTimeOut,
|
||||
PSLCAN_MESSAGE pMsg,
|
||||
DWORD dwCount,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
SLCANAPI BOOL STDCALL SlCan_DeviceReadEvents(
|
||||
HSLCAN hDevice,
|
||||
DWORD dwTimeOut,
|
||||
PSLCAN_EVENT pEvent,
|
||||
DWORD dwCount,
|
||||
PDWORD pdwCount
|
||||
);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif //__SLCAN_H
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user