diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dfe0770 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 58a5fe8..da72e17 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -37,5 +37,4 @@ jobs: working-directory: ${{env.GITHUB_WORKSPACE}} # Add additional options to the MSBuild command line here (like platform or verbosity level). # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - # run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} - run: ${{env.SOLUTION_FILE_PATH}}\x64_build.bat NOVARS NOTRIAL + run: ${{env.SOLUTION_FILE_PATH}}\x64_build.bat NOVARS NOTRIAL NODEBUG diff --git a/.gitignore b/.gitignore index 0a74924..094c99b 100644 --- a/.gitignore +++ b/.gitignore @@ -60,5 +60,7 @@ artifacts Binaries Includes Testing -*.pdf +.vscode +*.exe *.log +*.pdf diff --git a/Examples/C++/.gitignore b/Examples/C++/.gitignore index a920976..1617d61 100644 --- a/Examples/C++/.gitignore +++ b/Examples/C++/.gitignore @@ -3,6 +3,5 @@ x64 x86 Debug Release -C++ *.sln *.vcxproj.user diff --git a/Examples/C++/can_recv.cpp b/Examples/C++/can_recv.cpp index b985d3c..ce3593a 100644 --- a/Examples/C++/can_recv.cpp +++ b/Examples/C++/can_recv.cpp @@ -1,3 +1,9 @@ +#ifdef _MSC_VER +//no Microsoft extensions please! +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif #include #include #include @@ -66,7 +72,7 @@ int main(int argc, const char * argv[]) { teardown: if ((retVal = myDriver.TeardownChannel()) != CCanApi::NoError) std::cerr << "+++ error: interface could not be shutdown" << std::endl; - std::cerr << "Cheers!" << std::endl; + std::cout << "Cheers!" << std::endl; return retVal; } diff --git a/Examples/C++/can_recv.vcxproj b/Examples/C++/can_recv.vcxproj index bb22015..ddef00b 100644 --- a/Examples/C++/can_recv.vcxproj +++ b/Examples/C++/can_recv.vcxproj @@ -1,5 +1,5 @@ - + Debug @@ -19,9 +19,9 @@ - 15.0 - {F3FEE868-258D-4D66-98AD-12DCD815E770} + 17.0 Win32Proj + {8f3f8210-5433-42f5-98f8-24dd44c90d7d} canrecv 10.0 @@ -70,89 +70,61 @@ - - true - - - true - - - false - - - false - - - Level3 - Disabled true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreadedDebug Console true - ..\..\Binaries\x86\lib\uvKvaserCAN.lib;..\..\Binaries\x86\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\uvKvaserCAN.lib;%(AdditionalDependencies) - + - - Level3 - Disabled + true + true true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreadedDebug Console + true + true true - ..\..\Binaries\x64\lib\uvKvaserCAN.lib;..\..\Binaries\x64\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\uvKvaserCAN.lib;%(AdditionalDependencies) - + - - Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=1 + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreaded Console - true - true true - ..\..\Binaries\x86\uvKvaserCAN.lib;%(AdditionalDependencies) + ..\..\Binaries\x64\uvKvaserCAN.lib;%(AdditionalDependencies) - - Level3 - MaxSpeed true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions);OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=1 + NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreaded Console @@ -166,11 +138,9 @@ - - - - - + + + diff --git a/Examples/C++/can_recv.vcxproj.filters b/Examples/C++/can_recv.vcxproj.filters index 7c69b92..b3ed525 100644 --- a/Examples/C++/can_recv.vcxproj.filters +++ b/Examples/C++/can_recv.vcxproj.filters @@ -3,11 +3,11 @@ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -20,19 +20,13 @@ - + Header Files - + Header Files - - Header Files - - - Header Files - - + Header Files diff --git a/Examples/C++/can_send.cpp b/Examples/C++/can_send.cpp index 614ca0c..ba51ec2 100644 --- a/Examples/C++/can_send.cpp +++ b/Examples/C++/can_send.cpp @@ -1,3 +1,9 @@ +#ifdef _MSC_VER +//no Microsoft extensions please! +#ifndef _CRT_SECURE_NO_WARNINGS +#define _CRT_SECURE_NO_WARNINGS 1 +#endif +#endif #include #if !defined(_WIN32) && !defined(_WIN64) #include @@ -64,6 +70,6 @@ int main(int argc, const char * argv[]) { end: if ((result = can_exit(handle)) < CANERR_NOERROR) std::cerr << "+++ error: interface could not be shutdown" << std::endl; - std::cerr << "Cheers!" << std::endl; + std::cout << "Cheers!" << std::endl; return result; } diff --git a/Examples/C++/can_send.vcxproj b/Examples/C++/can_send.vcxproj index e7b558f..2f176bf 100644 --- a/Examples/C++/can_send.vcxproj +++ b/Examples/C++/can_send.vcxproj @@ -1,5 +1,5 @@ - + Debug @@ -19,9 +19,9 @@ - 15.0 - {1CC03006-A9CA-4AE2-8ED4-71FA28C7CDA5} + 17.0 Win32Proj + {9204cca3-7b61-4e28-b5ca-f6e1f176ed70} cansend 10.0 @@ -70,89 +70,61 @@ - - true - - - true - - - false - - - false - - - Level3 - Disabled true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreadedDebug Console true - ..\..\Binaries\x86\lib\u3cankvl.lib;..\..\Binaries\x86\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\u3cankvl.lib;%(AdditionalDependencies) - + - - Level3 - Disabled + true + true true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreadedDebug Console + true + true true - ..\..\Binaries\x64\lib\u3cankvl.lib;..\..\Binaries\x64\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\u3cankvl.lib;%(AdditionalDependencies) - + - - Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);OPTION_CANAPI_DLLIMPORT=1 + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreaded Console - true - true true - ..\..\Binaries\x86\u3cankvl.lib;%(AdditionalDependencies) + ..\..\Binaries\x64\u3cankvl.lib;%(AdditionalDependencies) - - Level3 - MaxSpeed true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions);OPTION_CANAPI_DLLIMPORT=1 + NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true ..\..\Includes;%(AdditionalIncludeDirectories) - MultiThreaded Console @@ -163,14 +135,10 @@ - - + - - - diff --git a/Examples/C++/can_send.vcxproj.filters b/Examples/C++/can_send.vcxproj.filters index 8d044e7..f334585 100644 --- a/Examples/C++/can_send.vcxproj.filters +++ b/Examples/C++/can_send.vcxproj.filters @@ -23,14 +23,5 @@ Header Files - - Header Files - - - Header Files - - - Header Files - \ No newline at end of file diff --git a/Examples/Python/CANAPI.py b/Examples/Python/CANAPI.py index d947e30..4b325bb 100644 --- a/Examples/Python/CANAPI.py +++ b/Examples/Python/CANAPI.py @@ -2,7 +2,7 @@ # # CAN Interface API, Version 3 (Python Wrapper) # -# Copyright (c) 2005-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) +# Copyright (c) 2005-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) # All rights reserved. # # This file is part of CAN API V3. @@ -43,7 +43,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with CAN API V3. If not, see . +# along with CAN API V3. If not, see . # """ CAN API V3 Python Wrapper for generic CAN Interfaces. @@ -52,9 +52,9 @@ Interface API for various CAN interfaces from different vendors running under multiple operating systems. - $Author: makemake $ + $Author: haumea $ - $Rev: 1198 $ + $Rev: 1258 $ """ from ctypes import * import platform @@ -210,8 +210,9 @@ # Control of blocking read # -CANREAD_INFINITE = c_uint16(65535) # infinite time-out (blocking read) - +CANWAIT_INFINITE = 65535 # infinite time-out (blocking operation) +CANREAD_INFINITE = CANWAIT_INFINITE +CANWRITE_INFINITE = CANWAIT_INFINITE # CAN Status-register # @@ -762,5 +763,5 @@ def len2dlc(length): # have a great time print('Bye, bye!') -# * $Id: CANAPI.py 1198 2023-09-13 08:43:19Z makemake $ *** (c) UV Software, Berlin *** +# * $Id: CANAPI.py 1258 2024-03-19 21:35:15Z haumea $ *** (c) UV Software, Berlin *** # diff --git a/Libraries/CANAPI/ReadMe.txt b/Libraries/CANAPI/ReadMe.txt deleted file mode 100644 index 6db5c60..0000000 --- a/Libraries/CANAPI/ReadMe.txt +++ /dev/null @@ -1,32 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY: uvcankvl-Projektübersicht -======================================================================== - -Diese uvcankvl-DLL wurde vom Anwendungs-Assistenten für Sie erstellt. - -Diese Datei bietet eine Ãœbersicht über den Inhalt der einzelnen Dateien, aus -denen Ihre uvcankvl-Anwendung besteht. - - -uvcankvl.vcxproj - Dies ist die Hauptprojektdatei für VC++-Projekte, die mit dem Anwendungs-Assistenten generiert werden. Sie enthält Informationen über die Version von Visual C++, mit der die Datei generiert wurde, sowie über die Plattformen, Konfigurationen und Projektfunktionen, die im Anwendungs-Assistenten ausgewählt wurden. - -uvcankvl.vcxproj.filters - Dies ist die Filterdatei für VC++-Projekte, die mithilfe eines Anwendungs-Assistenten erstellt werden. Sie enthält Informationen über die Zuordnung zwischen den Dateien im Projekt und den Filtern. Diese Zuordnung wird in der IDE zur Darstellung der Gruppierung von Dateien mit ähnlichen Erweiterungen unter einem bestimmten Knoten verwendet (z. B. sind CPP-Dateien dem Filter "Quelldateien" zugeordnet). - -uvcankvl.cpp - Dies ist die Hauptquelldatei der DLL. - -///////////////////////////////////////////////////////////////////////////// -Andere Standarddateien: - -StdAfx.h, StdAfx.cpp - Mit diesen Dateien werden eine vorkompilierte Headerdatei (PCH) mit dem Namen uvcankvl.pch und eine vorkompilierte Typendatei mit dem Namen StdAfx.obj erstellt. - -///////////////////////////////////////////////////////////////////////////// -Weitere Hinweise: - -Der Anwendungs-Assistent weist Sie mit "TODO:"-Kommentaren auf Teile des -Quellcodes hin, die Sie ergänzen oder anpassen sollten. - -///////////////////////////////////////////////////////////////////////////// diff --git a/Libraries/CANAPI/Sources/dllmain.cpp b/Libraries/CANAPI/Sources/dllmain.cpp new file mode 100644 index 0000000..f266597 --- /dev/null +++ b/Libraries/CANAPI/Sources/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "pch.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/Libraries/CANAPI/Sources/framework.h b/Libraries/CANAPI/Sources/framework.h new file mode 100644 index 0000000..54b83e9 --- /dev/null +++ b/Libraries/CANAPI/Sources/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include diff --git a/Libraries/CANAPI/Sources/pch.cpp b/Libraries/CANAPI/Sources/pch.cpp new file mode 100644 index 0000000..64b7eef --- /dev/null +++ b/Libraries/CANAPI/Sources/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/Libraries/CANAPI/Sources/pch.h b/Libraries/CANAPI/Sources/pch.h new file mode 100644 index 0000000..885d5d6 --- /dev/null +++ b/Libraries/CANAPI/Sources/pch.h @@ -0,0 +1,13 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here +#include "framework.h" + +#endif //PCH_H diff --git a/Libraries/CANAPI/dllmain.cpp b/Libraries/CANAPI/dllmain.cpp deleted file mode 100644 index aa837bd..0000000 --- a/Libraries/CANAPI/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung. -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/Libraries/CANAPI/resource.h b/Libraries/CANAPI/resource.h index 9e1bb01..4375853 100644 --- a/Libraries/CANAPI/resource.h +++ b/Libraries/CANAPI/resource.h @@ -1,8 +1,8 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by Resource.rc +// Used by uvcankvl.rc -// Nächste Standardwerte für neue Objekte +// Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS diff --git a/Libraries/CANAPI/stdafx.cpp b/Libraries/CANAPI/stdafx.cpp deleted file mode 100644 index dd3396d..0000000 --- a/Libraries/CANAPI/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. -// uvcankvl.pch ist der vorkompilierte Header. -// stdafx.obj enthält die vorkompilierten Typinformationen. - -#include "stdafx.h" - -// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H -// und nicht in dieser Datei erforderlich sind. diff --git a/Libraries/CANAPI/stdafx.h b/Libraries/CANAPI/stdafx.h deleted file mode 100644 index 9feeebb..0000000 --- a/Libraries/CANAPI/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h: Includedatei für Standardsystem-Includedateien -// oder häufig verwendete projektspezifische Includedateien, -// die nur in unregelmäßigen Abständen geändert werden. -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Selten verwendete Komponenten aus Windows-Headern ausschließen -// Windows-Headerdateien: -#include - - - -// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen. diff --git a/Libraries/CANAPI/targetver.h b/Libraries/CANAPI/targetver.h deleted file mode 100644 index a765413..0000000 --- a/Libraries/CANAPI/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert. - -// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und -// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen. - -#include diff --git a/Libraries/CANAPI/Resource.rc b/Libraries/CANAPI/uvcankvl.rc similarity index 91% rename from Libraries/CANAPI/Resource.rc rename to Libraries/CANAPI/uvcankvl.rc index 232631d..c6b443c 100644 Binary files a/Libraries/CANAPI/Resource.rc and b/Libraries/CANAPI/uvcankvl.rc differ diff --git a/Libraries/CANAPI/uvcankvl.vcxproj b/Libraries/CANAPI/uvcankvl.vcxproj index e4df13a..7a7c7b4 100644 --- a/Libraries/CANAPI/uvcankvl.vcxproj +++ b/Libraries/CANAPI/uvcankvl.vcxproj @@ -1,5 +1,5 @@ - - + + Debug_dll @@ -35,8 +35,9 @@ - {FEAC6665-03B4-4C32-8B7F-A4A93A87F58B} + 17.0 Win32Proj + {6f6a68f4-44e0-486e-bbd9-9e5736759a94} uvcankvl 10.0 @@ -124,171 +125,154 @@ - true u3cankvl - true u3cankvl - - true + u3cankvl - - true + u3cankvl - - false + u3cankvl - - false + u3cankvl - false u3cankvl - false u3cankvl - Use Level3 - Disabled true - WIN32;_DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + WIN32;_DEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows true ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - Use Level3 - Disabled true - WIN32;_DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + WIN32;_DEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) MultiThreadedDebug - $(IntDir)u3cankvl Windows true ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - - MachineX86 - - + - Use Level3 - Disabled + true + true true - _DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + WIN32;NDEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows + true + true true - ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - Disabled + true + true true - _DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + WIN32;NDEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreadedDebug - $(IntDir)u3cankvl + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows + true + true true - ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + _DEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows - true - true true - ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + _DEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreaded - $(IntDir)u3cankvl + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows - true - true true - ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - - MachineX86 - - Use Level3 - MaxSpeed true true true - NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + NDEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows @@ -296,22 +280,20 @@ true true ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - Use Level3 - MaxSpeed true true true - NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_COMPANIONS=1 + NDEBUG;UVCANKVL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_DLLEXPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreaded - $(IntDir)u3cankvl + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows @@ -319,26 +301,27 @@ true true ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false + + - - - - NotUsing - NotUsing + NotUsing NotUsing - NotUsing - NotUsing + NotUsing + NotUsing NotUsing NotUsing + NotUsing + NotUsing - + NotUsing NotUsing NotUsing @@ -348,20 +331,20 @@ NotUsing NotUsing - - Create - Create + + Create Create + Create + Create Create Create Create Create - - + diff --git a/Libraries/CANAPI/uvcankvl.vcxproj.filters b/Libraries/CANAPI/uvcankvl.vcxproj.filters index 96610f5..2297319 100644 --- a/Libraries/CANAPI/uvcankvl.vcxproj.filters +++ b/Libraries/CANAPI/uvcankvl.vcxproj.filters @@ -1,13 +1,13 @@  - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -15,24 +15,18 @@ - + Header Files - + Header Files Header Files - - Header Files - - - Source Files - - + Source Files @@ -41,9 +35,12 @@ Source Files + + Source Files + - + Resource Files diff --git a/Libraries/KvaserCAN/Resource.rc b/Libraries/KvaserCAN/KvaserCAN.rc similarity index 91% rename from Libraries/KvaserCAN/Resource.rc rename to Libraries/KvaserCAN/KvaserCAN.rc index 0657b61..c6b443c 100644 Binary files a/Libraries/KvaserCAN/Resource.rc and b/Libraries/KvaserCAN/KvaserCAN.rc differ diff --git a/Libraries/KvaserCAN/KvaserCAN.vcxproj b/Libraries/KvaserCAN/KvaserCAN.vcxproj index 7bdefb5..7413f3d 100644 --- a/Libraries/KvaserCAN/KvaserCAN.vcxproj +++ b/Libraries/KvaserCAN/KvaserCAN.vcxproj @@ -1,5 +1,5 @@ - - + + Debug_dll @@ -35,8 +35,9 @@ - {FEAC6665-03B4-4C32-8B7F-A4A93A87F58B} + 17.0 Win32Proj + {ecb1736f-055b-4003-8e99-b8ec6db98b9f} KvaserCAN 10.0 @@ -124,171 +125,154 @@ - true uvKvaserCAN - true uvKvaserCAN - - true + uvKvaserCAN - - true + uvKvaserCAN - - false + uvKvaserCAN - - false + uvKvaserCAN - false uvKvaserCAN - false uvKvaserCAN - Use Level3 - Disabled true - WIN32;_DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;_DEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows true ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - Use Level3 - Disabled true - WIN32;_DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;_DEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) MultiThreadedDebug - $(IntDir)uvKvaserCAN.pdb Windows true ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - - MachineX86 - - + - Use Level3 - Disabled + true + true true - _DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;NDEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows + true + true true - ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - Disabled + true + true true - _DEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;NDEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreadedDebug - $(IntDir)uvKvaserCAN.pdb + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows + true + true true - ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + _DEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows - true - true true - ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - + - Use Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + _DEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreaded - $(IntDir)uvKvaserCAN.pdb + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + MultiThreadedDebug Windows - true - true true - ..\..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) + ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - - MachineX86 - - Use Level3 - MaxSpeed true true true - NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + NDEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows @@ -296,22 +280,20 @@ true true ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false - Use Level3 - MaxSpeed true true true - NDEBUG;CANAPI_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANAPI_LIBRARY=0;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_COMPANIONS=1 + NDEBUG;KVASERCAN_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLEXPORT=1;OPTION_CANAPI_DLLEXPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 true - stdafx.h - ..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) - MultiThreaded - $(IntDir)uvKvaserCAN.pdb + Use + pch.h + .\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\CANlib;..\..\Sources\Wrapper;%(AdditionalIncludeDirectories) Windows @@ -319,24 +301,25 @@ true true ..\..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + false + + - - - NotUsing - NotUsing NotUsing NotUsing - NotUsing - NotUsing + NotUsing + NotUsing NotUsing NotUsing + NotUsing + NotUsing NotUsing @@ -358,20 +341,20 @@ NotUsing NotUsing - - Create - Create + + Create Create + Create + Create Create Create Create Create - - + diff --git a/Libraries/KvaserCAN/KvaserCAN.vcxproj.filters b/Libraries/KvaserCAN/KvaserCAN.vcxproj.filters index bc95a56..db0c93a 100644 --- a/Libraries/KvaserCAN/KvaserCAN.vcxproj.filters +++ b/Libraries/KvaserCAN/KvaserCAN.vcxproj.filters @@ -1,13 +1,13 @@  - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -15,38 +15,35 @@ - + Header Files - + Header Files Header Files - - Header Files - - + Source Files - + Source Files Source Files - + Source Files - + Source Files - + Resource Files diff --git a/Libraries/KvaserCAN/ReadMe.txt b/Libraries/KvaserCAN/ReadMe.txt deleted file mode 100644 index 6db5c60..0000000 --- a/Libraries/KvaserCAN/ReadMe.txt +++ /dev/null @@ -1,32 +0,0 @@ -======================================================================== - DYNAMIC LINK LIBRARY: uvcankvl-Projektübersicht -======================================================================== - -Diese uvcankvl-DLL wurde vom Anwendungs-Assistenten für Sie erstellt. - -Diese Datei bietet eine Ãœbersicht über den Inhalt der einzelnen Dateien, aus -denen Ihre uvcankvl-Anwendung besteht. - - -uvcankvl.vcxproj - Dies ist die Hauptprojektdatei für VC++-Projekte, die mit dem Anwendungs-Assistenten generiert werden. Sie enthält Informationen über die Version von Visual C++, mit der die Datei generiert wurde, sowie über die Plattformen, Konfigurationen und Projektfunktionen, die im Anwendungs-Assistenten ausgewählt wurden. - -uvcankvl.vcxproj.filters - Dies ist die Filterdatei für VC++-Projekte, die mithilfe eines Anwendungs-Assistenten erstellt werden. Sie enthält Informationen über die Zuordnung zwischen den Dateien im Projekt und den Filtern. Diese Zuordnung wird in der IDE zur Darstellung der Gruppierung von Dateien mit ähnlichen Erweiterungen unter einem bestimmten Knoten verwendet (z. B. sind CPP-Dateien dem Filter "Quelldateien" zugeordnet). - -uvcankvl.cpp - Dies ist die Hauptquelldatei der DLL. - -///////////////////////////////////////////////////////////////////////////// -Andere Standarddateien: - -StdAfx.h, StdAfx.cpp - Mit diesen Dateien werden eine vorkompilierte Headerdatei (PCH) mit dem Namen uvcankvl.pch und eine vorkompilierte Typendatei mit dem Namen StdAfx.obj erstellt. - -///////////////////////////////////////////////////////////////////////////// -Weitere Hinweise: - -Der Anwendungs-Assistent weist Sie mit "TODO:"-Kommentaren auf Teile des -Quellcodes hin, die Sie ergänzen oder anpassen sollten. - -///////////////////////////////////////////////////////////////////////////// diff --git a/Libraries/KvaserCAN/Sources/dllmain.cpp b/Libraries/KvaserCAN/Sources/dllmain.cpp new file mode 100644 index 0000000..f266597 --- /dev/null +++ b/Libraries/KvaserCAN/Sources/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "pch.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/Libraries/KvaserCAN/Sources/framework.h b/Libraries/KvaserCAN/Sources/framework.h new file mode 100644 index 0000000..54b83e9 --- /dev/null +++ b/Libraries/KvaserCAN/Sources/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include diff --git a/Libraries/KvaserCAN/Sources/pch.cpp b/Libraries/KvaserCAN/Sources/pch.cpp new file mode 100644 index 0000000..64b7eef --- /dev/null +++ b/Libraries/KvaserCAN/Sources/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/Libraries/KvaserCAN/Sources/pch.h b/Libraries/KvaserCAN/Sources/pch.h new file mode 100644 index 0000000..885d5d6 --- /dev/null +++ b/Libraries/KvaserCAN/Sources/pch.h @@ -0,0 +1,13 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here +#include "framework.h" + +#endif //PCH_H diff --git a/Libraries/KvaserCAN/dllmain.cpp b/Libraries/KvaserCAN/dllmain.cpp deleted file mode 100644 index aa837bd..0000000 --- a/Libraries/KvaserCAN/dllmain.cpp +++ /dev/null @@ -1,19 +0,0 @@ -// dllmain.cpp : Definiert den Einstiegspunkt für die DLL-Anwendung. -#include "stdafx.h" - -BOOL APIENTRY DllMain( HMODULE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - switch (ul_reason_for_call) - { - case DLL_PROCESS_ATTACH: - case DLL_THREAD_ATTACH: - case DLL_THREAD_DETACH: - case DLL_PROCESS_DETACH: - break; - } - return TRUE; -} - diff --git a/Libraries/KvaserCAN/resource.h b/Libraries/KvaserCAN/resource.h index 9e1bb01..5af3419 100644 --- a/Libraries/KvaserCAN/resource.h +++ b/Libraries/KvaserCAN/resource.h @@ -1,8 +1,8 @@ //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. -// Used by Resource.rc +// Used by KvaserCAN.rc -// Nächste Standardwerte für neue Objekte +// Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS diff --git a/Libraries/KvaserCAN/stdafx.cpp b/Libraries/KvaserCAN/stdafx.cpp deleted file mode 100644 index dd3396d..0000000 --- a/Libraries/KvaserCAN/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ -// stdafx.cpp : Quelldatei, die nur die Standard-Includes einbindet. -// uvcankvl.pch ist der vorkompilierte Header. -// stdafx.obj enthält die vorkompilierten Typinformationen. - -#include "stdafx.h" - -// TODO: Auf zusätzliche Header verweisen, die in STDAFX.H -// und nicht in dieser Datei erforderlich sind. diff --git a/Libraries/KvaserCAN/stdafx.h b/Libraries/KvaserCAN/stdafx.h deleted file mode 100644 index 9feeebb..0000000 --- a/Libraries/KvaserCAN/stdafx.h +++ /dev/null @@ -1,16 +0,0 @@ -// stdafx.h: Includedatei für Standardsystem-Includedateien -// oder häufig verwendete projektspezifische Includedateien, -// die nur in unregelmäßigen Abständen geändert werden. -// - -#pragma once - -#include "targetver.h" - -#define WIN32_LEAN_AND_MEAN // Selten verwendete Komponenten aus Windows-Headern ausschließen -// Windows-Headerdateien: -#include - - - -// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen. diff --git a/Libraries/KvaserCAN/targetver.h b/Libraries/KvaserCAN/targetver.h deleted file mode 100644 index a765413..0000000 --- a/Libraries/KvaserCAN/targetver.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -// Durch Einbeziehen von"SDKDDKVer.h" wird die höchste verfügbare Windows-Plattform definiert. - -// Wenn Sie die Anwendung für eine frühere Windows-Plattform erstellen möchten, schließen Sie "WinSDKVer.h" ein, und -// legen Sie das _WIN32_WINNT-Makro auf die zu unterstützende Plattform fest, bevor Sie "SDKDDKVer.h" einschließen. - -#include diff --git a/README.md b/README.md index 91cfc9e..7ee0880 100644 --- a/README.md +++ b/README.md @@ -124,11 +124,11 @@ Type `can_test /?` to display all program options. ### Development Environment -- Microsoft Visual Studio Community 2022 (Version 17.9.2) +- Microsoft Visual Studio Community 2022 (Version 17.9.5) ### Required Kvaser CANlib SDK -- Version 5.44 or later _(Latest is Greatest!)_ +- Version 5.0 or later _(Latest is Greatest!)_ ### Tested CAN Hardware diff --git a/Sources/CANAPI/CANAPI.h b/Sources/CANAPI/CANAPI.h index afaa697..c9b984c 100644 --- a/Sources/CANAPI/CANAPI.h +++ b/Sources/CANAPI/CANAPI.h @@ -2,7 +2,7 @@ // // CAN Interface API, Version 3 (Interface Definition) // -// Copyright (c) 2004-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) +// Copyright (c) 2004-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) // All rights reserved. // // This file is part of CAN API V3. @@ -43,7 +43,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with CAN API V3. If not, see . +// along with CAN API V3. If not, see . // /// \file CANAPI.h // @@ -75,7 +75,7 @@ /// /// \author $Author: haumea $ // -/// \version $Rev: 1225 $ +/// \version $Rev: 1260 $ // /// \defgroup can_api CAN Interface API, Version 3 /// \{ @@ -520,4 +520,4 @@ class CANCPP CCanApi { /// \} #endif // CANAPI_H_INCLUDED /// \} -// $Id: CANAPI.h 1225 2023-11-21 18:26:20Z haumea $ Copyright (c) UV Software // +// $Id: CANAPI.h 1260 2024-03-24 15:16:47Z haumea $ Copyright (c) UV Software // diff --git a/Sources/CANAPI/CANAPI_Defines.h b/Sources/CANAPI/CANAPI_Defines.h index 66c3161..0e24424 100644 --- a/Sources/CANAPI/CANAPI_Defines.h +++ b/Sources/CANAPI/CANAPI_Defines.h @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (Definitions and Options) * - * Copyright (c) 2004-2021 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2004-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,15 +43,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file CANAPI_Defines.h * * @brief CAN API V3 for generic CAN Interfaces - Definitions and Options * - * @author $Author: eris $ + * @author $Author: haumea $ * - * @version $Rev: 993 $ + * @version $Rev: 1259 $ * * @addtogroup can_api * @{ diff --git a/Sources/CANAPI/CANAPI_Types.h b/Sources/CANAPI/CANAPI_Types.h index 84f43e1..880bb6e 100644 --- a/Sources/CANAPI/CANAPI_Types.h +++ b/Sources/CANAPI/CANAPI_Types.h @@ -43,7 +43,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file CANAPI_Types.h * @@ -51,7 +51,7 @@ * * @author $Author: haumea $ * - * @version $Rev: 1249 $ + * @version $Rev: 1259 $ * * @addtogroup can_api * @{ diff --git a/Sources/CANAPI/CANBTR_Defaults.h b/Sources/CANAPI/CANBTR_Defaults.h index 41a0597..7cf5bd2 100644 --- a/Sources/CANAPI/CANBTR_Defaults.h +++ b/Sources/CANAPI/CANBTR_Defaults.h @@ -43,15 +43,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file CANBTR_Defines.h * * @brief CAN API V3 for generic CAN Interfaces - Definitions and Options * - * @author $Author: quaoar $ + * @author $Author: haumea $ * - * @version $Rev: 1256 $ + * @version $Rev: 1259 $ * * @addtogroup can_btr * @{ diff --git a/Sources/CANAPI/README.md b/Sources/CANAPI/README.md index baf7106..5512ad9 100644 --- a/Sources/CANAPI/README.md +++ b/Sources/CANAPI/README.md @@ -3,7 +3,7 @@ _Copyright © 2004-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com)_ \ _All rights reserved._ -Version $Rev: 1256 $ +Version $Rev: 1260 $ # A CAN Interface Wrapper Specification diff --git a/Sources/CANAPI/can_api.h b/Sources/CANAPI/can_api.h index 34d4664..ea72f83 100644 --- a/Sources/CANAPI/can_api.h +++ b/Sources/CANAPI/can_api.h @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (generic) * - * Copyright (c) 2004-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2004-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,15 +43,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file can_api.h * * @brief CAN API V3 for generic CAN Interfaces * - * @author $Author: eris $ + * @author $Author: haumea $ * - * @version $Rev: 1090 $ + * @version $Rev: 1260 $ * * @defgroup can_api CAN Interface API, Version 3 * @{ @@ -136,7 +136,7 @@ typedef int can_handle_t; #elif (OPTION_CANAPI_DRIVER != 0) #define CAN_BOARD(lib, brd) brd #else -#error Remove the unneeded definition(s)! +#error Remove the unneeded definition(s) #endif /* ----------- types -------------------------------------------------- diff --git a/Sources/CANAPI/can_btr.c b/Sources/CANAPI/can_btr.c index c490444..79b1736 100644 --- a/Sources/CANAPI/can_btr.c +++ b/Sources/CANAPI/can_btr.c @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (Bit-rate Conversion) * - * Copyright (c) 2017-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2017-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,7 +43,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file can_btr.c * @@ -55,9 +55,9 @@ * | SJW | BRP |SAM| TSEG2 | TSEG1 |
* +-7-+-6-+-5-+---+---+---+---+-0-+-7-+-6-+---+-4-+-3-+---+---+-0-+
* - * @author $Author: makemake $ + * @author $Author: haumea $ * - * @version $Rev: 1186 $ + * @version $Rev: 1259 $ * * @addtogroup can_btr * @{ diff --git a/Sources/CANAPI/can_btr.h b/Sources/CANAPI/can_btr.h index 7f8a318..cedf91c 100644 --- a/Sources/CANAPI/can_btr.h +++ b/Sources/CANAPI/can_btr.h @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (Bit-rate Conversion) * - * Copyright (c) 2017-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2017-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,7 +43,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file can_btr.h * @@ -51,7 +51,7 @@ * * @author $Author: haumea $ * - * @version $Rev: 1096 $ + * @version $Rev: 1259 $ * * @defgroup can_btr CAN Bit-rate Conversion * @{ diff --git a/Sources/CANAPI/can_msg.c b/Sources/CANAPI/can_msg.c index fa403ce..fe4f7ec 100644 --- a/Sources/CANAPI/can_msg.c +++ b/Sources/CANAPI/can_msg.c @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (Message Formatter) * - * Copyright (c) 2019-2023 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2019-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,15 +43,15 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file can_msg.c * * @brief CAN Message Formatter * - * @author $Author: makemake $ + * @author $Author: haumea $ * - * @version $Rev: 1187 $ + * @version $Rev: 1259 $ * * @addtogroup can_msg * @{ diff --git a/Sources/CANAPI/can_msg.h b/Sources/CANAPI/can_msg.h index 5b5fbaa..1ba6693 100644 --- a/Sources/CANAPI/can_msg.h +++ b/Sources/CANAPI/can_msg.h @@ -2,7 +2,7 @@ /* * CAN Interface API, Version 3 (Message Formatter) * - * Copyright (c) 2019-2022 Uwe Vogt, UV Software, Berlin (info@uv-software.com) + * Copyright (c) 2019-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) * All rights reserved. * * This file is part of CAN API V3. @@ -43,7 +43,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with CAN API V3. If not, see . + * along with CAN API V3. If not, see . */ /** @file can_msg.h * @@ -51,7 +51,7 @@ * * @author $Author: haumea $ * - * @version $Rev: 1044 $ + * @version $Rev: 1259 $ * * @defgroup can_msg CAN Message Formatter * @{ diff --git a/Tests/kvl_testing.vcxproj b/Tests/kvl_testing.vcxproj index df7f808..be8717d 100644 --- a/Tests/kvl_testing.vcxproj +++ b/Tests/kvl_testing.vcxproj @@ -5,18 +5,10 @@ Debug Win32 - - Release - Win32 - Debug x64 - - Release - x64 - 17.0 @@ -32,26 +24,12 @@ v143 Unicode - - Application - false - v143 - true - Unicode - Application true v143 Unicode - - Application - false - v143 - true - Unicode - @@ -60,15 +38,9 @@ - - - - - - @@ -84,26 +56,7 @@ Console true - .\GoogleTest\build\x86-Debug\lib\gtest.lib;..\Binaries\x86\lib\uvKvaserCAN.lib;..\Binaries\x86\lib\canlib32.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_RETVALS=1;OPTION_CANCPP_DLLEXPORT=0;%(PreprocessorDefinitions) - true - .;.\Sources;..\Includes;.\GoogleTest\include;%(AdditionalIncludeDirectories) - Use - pch.h - - - Console - true - true - true + .\GoogleTest\build\x86-Debug\lib\gtest.lib;..\Binaries\x86\lib\Debug\uvKvaserCAN.lib;..\Binaries\x86\lib\Debug\canlib32.lib;%(AdditionalDependencies) @@ -120,48 +73,9 @@ Console true - .\GoogleTest\build\x64-Debug\lib\gtest.lib;..\Binaries\x64\lib\uvKvaserCAN.lib;..\Binaries\x64\lib\canlib32.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_RETVALS=1;OPTION_CANCPP_DLLEXPORT=0;%(PreprocessorDefinitions) - true - .;.\Sources;..\Includes;.\GoogleTest\include;%(AdditionalIncludeDirectories) - Use - pch.h - - - Console - true - true - true + .\GoogleTest\build\x64-Debug\lib\gtest.lib;..\Binaries\x64\lib\Debug\uvKvaserCAN.lib;..\Binaries\x64\lib\Debug\canlib32.lib;%(AdditionalDependencies) - - - - - - - - - - - - - - - - - - - - @@ -169,22 +83,16 @@ Create - Create Create - Create NotUsing - NotUsing NotUsing - NotUsing NotUsing - NotUsing NotUsing - NotUsing @@ -203,6 +111,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Trial/kvl_test.vcxproj b/Trial/kvl_test.vcxproj index f1a1909..254ac6a 100644 --- a/Trial/kvl_test.vcxproj +++ b/Trial/kvl_test.vcxproj @@ -1,43 +1,20 @@ - - + + Debug Win32 - - Release - Win32 - Debug x64 - - Release - x64 - - - - - - - - - - - - - - - - - - {212CE9B5-4040-4682-A5CA-D29A055ECE1B} + 17.0 Win32Proj - kvl_test + {358d8acd-af2a-42bf-86da-218c1a92a9f8} + kvltest 10.0 @@ -47,26 +24,12 @@ v143 Unicode - - Application - false - v143 - true - Unicode - Application true v143 Unicode - - Application - false - v143 - true - Unicode - @@ -75,96 +38,58 @@ - - - - - - - - true - - - true - - - false - - - false - - - Level3 - Disabled + true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 - ./Sources;../Sources;../Sources/CANAPI;../Sources/CANlib;../Sources/Wrapper;.\misc;%(AdditionalIncludeDirectories) + true + .\Sources;..\Sources;..\Sources\CANAPI;..\Sources\CANlib;..\Sources\Wrapper;%(AdditionalIncludeDirectories) Console true - ../Sources/CANlib/x86/canlib32.lib;%(AdditionalDependencies) + ..\Sources\CANlib\x86\canlib32.lib;%(AdditionalDependencies) - - Level3 - Disabled + true _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 - ./Sources;../Sources;../Sources/CANAPI;../Sources/CANlib;../Sources/Wrapper;%(AdditionalIncludeDirectories) + true + .\Sources;..\Sources;..\Sources\CANAPI;..\Sources\CANlib;..\Sources\Wrapper;%(AdditionalIncludeDirectories) Console true - ../Sources/CANlib/x64/canlib32.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 - ./Sources;../Sources;../Sources/CANAPI;../Sources/CANlib;../Sources/Wrapper;.\misc;%(AdditionalIncludeDirectories) - - - Console - true - true - true - ../Sources/CANlib/x86/canlib32.lib;%(AdditionalDependencies) - - - - - Level3 - - - MaxSpeed - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1 - ./Sources;../Sources;../Sources/CANAPI;../Sources/CANlib;../Sources/Wrapper;%(AdditionalIncludeDirectories) - - - Console - true - true - true - ../Sources/CANlib/x64/canlib32.lib;%(AdditionalDependencies) + ..\Sources\CANlib\x64\canlib32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + diff --git a/Trial/kvl_test.vcxproj.filters b/Trial/kvl_test.vcxproj.filters index bfd9ac4..ba5c4db 100644 --- a/Trial/kvl_test.vcxproj.filters +++ b/Trial/kvl_test.vcxproj.filters @@ -1,13 +1,13 @@  - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;xsd - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -24,7 +24,7 @@ Source Files - + Source Files @@ -53,5 +53,17 @@ Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + \ No newline at end of file diff --git a/Utilities/can_moni/Driver.h b/Utilities/can_moni/Driver.h index f43cb9a..4a79ec3 100644 --- a/Utilities/can_moni/Driver.h +++ b/Utilities/can_moni/Driver.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -// CAN Monitor for generic Interfaces (CAN API V3) +// CAN Monitor for Kvaser CAN Interfaces // // Copyright (c) 2007,2012-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) // @@ -15,7 +15,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // #ifndef DRIVER_H_INCLUDED #define DRIVER_H_INCLUDED @@ -36,12 +36,16 @@ #elif defined(__CYGWIN__) #define PLATFORM "Cygwin" #else -#error Unsupported architecture +#error Platform not supported #endif #if (OPTION_CAN_2_0_ONLY != 0) -#error Compilation with legacy CAN 2.0 frame format! +#ifdef _MSC_VER +#pragma message ( "Compilation with legacy CAN 2.0 frame format!" ) #else -#define CAN_FD_SUPPORTED 1 // don't touch that dial +#warning Compilation with legacy CAN 2.0 frame format! +#endif +#else +#define CAN_FD_SUPPORTED 1 // don't touch that dial! #endif #define MONITOR_INTEFACE "Kvaser CAN Interfaces" #define MONITOR_COPYRIGHT "2007,2012-2024 by Uwe Vogt, UV Software, Berlin" @@ -50,4 +54,25 @@ typedef CKvaserCAN CCanDriver; +#define BITRATE_1M(x) KVASER_CAN_BR_1M(x) +#define BITRATE_800K(x) KVASER_CAN_BR_800K(x) +#define BITRATE_500K(x) KVASER_CAN_BR_500K(x) +#define BITRATE_250K(x) KVASER_CAN_BR_250K(x) +#define BITRATE_125K(x) KVASER_CAN_BR_125K(x) +#define BITRATE_100K(x) KVASER_CAN_BR_100K(x) +#define BITRATE_50K(x) KVASER_CAN_BR_50K(x) +#define BITRATE_20K(x) KVASER_CAN_BR_20K(x) +#define BITRATE_10K(x) KVASER_CAN_BR_10K(x) + +#if (CAN_FD_SUPPORTED != 0) +#define BITRATE_FD_1M(x) KVASER_CAN_FD_BR_1M(x) +#define BITRATE_FD_500K(x) KVASER_CAN_FD_BR_500K(x) +#define BITRATE_FD_250K(x) KVASER_CAN_FD_BR_250K(x) +#define BITRATE_FD_125K(x) KVASER_CAN_FD_BR_125K(x) +#define BITRATE_FD_1M8M(x) KVASER_CAN_FD_BR_1M8M(x) +#define BITRATE_FD_500K4M(x) KVASER_CAN_FD_BR_500K4M(x) +#define BITRATE_FD_250K2M(x) KVASER_CAN_FD_BR_250K2M(x) +#define BITRATE_FD_125K1M(x) KVASER_CAN_FD_BR_125K1M(x) +#endif + #endif // DRIVER_H_INCLUDED diff --git a/Utilities/can_moni/Sources/main.cpp b/Utilities/can_moni/Sources/main.cpp index 5dd8714..bd98251 100644 --- a/Utilities/can_moni/Sources/main.cpp +++ b/Utilities/can_moni/Sources/main.cpp @@ -2,7 +2,7 @@ // // CAN Monitor for generic Interfaces (CAN API V3) // -// Copyright (c) 2007,2017-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) +// Copyright (c) 2007,2016-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // #include "Driver.h" #include "Timer.h" @@ -87,7 +87,8 @@ extern "C" { #define QUESTION_MARK 41 #define ABOUT 42 #define CHARACTER_MJU 43 -#define MAX_OPTIONS 44 +#define VERSION 44 +#define MAX_OPTIONS 45 static char* option[MAX_OPTIONS] = { (char*)"BAUDRATE", (char*)"bd", @@ -112,7 +113,8 @@ static char* option[MAX_OPTIONS] = { (char*)"LIST-BOARDS", (char*)"list", (char*)"TEST-BOARDS", (char*)"test", (char*)"HELP", (char*)"?", - (char*)"ABOUT", (char*)"\xB5" + (char*)"ABOUT", (char*)"\xB5", + (char*)"VERSION" }; static int get_exclusion(const char *arg); @@ -140,7 +142,7 @@ static const char APPLICATION[] = "CAN Monitor for " MONITOR_INTEFACE ", Version static const char COPYRIGHT[] = "Copyright (c) " MONITOR_COPYRIGHT; static const char WARRANTY[] = "This program comes with ABSOLUTELY NO WARRANTY!\n\n" \ "This is free software, and you are welcome to redistribute it\n" \ - "under certain conditions; type '/ABOUT' for details."; + "under certain conditions; type '/VERSION' for details."; static const char LICENSE[] = "This program is free software: you can redistribute it and/or modify\n" \ "it under the terms of the GNU General Public License as published by\n" \ "the Free Software Foundation, either version 3 of the License, or\n" \ @@ -219,7 +221,7 @@ int main(int argc, const char * argv[]) { /* scan command-line */ while ((optind = getOption(argc, (char**)argv, MAX_OPTIONS, option)) != EOF) { switch (optind) { - /* option `--baudrate=' (-b) */ + /* option `--baudrate=' (-b) */ case BAUDRATE_STR: case BAUDRATE_CHR: if ((bd++)) { @@ -255,7 +257,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--bitrate=' as string */ + /* option `--bitrate=' as string */ case BITRATE_STR: case BITRATE_CHR: if ((bd++)) { @@ -275,7 +277,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--verbose' (-v) */ + /* option `--verbose' (-v) */ case VERBOSE_STR: case VERBOSE_CHR: if (verbose) { @@ -288,7 +290,7 @@ int main(int argc, const char * argv[]) { } verbose = 1; break; - /* option `--mode=(2.0|FDF[+BRS])' (-m)*/ + /* option `--mode=(2.0|FDF[+BRS])' (-m) */ case OP_MODE_STR: case OP_MODE_CHR: if ((op++)) { @@ -299,13 +301,13 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /MODE\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "DEFAULT") || !_strcmpi(optarg, "CLASSIC") || !_strcmpi(optarg, "CLASSICAL") || - !_strcmpi(optarg, "CAN20") || !_strcmpi(optarg, "CAN2.0") || !_strcmpi(optarg, "2.0")) + if (!strcasecmp(optarg, "DEFAULT") || !strcasecmp(optarg, "CLASSIC") || !strcasecmp(optarg, "CLASSICAL") || + !strcasecmp(optarg, "CAN20") || !strcasecmp(optarg, "CAN2.0") || !strcasecmp(optarg, "2.0")) opMode.byte |= CANMODE_DEFAULT; #if (CAN_FD_SUPPORTED != 0) - else if (!_strcmpi(optarg, "CANFD") || !_strcmpi(optarg, "FD") || !_strcmpi(optarg, "FDF")) + else if (!strcasecmp(optarg, "CANFD") || !strcasecmp(optarg, "FD") || !strcasecmp(optarg, "FDF")) opMode.byte |= CANMODE_FDOE; - else if (!_strcmpi(optarg, "CANFD+BRS") || !_strcmpi(optarg, "FDF+BRS") || !_strcmpi(optarg, "FD+BRS")) + else if (!strcasecmp(optarg, "CANFD+BRS") || !strcasecmp(optarg, "FDF+BRS") || !strcasecmp(optarg, "FD+BRS")) opMode.byte |= CANMODE_FDOE | CANMODE_BRSE; #endif else { @@ -326,7 +328,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_SHRD; break; - /* option `--listen-only' */ + /* option `--listen-only' */ case OP_MON_STR: case OP_MONITOR_STR: if ((lo++)) { @@ -337,9 +339,9 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /MON\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte |= CANMODE_MON; - else if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + else if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte &= ~CANMODE_MON; else { fprintf(stderr, "%s: illegal argument for option /MON\n", basename(argv[0])); @@ -357,7 +359,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_MON; break; - /* option `--error-frames' */ + /* option `--error-frames' */ case OP_ERR_STR: if ((ef++)) { fprintf(stderr, "%s: duplicated option /ERR\n", basename(argv[0])); @@ -367,9 +369,9 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /ERR\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte |= CANMODE_ERR; - else if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + else if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte &= ~CANMODE_ERR; else { fprintf(stderr, "%s: illegal argument for option /ERR\n", basename(argv[0])); @@ -387,7 +389,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_ERR; break; - /* option `--no-extended-frames' */ + /* option `--no-extended-frames' */ case OP_XTD_STR: if ((xf++)) { fprintf(stderr, "%s: duplicated option /XTD\n", basename(argv[0])); @@ -397,16 +399,16 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /XTD\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte |= CANMODE_NXTD; - else if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + else if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte &= ~CANMODE_NXTD; else { fprintf(stderr, "%s: illegal argument for option /XTD\n", basename(argv[0])); return 1; } break; - /* option `--no-remote-frames' */ + /* option `--no-remote-frames' */ case OP_RTR_STR: if ((rf++)) { fprintf(stderr, "%s: duplicated option /RTR\n", basename(argv[0])); @@ -416,16 +418,16 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /RTR\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte |= CANMODE_NRTR; - else if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + else if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte &= ~CANMODE_NRTR; else { fprintf(stderr, "%s: illegal argument for option /RTR\n", basename(argv[0])); return 1; } break; - /* option `--time=(ABS|REL|ZERO)' (-t) */ + /* option `--time=(ABS|REL|ZERO)' (-t) */ case MODE_TIME_STR: case MODE_TIME_CHR: if ((mt++)) { @@ -451,7 +453,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--id=(HEX|DEC|OCT)' (-i) */ + /* option `--id=(HEX|DEC|OCT)' (-i) */ case MODE_ID_STR: case MODE_ID_CHR: if ((mi++)) { @@ -477,7 +479,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--data=(HEX|DEC|OCT)' (-d) */ + /* option `--data=(HEX|DEC|OCT)' (-d) */ case MODE_DATA_STR: case MODE_DATA_CHR: if ((md++)) { @@ -503,7 +505,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--ascii=(ON|OFF)' (-a) */ + /* option `--ascii=(ON|OFF)' (-a) */ case MODE_ASCII_STR: case MODE_ASCII_CHR: if ((ma++)) { @@ -656,19 +658,21 @@ int main(int argc, const char * argv[]) { /* option `--list-bitrates[=(2.0|FDF[+BRS])]' */ case LISTBITRATES_STR: if ((optarg = getOptionParameter()) != NULL) { - if (!_strcmpi(optarg, "DEFAULT") || !_strcmpi(optarg, "CLASSIC") || !_strcmpi(optarg, "CLASSICAL") || - !_strcmpi(optarg, "CAN20") || !_strcmpi(optarg, "CAN2.0") || !_strcmpi(optarg, "2.0")) + if (!strcasecmp(optarg, "DEFAULT") || !strcasecmp(optarg, "CLASSIC") || !strcasecmp(optarg, "CLASSICAL") || + !strcasecmp(optarg, "CAN20") || !strcasecmp(optarg, "CAN2.0") || !strcasecmp(optarg, "2.0")) brMode.byte |= CANMODE_DEFAULT; #if (CAN_FD_SUPPORTED != 0) - else if (!_strcmpi(optarg, "CANFD") || !_strcmpi(optarg, "FD") || !_strcmpi(optarg, "FDF")) + else if (!strcasecmp(optarg, "CANFD") || !strcasecmp(optarg, "FD") || !strcasecmp(optarg, "FDF")) brMode.byte |= CANMODE_FDOE; - else if (!_strcmpi(optarg, "CANFD+BRS") || !_strcmpi(optarg, "FDF+BRS") || !_strcmpi(optarg, "FD+BRS")) + else if (!strcasecmp(optarg, "CANFD+BRS") || !strcasecmp(optarg, "FDF+BRS") || !strcasecmp(optarg, "FD+BRS")) brMode.byte |= CANMODE_FDOE | CANMODE_BRSE; #endif else { fprintf(stderr, "%s: illegal argument for option /LIST-BITRATES\n", basename(argv[0])); return 1; } + } else { + brMode.byte = CANMODE_DEFAULT; } fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); /* list standard bit-rates */ @@ -682,7 +686,7 @@ int main(int argc, const char * argv[]) { num_boards = CCanDevice::ListCanDevices(/*getOptionParameter()*/); fprintf(stdout, "Number of supported CAN interfaces: %i\n", num_boards); return (num_boards >= 0) ? 0 : 1; - /* option `--test-boards[=]' (-T) */ + /* option `--test-boards[=]' (-T) */ case TESTBOARDS_STR: case TESTBOARDS_CHR: fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); @@ -690,12 +694,13 @@ int main(int argc, const char * argv[]) { num_boards = CCanDevice::TestCanDevices(opMode/*, getOptionParameter()*/); fprintf(stdout, "Number of present CAN interfaces: %i\n", num_boards); return (num_boards >= 0) ? 0 : 1; - /* option `--help' (-h) */ + /* option `--help' (-h) */ case HELP: case QUESTION_MARK: usage(stdout, basename(argv[0])); return 0; case ABOUT: + case VERSION: case CHARACTER_MJU: version(stdout, basename(argv[0])); return 0; @@ -729,14 +734,16 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: not enough arguments\n", basename(argv[0])); return 1; } +#if (CAN_FD_SUPPORTED != 0) /* - check bit-timing index (n/a for CAN FD) */ if (opMode.fdoe && (bitrate.btr.frequency <= 0)) { fprintf(stderr, "%s: illegal combination of options /MODE and /BAUDRATE\n", basename(argv[0])); return 1; } +#endif /* CAN Monitor for generic CAN interfaces */ fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); - /* - show operation mode and bit-rate settings */ + /* - show operation mode, bit-rate settings and acceptance filter (if set) */ if (verbose) { fprintf(stdout, "Op.-mode=%s", (opMode.byte & CANMODE_FDOE) ? "CANFD" : "CAN2.0"); if ((opMode.byte & CANMODE_BRSE)) fprintf(stdout, "+BRS"); @@ -749,14 +756,16 @@ int main(int argc, const char * argv[]) { fprintf(stdout, " (op_mode=%02Xh)\n", opMode.byte); if (bitrate.btr.frequency > 0) { fprintf(stdout, "Bit-rate=%.0fkbps@%.1f%%", speed.nominal.speed / 1000., speed.nominal.samplepoint * 100.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.byte & CANMODE_BRSE) fprintf(stdout, ":%.0fkbps@%.1f%%", speed.data.speed / 1000., speed.data.samplepoint * 100.); +#endif (void)CCanDevice::MapBitrate2String(bitrate, property, CANPROP_MAX_BUFFER_SIZE, (opMode.byte & CANMODE_BRSE), hasNoSamp); - fprintf(stdout, " (%s)\n", property); + fprintf(stdout, " (%s)\n\n", property); } else { - fprintf(stdout, "Baudrate=%.0fkbps@%.1f%% (index %i)\n", + fprintf(stdout, "Baudrate=%.0fkbps@%.1f%% (index %i)\n\n", speed.nominal.speed / 1000., speed.nominal.samplepoint * 100., -bitrate.index); } @@ -800,10 +809,12 @@ int main(int argc, const char * argv[]) { /* - start communication */ if (bitrate.btr.frequency > 0) { fprintf(stdout, "Bit-rate=%.0fkbps", speed.nominal.speed / 1000.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.byte & CANMODE_BRSE) fprintf(stdout, ":%.0fkbps", speed.data.speed / 1000.); else if (opMode.byte & CANMODE_FDOE) fprintf(stdout, ":%.0fkbps", speed.nominal.speed / 1000.); +#endif fprintf(stdout, "..."); } else { @@ -891,7 +902,7 @@ int CCanDevice::TestCanDevices(CANAPI_OpMode_t opMode) { } int CCanDevice::ListCanBitrates(CANAPI_OpMode_t opMode) { - CANAPI_Bitrate_t bitrate[10]; + CANAPI_Bitrate_t bitrate[9]; CANAPI_BusSpeed_t speed; CANAPI_Return_t retVal; @@ -900,49 +911,54 @@ int CCanDevice::ListCanBitrates(CANAPI_OpMode_t opMode) { bool hasNoSamp = true; int i, n = 0; +#if (CAN_FD_SUPPORTED != 0) if (opMode.fdoe) { if (opMode.brse) { fprintf(stdout, "CAN FD with Bit-rate Switching (BRS):\n"); - KVASER_CAN_FD_BR_1M8M(bitrate[0]); - KVASER_CAN_FD_BR_500K4M(bitrate[1]); - KVASER_CAN_FD_BR_250K2M(bitrate[2]); - KVASER_CAN_FD_BR_125K1M(bitrate[3]); + BITRATE_FD_1M8M(bitrate[0]); + BITRATE_FD_500K4M(bitrate[1]); + BITRATE_FD_250K2M(bitrate[2]); + BITRATE_FD_125K1M(bitrate[3]); hasDataPhase = true; hasNoSamp = false; n = 4; } else { fprintf(stdout, "CAN FD without Bit-rate Switching (BRS):\n"); - KVASER_CAN_FD_BR_1M(bitrate[0]); - KVASER_CAN_FD_BR_500K(bitrate[1]); - KVASER_CAN_FD_BR_250K(bitrate[2]); - KVASER_CAN_FD_BR_125K(bitrate[3]); + BITRATE_FD_1M(bitrate[0]); + BITRATE_FD_500K(bitrate[1]); + BITRATE_FD_250K(bitrate[2]); + BITRATE_FD_125K(bitrate[3]); hasDataPhase = false; hasNoSamp = false; n = 4; } } else { +#else + { +#endif fprintf(stdout, "Classical CAN:\n"); - KVASER_CAN_BR_1M(bitrate[0]); - KVASER_CAN_BR_800K(bitrate[1]); - KVASER_CAN_BR_500K(bitrate[2]); - KVASER_CAN_BR_250K(bitrate[3]); - KVASER_CAN_BR_125K(bitrate[4]); - KVASER_CAN_BR_100K(bitrate[5]); - KVASER_CAN_BR_50K(bitrate[6]); - KVASER_CAN_BR_20K(bitrate[7]); - KVASER_CAN_BR_10K(bitrate[8]); - KVASER_CAN_BR_5K(bitrate[9]); + BITRATE_1M(bitrate[0]); + BITRATE_800K(bitrate[1]); + BITRATE_500K(bitrate[2]); + BITRATE_250K(bitrate[3]); + BITRATE_125K(bitrate[4]); + BITRATE_100K(bitrate[5]); + BITRATE_50K(bitrate[6]); + BITRATE_20K(bitrate[7]); + BITRATE_10K(bitrate[8]); hasDataPhase = false; hasNoSamp = true; - n = 10; + n = 9; } for (i = 0; i < n; i++) { if ((retVal = CCanDevice::MapBitrate2Speed(bitrate[i], speed)) == CCanApi::NoError) { fprintf(stdout, " %4.0fkbps@%.1f%%", speed.nominal.speed / 1000., speed.nominal.samplepoint * 100.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.brse) fprintf(stdout, ":%4.0fkbps@%.1f%%", speed.data.speed / 1000., speed.data.samplepoint * 100.); +#endif } strcpy(string, "=oops, something went wrong!"); (void)CCanDevice::MapBitrate2String(bitrate[i], string, CANPROP_MAX_BUFFER_SIZE, hasDataPhase, hasNoSamp); @@ -972,6 +988,7 @@ uint64_t CCanDevice::ReceptionLoop() { return frames; } +// FIXME: matured code from can_moni for BerliOS SocketCAN static int get_exclusion(const char *arg) { char *val, *end; @@ -1061,46 +1078,46 @@ static void usage(FILE *stream, const char *program) { fprintf(stream, "Usage: %s [
- - true - - - true - - - false - - - false - - - Level3 - Disabled true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true - .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\CANlib;%(AdditionalIncludeDirectories) + .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\PCANBasic;%(AdditionalIncludeDirectories) + MultiThreadedDebug Console true - ..\..\Binaries\x86\lib\uvKvaserCAN.lib;..\..\Binaries\x86\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\lib\Debug\uvKvaserCAN.lib;..\..\Binaries\x86\lib\Debug\canlib32.lib;%(AdditionalDependencies) - + - - Level3 - Disabled + true + true true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_COMPANIONS=1 + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true - .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\CANlib;%(AdditionalIncludeDirectories) + .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\PCANBasic;%(AdditionalIncludeDirectories) Console + true + true true - ..\..\Binaries\x64\lib\uvKvaserCAN.lib;..\..\Binaries\x64\lib\canlib32.lib;%(AdditionalDependencies) + ..\..\Binaries\x86\uvKvaserCAN.lib;%(AdditionalDependencies) - + - - Level3 - MaxSpeed - true - true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_COMPANIONS=1 + _DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true - .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\CANlib;%(AdditionalIncludeDirectories) + .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\PCANBasic;%(AdditionalIncludeDirectories) + MultiThreadedDebug Console - true - true true - ..\..\Binaries\x86\uvKvaserCAN.lib;%(AdditionalDependencies) + ..\..\Binaries\x64\lib\Debug\uvKvaserCAN.lib;..\..\Binaries\x64\lib\Debug\canlib32.lib;%(AdditionalDependencies) - - Level3 - MaxSpeed true true true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CAN_2_0_ONLY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANCPP_DLLIMPORT=1;OPTION_CANAPI_DLLIMPORT=0;OPTION_CANAPI_COMPANIONS=1 + NDEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;OPTION_CANCPP_DLLIMPORT=0;OPTION_CANAPI_DLLIMPORT=1;OPTION_CANAPI_LIBRARY=0;OPTION_CANAPI_DRIVER=1;OPTION_CANAPI_COMPANIONS=1;OPTION_CAN_2_0_ONLY=0 true - .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\CANlib;%(AdditionalIncludeDirectories) + .;.\Sources;..\..\Sources;..\..\Sources\CANAPI;..\..\Sources\Wrapper;..\..\Sources\PCANBasic;%(AdditionalIncludeDirectories) Console @@ -177,6 +136,25 @@ ..\..\Binaries\x64\uvKvaserCAN.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + diff --git a/Utilities/can_moni/can_moni.vcxproj.filters b/Utilities/can_moni/can_moni.vcxproj.filters index 2e4f2e5..c580a79 100644 --- a/Utilities/can_moni/can_moni.vcxproj.filters +++ b/Utilities/can_moni/can_moni.vcxproj.filters @@ -3,11 +3,11 @@ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} @@ -44,9 +44,6 @@ Header Files - - Header Files - Header Files @@ -62,5 +59,8 @@ Header Files + + Header Files +
\ No newline at end of file diff --git a/Utilities/can_test/Driver.h b/Utilities/can_test/Driver.h index f526323..af3e77c 100644 --- a/Utilities/can_test/Driver.h +++ b/Utilities/can_test/Driver.h @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-3.0-or-later // -// CAN Tester for generic Interfaces (CAN API V3) +// CAN Tester for Kvaser CAN Interfaces // // Copyright (c) 2008-2010,2014-2024 Uwe Vogt, UV Software, Berlin (info@uv-software.com) // @@ -15,7 +15,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // #ifndef DRIVER_H_INCLUDED #define DRIVER_H_INCLUDED @@ -36,12 +36,16 @@ #elif defined(__CYGWIN__) #define PLATFORM "Cygwin" #else -#error Unsupported architecture +#error Platform not supported #endif #if (OPTION_CAN_2_0_ONLY != 0) -#error Compilation with legacy CAN 2.0 frame format! +#ifdef _MSC_VER +#pragma message ( "Compilation with legacy CAN 2.0 frame format!" ) #else -#define CAN_FD_SUPPORTED 1 // don't touch that dial +#warning Compilation with legacy CAN 2.0 frame format! +#endif +#else +#define CAN_FD_SUPPORTED 1 // don't touch that dial! #endif #define TESTER_INTEFACE "Kvaser CAN Interfaces" #define TESTER_COPYRIGHT "2008-2010,2014-2024 by Uwe Vogt, UV Software, Berlin" @@ -50,4 +54,25 @@ typedef CKvaserCAN CCanDriver; +#define BITRATE_1M(x) KVASER_CAN_BR_1M(x) +#define BITRATE_800K(x) KVASER_CAN_BR_800K(x) +#define BITRATE_500K(x) KVASER_CAN_BR_500K(x) +#define BITRATE_250K(x) KVASER_CAN_BR_250K(x) +#define BITRATE_125K(x) KVASER_CAN_BR_125K(x) +#define BITRATE_100K(x) KVASER_CAN_BR_100K(x) +#define BITRATE_50K(x) KVASER_CAN_BR_50K(x) +#define BITRATE_20K(x) KVASER_CAN_BR_20K(x) +#define BITRATE_10K(x) KVASER_CAN_BR_10K(x) + +#if (CAN_FD_SUPPORTED != 0) +#define BITRATE_FD_1M(x) KVASER_CAN_FD_BR_1M(x) +#define BITRATE_FD_500K(x) KVASER_CAN_FD_BR_500K(x) +#define BITRATE_FD_250K(x) KVASER_CAN_FD_BR_250K(x) +#define BITRATE_FD_125K(x) KVASER_CAN_FD_BR_125K(x) +#define BITRATE_FD_1M8M(x) KVASER_CAN_FD_BR_1M8M(x) +#define BITRATE_FD_500K4M(x) KVASER_CAN_FD_BR_500K4M(x) +#define BITRATE_FD_250K2M(x) KVASER_CAN_FD_BR_250K2M(x) +#define BITRATE_FD_125K1M(x) KVASER_CAN_FD_BR_125K1M(x) +#endif + #endif // DRIVER_H_INCLUDED diff --git a/Utilities/can_test/Sources/main.cpp b/Utilities/can_test/Sources/main.cpp index 5f5ccf6..c84a2e2 100644 --- a/Utilities/can_test/Sources/main.cpp +++ b/Utilities/can_test/Sources/main.cpp @@ -15,7 +15,7 @@ // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// along with this program. If not, see . // #include "Driver.h" #include "Timer.h" @@ -94,7 +94,8 @@ extern "C" { #define QUESTION_MARK 46 #define ABOUT 47 #define CHARACTER_MJU 48 -#define MAX_OPTIONS 49 +#define VERSION 49 +#define MAX_OPTIONS 50 static char* option[MAX_OPTIONS] = { (char*)"BAUDRATE", (char*)"bd", @@ -120,7 +121,8 @@ static char* option[MAX_OPTIONS] = { (char*)"LIST-BOARDS", (char*)"list", (char*)"TEST-BOARDS", (char*)"test", (char*)"HELP", (char*)"?", - (char*)"ABOUT", (char*)"\xB5" + (char*)"ABOUT", (char*)"\xB5", + (char*)"VERSION" }; class CCanDevice : public CCanDriver { @@ -147,7 +149,7 @@ static const char APPLICATION[] = "CAN Tester for " TESTER_INTEFACE ", Version " static const char COPYRIGHT[] = "Copyright (c) " TESTER_COPYRIGHT; static const char WARRANTY[] = "This program comes with ABSOLUTELY NO WARRANTY!\n\n" \ "This is free software, and you are welcome to redistribute it\n" \ - "under certain conditions; type '/ABOUT' for details."; + "under certain conditions; type '/VERSION' for details."; static const char LICENSE[] = "This program is free software: you can redistribute it and/or modify\n" \ "it under the terms of the GNU General Public License as published by\n" \ "the Free Software Foundation, either version 3 of the License, or\n" \ @@ -210,7 +212,7 @@ int main(int argc, const char * argv[]) { /* scan command-line */ while ((optind = getOption(argc, (char**)argv, MAX_OPTIONS, option)) != EOF) { switch (optind) { - /* option `--baudrate=' (-b) */ + /* option `--baudrate=' (-b) */ case BAUDRATE_STR: case BAUDRATE_CHR: if ((bd++)) { @@ -246,7 +248,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--bitrate=' as string */ + /* option `--bitrate=' as string */ case BITRATE_STR: case BITRATE_CHR: if ((bd++)) { @@ -266,7 +268,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--verbose' (-v) */ + /* option `--verbose' (-v) */ case VERBOSE_STR: case VERBOSE_CHR: if (verbose) { @@ -279,7 +281,7 @@ int main(int argc, const char * argv[]) { } verbose = 1; break; - /* option `--mode=(2.0|FDF[+BRS])' (-m)*/ + /* option `--mode=(2.0|FDF[+BRS])' (-m) */ case OP_MODE_STR: case OP_MODE_CHR: if ((op++)) { @@ -290,13 +292,13 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /MODE\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "DEFAULT") || !_strcmpi(optarg, "CLASSIC") || !_strcmpi(optarg, "CLASSICAL") || - !_strcmpi(optarg, "CAN20") || !_strcmpi(optarg, "CAN2.0") || !_strcmpi(optarg, "2.0")) + if (!strcasecmp(optarg, "DEFAULT") || !strcasecmp(optarg, "CLASSIC") || !strcasecmp(optarg, "CLASSICAL") || + !strcasecmp(optarg, "CAN20") || !strcasecmp(optarg, "CAN2.0") || !strcasecmp(optarg, "2.0")) opMode.byte |= CANMODE_DEFAULT; #if (CAN_FD_SUPPORTED != 0) - else if (!_strcmpi(optarg, "CANFD") || !_strcmpi(optarg, "FD") || !_strcmpi(optarg, "FDF")) + else if (!strcasecmp(optarg, "CANFD") || !strcasecmp(optarg, "FD") || !strcasecmp(optarg, "FDF")) opMode.byte |= CANMODE_FDOE; - else if (!_strcmpi(optarg, "CANFD+BRS") || !_strcmpi(optarg, "FDF+BRS") || !_strcmpi(optarg, "FD+BRS")) + else if (!strcasecmp(optarg, "CANFD+BRS") || !strcasecmp(optarg, "FDF+BRS") || !strcasecmp(optarg, "FD+BRS")) opMode.byte |= CANMODE_FDOE | CANMODE_BRSE; #endif else { @@ -317,7 +319,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_SHRD; break; - /* option `--listen-only' */ + /* option `--listen-only' */ case OP_MON_STR: case OP_MONITOR_STR: if ((lo++)) { @@ -328,9 +330,9 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /MON\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte |= CANMODE_MON; - else if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + else if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte &= ~CANMODE_MON; else { fprintf(stderr, "%s: illegal argument for option /MON\n", basename(argv[0])); @@ -348,7 +350,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_MON; break; - /* option `--error-frames' */ + /* option `--error-frames' */ case OP_ERR_STR: if ((ef++)) { fprintf(stderr, "%s: duplicated option /ERR\n", basename(argv[0])); @@ -358,9 +360,9 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /ERR\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte |= CANMODE_ERR; - else if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + else if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte &= ~CANMODE_ERR; else { fprintf(stderr, "%s: illegal argument for option /ERR\n", basename(argv[0])); @@ -378,7 +380,7 @@ int main(int argc, const char * argv[]) { } opMode.byte |= CANMODE_ERR; break; - /* option `--no-extended-frames' */ + /* option `--no-extended-frames' */ case OP_XTD_STR: if ((xf++)) { fprintf(stderr, "%s: duplicated option /XTD\n", basename(argv[0])); @@ -388,16 +390,16 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /XTD\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte |= CANMODE_NXTD; - else if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + else if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte &= ~CANMODE_NXTD; else { fprintf(stderr, "%s: illegal argument for option /XTD\n", basename(argv[0])); return 1; } break; - /* option `--no-remote-frames' */ + /* option `--no-remote-frames' */ case OP_RTR_STR: if ((rf++)) { fprintf(stderr, "%s: duplicated option /RTR\n", basename(argv[0])); @@ -407,16 +409,16 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: missing argument for option /RTR\n", basename(argv[0])); return 1; } - if (!_strcmpi(optarg, "NO") || !_strcmpi(optarg, "N") || !_strcmpi(optarg, "OFF") || !_strcmpi(optarg, "0")) + if (!strcasecmp(optarg, "NO") || !strcasecmp(optarg, "N") || !strcasecmp(optarg, "OFF") || !strcasecmp(optarg, "0")) opMode.byte |= CANMODE_NRTR; - else if (!_strcmpi(optarg, "YES") || !_strcmpi(optarg, "Y") || !_strcmpi(optarg, "ON") || !_strcmpi(optarg, "1")) + else if (!strcasecmp(optarg, "YES") || !strcasecmp(optarg, "Y") || !strcasecmp(optarg, "ON") || !strcasecmp(optarg, "1")) opMode.byte &= ~CANMODE_NRTR; else { fprintf(stderr, "%s: illegal argument for option /RTR\n", basename(argv[0])); return 1; } break; - /* option `--receive' (-r) */ + /* option `--receive' (-r) */ case RECEIVE_STR: case RECEIVE_CHR: if ((m++)) { @@ -429,7 +431,7 @@ int main(int argc, const char * argv[]) { } mode = RxMODE; break; - /* option `--number=' (-n) */ + /* option `--number=' (-n) */ case NUMBER_STR: case NUMBER_CHR: if (n++) { @@ -449,7 +451,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--stop' (-s) */ + /* option `--stop' (-s) */ case STOP_STR: case STOP_CHR: if (stop_on_error) { @@ -462,7 +464,7 @@ int main(int argc, const char * argv[]) { } stop_on_error = 1; break; - /* option `--transmit=' (-t) in [s] */ + /* option `--transmit=' (-t) in [s] */ case TRANSMIT_STR: case TRANSMIT_CHR: if ((m++)) { @@ -483,7 +485,7 @@ int main(int argc, const char * argv[]) { } mode = TxMODE; break; - /* option `--frames=' (-f) */ + /* option `--frames=' (-f) */ case FRAMES_STR: case FRAMES_CHR: if ((m++)) { @@ -504,7 +506,7 @@ int main(int argc, const char * argv[]) { } mode = TxFRAMES; break; - /* option `--random=' */ + /* option `--random=' */ case RANDOM_STR: case RANDOM_CHR: if ((m++)) { @@ -527,7 +529,7 @@ int main(int argc, const char * argv[]) { can_dlc = 0; mode = TxRANDOM; break; - /* option `--cycle=' (-c) */ + /* option `--cycle=' (-c) */ case CYCLE_STR: case CYCLE_CHR: if ((t++)) { @@ -548,7 +550,7 @@ int main(int argc, const char * argv[]) { } delay *= 1000l; break; - /* option `--usec=' (-u) */ + /* option `--usec=' (-u) */ case USEC_STR: case USEC_CHR: if ((t++)) { @@ -568,7 +570,7 @@ int main(int argc, const char * argv[]) { return 1; } break; - /* option `--dlc=' (-d) */ + /* option `--dlc=' (-d) */ case DLC_STR: case DLC_CHR: case DLC_LEN: @@ -618,19 +620,21 @@ int main(int argc, const char * argv[]) { /* option `--list-bitrates[=(2.0|FDF[+BRS])]' */ case LISTBITRATES_STR: if ((optarg = getOptionParameter()) != NULL) { - if (!_strcmpi(optarg, "DEFAULT") || !_strcmpi(optarg, "CLASSIC") || !_strcmpi(optarg, "CLASSICAL") || - !_strcmpi(optarg, "CAN20") || !_strcmpi(optarg, "CAN2.0") || !_strcmpi(optarg, "2.0")) + if (!strcasecmp(optarg, "DEFAULT") || !strcasecmp(optarg, "CLASSIC") || !strcasecmp(optarg, "CLASSICAL") || + !strcasecmp(optarg, "CAN20") || !strcasecmp(optarg, "CAN2.0") || !strcasecmp(optarg, "2.0")) brMode.byte |= CANMODE_DEFAULT; #if (CAN_FD_SUPPORTED != 0) - else if (!_strcmpi(optarg, "CANFD") || !_strcmpi(optarg, "FD") || !_strcmpi(optarg, "FDF")) + else if (!strcasecmp(optarg, "CANFD") || !strcasecmp(optarg, "FD") || !strcasecmp(optarg, "FDF")) brMode.byte |= CANMODE_FDOE; - else if (!_strcmpi(optarg, "CANFD+BRS") || !_strcmpi(optarg, "FDF+BRS") || !_strcmpi(optarg, "FD+BRS")) + else if (!strcasecmp(optarg, "CANFD+BRS") || !strcasecmp(optarg, "FDF+BRS") || !strcasecmp(optarg, "FD+BRS")) brMode.byte |= CANMODE_FDOE | CANMODE_BRSE; #endif else { fprintf(stderr, "%s: illegal argument for option /LIST-BITRATES\n", basename(argv[0])); return 1; } + } else { + brMode.byte = CANMODE_DEFAULT; } fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); /* list standard bit-rates */ @@ -644,7 +648,7 @@ int main(int argc, const char * argv[]) { num_boards = CCanDevice::ListCanDevices(/*getOptionParameter()*/); fprintf(stdout, "Number of supported CAN interfaces: %i\n", num_boards); return (num_boards >= 0) ? 0 : 1; - /* option `--test-boards[=]' (-T) */ + /* option `--test-boards[=]' (-T) */ case TESTBOARDS_STR: case TESTBOARDS_CHR: fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); @@ -652,12 +656,13 @@ int main(int argc, const char * argv[]) { num_boards = CCanDevice::TestCanDevices(opMode/*, getOptionParameter()*/); fprintf(stdout, "Number of present CAN interfaces: %i\n", num_boards); return (num_boards >= 0) ? 0 : 1; - /* option `--help' (-h) */ + /* option `--help' (-h) */ case HELP: case QUESTION_MARK: usage(stdout, basename(argv[0])); return 0; case ABOUT: + case VERSION: case CHARACTER_MJU: version(stdout, basename(argv[0])); return 0; @@ -691,6 +696,7 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: not enough arguments\n", basename(argv[0])); return 1; } +#if (CAN_FD_SUPPORTED != 0) /* - check bit-timing index (n/a for CAN FD) */ if (opMode.fdoe && (bitrate.btr.frequency <= 0)) { fprintf(stderr, "%s: illegal combination of options /MODE and /BAUDRATE\n", basename(argv[0])); @@ -726,6 +732,7 @@ int main(int argc, const char * argv[]) { fprintf(stderr, "%s: illegal option /RTR:NO for transmitter test\n", basename(argv[0])); return 1; } +#endif /* CAN Tester for generic CAN interfaces */ fprintf(stdout, "%s\n%s\n\n%s\n\n", APPLICATION, COPYRIGHT, WARRANTY); /* - show operation mode and bit-rate settings */ @@ -741,8 +748,10 @@ int main(int argc, const char * argv[]) { fprintf(stdout, " (op_mode=%02Xh)\n", opMode.byte); if (bitrate.btr.frequency > 0) { fprintf(stdout, "Bit-rate=%.0fkbps@%.1f%%", speed.nominal.speed / 1000., speed.nominal.samplepoint * 100.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.byte & CANMODE_BRSE) fprintf(stdout, ":%.0fkbps@%.1f%%", speed.data.speed / 1000., speed.data.samplepoint * 100.); +#endif (void)CCanDevice::MapBitrate2String(bitrate, property, CANPROP_MAX_BUFFER_SIZE, (opMode.byte & CANMODE_BRSE), hasNoSamp); fprintf(stdout, " (%s)\n\n", property); @@ -769,10 +778,12 @@ int main(int argc, const char * argv[]) { /* - start communication */ if (bitrate.btr.frequency > 0) { fprintf(stdout, "Bit-rate=%.0fkbps", speed.nominal.speed / 1000.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.byte & CANMODE_BRSE) fprintf(stdout, ":%.0fkbps", speed.data.speed / 1000.); else if (opMode.byte & CANMODE_FDOE) fprintf(stdout, ":%.0fkbps", speed.nominal.speed / 1000.); +#endif fprintf(stdout, "..."); } else { @@ -873,7 +884,7 @@ int CCanDevice::TestCanDevices(CANAPI_OpMode_t opMode) { } int CCanDevice::ListCanBitrates(CANAPI_OpMode_t opMode) { - CANAPI_Bitrate_t bitrate[10]; + CANAPI_Bitrate_t bitrate[9]; CANAPI_BusSpeed_t speed; CANAPI_Return_t retVal; @@ -882,49 +893,54 @@ int CCanDevice::ListCanBitrates(CANAPI_OpMode_t opMode) { bool hasNoSamp = true; int i, n = 0; +#if (CAN_FD_SUPPORTED != 0) if (opMode.fdoe) { if (opMode.brse) { fprintf(stdout, "CAN FD with Bit-rate Switching (BRS):\n"); - KVASER_CAN_FD_BR_1M8M(bitrate[0]); - KVASER_CAN_FD_BR_500K4M(bitrate[1]); - KVASER_CAN_FD_BR_250K2M(bitrate[2]); - KVASER_CAN_FD_BR_125K1M(bitrate[3]); + BITRATE_FD_1M8M(bitrate[0]); + BITRATE_FD_500K4M(bitrate[1]); + BITRATE_FD_250K2M(bitrate[2]); + BITRATE_FD_125K1M(bitrate[3]); hasDataPhase = true; hasNoSamp = false; n = 4; } else { fprintf(stdout, "CAN FD without Bit-rate Switching (BRS):\n"); - KVASER_CAN_FD_BR_1M(bitrate[0]); - KVASER_CAN_FD_BR_500K(bitrate[1]); - KVASER_CAN_FD_BR_250K(bitrate[2]); - KVASER_CAN_FD_BR_125K(bitrate[3]); + BITRATE_FD_1M(bitrate[0]); + BITRATE_FD_500K(bitrate[1]); + BITRATE_FD_250K(bitrate[2]); + BITRATE_FD_125K(bitrate[3]); hasDataPhase = false; hasNoSamp = false; n = 4; } } else { +#else + { +#endif fprintf(stdout, "Classical CAN:\n"); - KVASER_CAN_BR_1M(bitrate[0]); - KVASER_CAN_BR_800K(bitrate[1]); - KVASER_CAN_BR_500K(bitrate[2]); - KVASER_CAN_BR_250K(bitrate[3]); - KVASER_CAN_BR_125K(bitrate[4]); - KVASER_CAN_BR_100K(bitrate[5]); - KVASER_CAN_BR_50K(bitrate[6]); - KVASER_CAN_BR_20K(bitrate[7]); - KVASER_CAN_BR_10K(bitrate[8]); - KVASER_CAN_BR_5K(bitrate[9]); + BITRATE_1M(bitrate[0]); + BITRATE_800K(bitrate[1]); + BITRATE_500K(bitrate[2]); + BITRATE_250K(bitrate[3]); + BITRATE_125K(bitrate[4]); + BITRATE_100K(bitrate[5]); + BITRATE_50K(bitrate[6]); + BITRATE_20K(bitrate[7]); + BITRATE_10K(bitrate[8]); hasDataPhase = false; hasNoSamp = true; - n = 10; + n = 9; } for (i = 0; i < n; i++) { if ((retVal = CCanDevice::MapBitrate2Speed(bitrate[i], speed)) == CCanApi::NoError) { fprintf(stdout, " %4.0fkbps@%.1f%%", speed.nominal.speed / 1000., speed.nominal.samplepoint * 100.); +#if (CAN_FD_SUPPORTED != 0) if (opMode.brse) fprintf(stdout, ":%4.0fkbps@%.1f%%", speed.data.speed / 1000., speed.data.samplepoint * 100.); +#endif } strcpy(string, "=oops, something went wrong!"); (void)CCanDevice::MapBitrate2String(bitrate[i], string, CANPROP_MAX_BUFFER_SIZE, hasDataPhase, hasNoSamp); @@ -948,8 +964,12 @@ uint64_t CCanDevice::TransmitterTest(time_t duration, CANAPI_OpMode_t opMode, ui message.id = id; message.xtd = 0; message.rtr = 0; +#if (CAN_FD_SUPPORTED != 0) message.fdf = opMode.fdoe; message.brs = opMode.brse; +#else + (void) opMode; +#endif message.dlc = dlc; fprintf(stdout, "\nTransmitting message(s)..."); fflush (stdout); @@ -962,7 +982,9 @@ uint64_t CCanDevice::TransmitterTest(time_t duration, CANAPI_OpMode_t opMode, ui message.data[5] = (uint8_t)((frames + offset) >> 40); message.data[6] = (uint8_t)((frames + offset) >> 48); message.data[7] = (uint8_t)((frames + offset) >> 56); +#if (CAN_FD_SUPPORTED != 0) memset(&message.data[8], 0, CANFD_MAX_LEN - 8); +#endif /* transmit message (repeat when busy) */ retry_tx_test: calls++; @@ -1012,8 +1034,12 @@ uint64_t CCanDevice::TransmitterTest(uint64_t count, CANAPI_OpMode_t opMode, boo message.id = id; message.xtd = 0; message.rtr = 0; +#if (CAN_FD_SUPPORTED != 0) message.fdf = opMode.fdoe; message.brs = opMode.brse; +#else + (void) opMode; +#endif message.dlc = dlc; fprintf(stdout, "\nTransmitting message(s)..."); fflush (stdout); @@ -1026,9 +1052,14 @@ uint64_t CCanDevice::TransmitterTest(uint64_t count, CANAPI_OpMode_t opMode, boo message.data[5] = (uint8_t)((frames + offset) >> 40); message.data[6] = (uint8_t)((frames + offset) >> 48); message.data[7] = (uint8_t)((frames + offset) >> 56); +#if (CAN_FD_SUPPORTED != 0) memset(&message.data[8], 0, CANFD_MAX_LEN - 8); if (random) message.dlc = dlc + (uint8_t)(rand() % ((CANFD_MAX_DLC - dlc) + 1)); +#else + if (random) + message.dlc = dlc + (uint8_t)(rand() % ((CAN_MAX_DLC - dlc) + 1)); +#endif /* transmit message (repeat when busy) */ retry_tx_test: calls++; @@ -1165,55 +1196,55 @@ static void usage(FILE *stream, const char *program) { fprintf(stream, "Usage: %s [