Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Kvaser LIN Device Driver #810

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/Application/MainFrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11943,6 +11943,12 @@ HRESULT CMainFrame::IntializeDILL(UINT unDefaultChannelCnt)
m_podMsgWndThread->PostThreadMessage(WM_MODIFY_VISIBILITY, SW_HIDE, (LONG)LIN);
}
}
else if (hResult == ERR_LOAD_DRIVER){
theApp.bWriteIntoTraceWnd(_("Driver Selection Failed"));
m_shLINDriverId = DAL_NONE; //select simulation
IntializeDILL();
m_podMsgWndThread->PostThreadMessage(WM_MODIFY_VISIBILITY, SW_HIDE, (LONG)LIN);
}
else
{
theApp.bWriteIntoTraceWnd(_("Selecting hardware interface failed"));
Expand Down
Binary file added Sources/BIN/Release/linlib.dll
Binary file not shown.
Binary file added Sources/BIN/busmaster_debug/linlib.dll
Binary file not shown.
16 changes: 16 additions & 0 deletions Sources/BUSMASTER.sln
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UDS_Protocol", "UDS_Protoco
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FLEXRAY_GIGATRONIK_FLEXI", "FLEXRAY_GIGATRONIK_FLEXI\FLEXRAY_GIGATRONIK_FLEXI.vcxproj", "{9D27029C-210A-4A16-8A8B-D9BD31CC821E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LIN_Kvaser", "..\..\..\..\XDiag\src-bs\Sources\LIN_Kvaser\LIN_Kvaser.vcxproj", "{3086F0A4-27AF-481C-B710-FAB650B6C9BE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
busmaster_debug|Win32 = busmaster_debug|Win32
Expand Down Expand Up @@ -842,6 +844,20 @@ Global
{9D27029C-210A-4A16-8A8B-D9BD31CC821E}.Unicode Release MinSize|Win32.Build.0 = Release|Win32
{9D27029C-210A-4A16-8A8B-D9BD31CC821E}.Unicode Release|Win32.ActiveCfg = Release|Win32
{9D27029C-210A-4A16-8A8B-D9BD31CC821E}.Unicode Release|Win32.Build.0 = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.busmaster_debug|Win32.ActiveCfg = busmaster_debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.busmaster_debug|Win32.Build.0 = busmaster_debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Debug|Win32.ActiveCfg = Debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Debug|Win32.Build.0 = Debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Release|Win32.ActiveCfg = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Release|Win32.Build.0 = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Template|Win32.ActiveCfg = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Template|Win32.Build.0 = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Debug|Win32.ActiveCfg = Debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Debug|Win32.Build.0 = Debug|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Release MinSize|Win32.ActiveCfg = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Release MinSize|Win32.Build.0 = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Release|Win32.ActiveCfg = Release|Win32
{3086F0A4-27AF-481C-B710-FAB650B6C9BE}.Unicode Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
4 changes: 4 additions & 0 deletions Sources/DIL_Interface/DIL_LIN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static ENTRY_DIL sg_ListDIL[] =
{DRIVER_LIN_ISOLAR_EVE_VLIN,"ETAS &ISOLAR-EVE"},
{DRIVER_LIN_PEAK_USB,"&PEAK USB"},
{DRIVER_LIN_VECTOR_XL, "&Vector XL"},
{DRIVER_LIN_KVASER, "&Kvaser LIN"},
};

CDIL_LIN::CDIL_LIN()
Expand Down Expand Up @@ -210,6 +211,9 @@ HRESULT CDIL_LIN::DILL_SelectDriver(DWORD dwDriverID, HWND hWndOwner,
break;
case DRIVER_LIN_PEAK_USB:
m_hDll = LoadLibrary("LIN_PEAK_USB.dll");
break;
case DRIVER_LIN_KVASER:
m_hDll = LoadLibrary("LIN_Kvaser.dll");
break;
default:
DILL_PerformClosureOperations();
Expand Down
1 change: 1 addition & 0 deletions Sources/DataTypes/DIL_Datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ enum
DRIVER_LIN_VECTOR_XL,
DRIVER_LIN_ETAS_BOA,
DRIVER_LIN_PEAK_USB,
DRIVER_LIN_KVASER,
DIL_LIN_TOTAL,
DAL_LIN_NONE = ~0x0
};
Expand Down
69 changes: 69 additions & 0 deletions Sources/LIN_Kvaser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
set(sources
../DIL_Interface/CommanDIL_LIN.cpp
LIN_Kvaser.cpp
LIN_Kvaser_stdafx.cpp
HardwareListing.cpp)

set(headers
../DIL_Interface/CommanDIL_LIN.h
LIN_Kvaser.h
LIN_Kvaser_Defs.h
LIN_Kvaser_Extern.h
LIN_Kvaser_Resource.h
LIN_Kvaser_stdafx.h
HardwareListing.h)

set(resources
LIN_Kvaser.rc)

#add_library(LIN_Kvaser_1_4 SHARED ${sources} ${headers} ${resources})
add_library(LIN_Kvaser_1_5 SHARED ${sources} ${headers} ${resources})
#add_library(LIN_Kvaser_2 SHARED ${sources} ${headers} ${resources})

include_directories(
..
${ICONV_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
${ATL_INCLUDE_DIRS}
${MFC_INCLUDE_DIRS})

# compiler options
add_definitions(-D_USRDLL)
#target_compile_definitions(LIN_Kvaser_1_4 PUBLIC -DBOA_VERSION=BOA_VERSION_1_4)
target_compile_definitions(LIN_Kvaser_1_5 PUBLIC -DBOA_VERSION=BOA_VERSION_1_5)
#target_compile_definitions(LIN_Kvaser_2 PUBLIC -DBOA_VERSION=BOA_VERSION_2)

# linker options
#set_target_properties(LIN_Kvaser_1_4 PROPERTIES LINK_FLAGS "/NODEFAULTLIB:daouuid")
set_target_properties(LIN_Kvaser_1_5 PROPERTIES LINK_FLAGS "/NODEFAULTLIB:daouuid")
#set_target_properties(LIN_Kvaser_2 PROPERTIES LINK_FLAGS "/NODEFAULTLIB:daouuid")
#target_link_libraries(LIN_Kvaser_1_4
# Advapi32
# DataTypes
# Utils)
target_link_libraries(LIN_Kvaser_1_5
Advapi32
DataTypes
Utils)
#target_link_libraries(LIN_Kvaser_2
# Advapi32
# DataTypes
# Utils)

# installer options
#add_custom_command(
# TARGET LIN_Kvaser_1_4
# POST_BUILD
# COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/
# COMMAND ${CMAKE_COMMAND} ARGS -E copy $<TARGET_FILE:LIN_Kvaser_1_4> ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/)
add_custom_command(
TARGET LIN_Kvaser_1_5
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/
COMMAND ${CMAKE_COMMAND} ARGS -E copy $<TARGET_FILE:LIN_Kvaser_1_5> ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/LIN_Kvaser.dll)
# COMMAND ${CMAKE_COMMAND} ARGS -E copy $<TARGET_FILE:LIN_Kvaser_1_5> ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/)
#add_custom_command(
# TARGET LIN_Kvaser_2
# POST_BUILD
# COMMAND ${CMAKE_COMMAND} ARGS -E make_directory ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/
# COMMAND ${CMAKE_COMMAND} ARGS -E copy $<TARGET_FILE:LIN_Kvaser_2> ${PROJECT_SOURCE_DIR}/BIN/${CMAKE_BUILD_TYPE}/)
Binary file added Sources/LIN_Kvaser/Doc/73-30130-00269-2_EN_70.pdf
Binary file not shown.
Binary file not shown.
Loading