From a5e075d1cc602e268e98d21a01f00e89ca7d499c Mon Sep 17 00:00:00 2001 From: Uwe Vogt Date: Thu, 30 Jan 2025 19:42:53 +0100 Subject: [PATCH 01/15] Update version number Relates to [CANAPI-113] --- Sources/CANAPI/.gitignore | 3 +-- Sources/CANAPI/CANAPI_Version.h | 6 +++--- Sources/Version.h | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Sources/CANAPI/.gitignore b/Sources/CANAPI/.gitignore index cfaf4b6..21d8bf0 100644 --- a/Sources/CANAPI/.gitignore +++ b/Sources/CANAPI/.gitignore @@ -1,6 +1,4 @@ .svn -# Not realized yet -CANIPC_Message.h # we don't use the JSON files yet can_dev.? vanilla.? @@ -8,3 +6,4 @@ vanilla.? SerialCAN_Defines.h SocketCAN_Defines.h RocketCAN_Defines.h +CANIPC_Message.h diff --git a/Sources/CANAPI/CANAPI_Version.h b/Sources/CANAPI/CANAPI_Version.h index 4b43b95..b08c99f 100644 --- a/Sources/CANAPI/CANAPI_Version.h +++ b/Sources/CANAPI/CANAPI_Version.h @@ -55,15 +55,15 @@ * * @author $Author: makemake $ * - * @version $Rev: 1407 $ + * @version $Rev: 1418 $ * * @addtogroup can_api * @{ */ #ifndef CANAPI_VERSION_H_INCLUDED #define CANAPI_VERSION_H_INCLUDED -// SVN revision number (update with each commit: III) -#define CAN_API_REV "$Rev: 1407 $" +// SVN revision number (update with each commit: IV) +#define CAN_API_REV "$Rev: 1418 $" #endif /* CANAPI_VERSION_H_INCLUDED */ /** @} */ diff --git a/Sources/Version.h b/Sources/Version.h index 9787684..e2f6ca5 100644 --- a/Sources/Version.h +++ b/Sources/Version.h @@ -54,7 +54,7 @@ #ifdef _MSC_VER #define VERSION_MAJOR 0 #define VERSION_MINOR 6 -#define VERSION_PATCH 0 +#define VERSION_PATCH 99 #else #define VERSION_MAJOR 0 #define VERSION_MINOR 4 From 0944e7b702ec33a871264f83b5ada83350ede8f7 Mon Sep 17 00:00:00 2001 From: Uwe Vogt Date: Thu, 30 Jan 2025 19:54:50 +0100 Subject: [PATCH 02/15] Update CAN API V3 Utility sources to rev. 1420 Relates to [CANAPI-114] --- Utilities/can_moni/Driver.h | 16 ++++++++++++++-- Utilities/can_moni/Sources/.gitignore | 4 ---- Utilities/can_moni/Sources/Options.cpp | 4 ++-- Utilities/can_moni/Sources/Options.h | 8 ++++---- Utilities/can_moni/Sources/Options_p.cpp | 9 ++++++--- Utilities/can_moni/Sources/Options_w.cpp | 12 ++++++++---- Utilities/can_moni/Sources/main.cpp | 2 +- Utilities/can_test/Driver.h | 16 ++++++++++++++-- Utilities/can_test/Sources/Options.cpp | 4 ++-- Utilities/can_test/Sources/Options.h | 8 ++++---- Utilities/can_test/Sources/Options_p.cpp | 18 +++++++++--------- Utilities/can_test/Sources/Options_w.cpp | 15 ++++++++------- Utilities/can_test/Sources/main.cpp | 2 +- 13 files changed, 73 insertions(+), 45 deletions(-) diff --git a/Utilities/can_moni/Driver.h b/Utilities/can_moni/Driver.h index 889c831..53dde77 100644 --- a/Utilities/can_moni/Driver.h +++ b/Utilities/can_moni/Driver.h @@ -25,12 +25,24 @@ #if (OPTION_CAN_2_0_ONLY != 0) #error Compilation with legacy CAN 2.0 frame format! #else -#define CAN_FD_SUPPORTED 1 // don't touch that dial -#define CAN_TRACE_SUPPORTED 0 // write trace file (1=PCAN) +#define CAN_FD_SUPPORTED 1 // don't touch that dial #endif +#define CAN_TRACE_SUPPORTED 0 // write trace file (1=PCAN) +#define CAN_SERVER_SUPPORTED 1 // IPC interface (server) +#define CAN_CLIENT_SUPPORTED 0 // IPC interface (client) +#if !defined(__APPLE__) #define MONITOR_INTERFACE "PEAK-System PCAN Interfaces" +#else +#define MONITOR_INTERFACE "PEAK-System PCAN USB Interfaces" +#endif #define MONITOR_COPYRIGHT "2007,2012-2025 by Uwe Vogt, UV Software, Berlin" +#if defined(_WIN32) || defined(_WIN64) #define MONITOR_PLATFORM "Windows" +#elif defined(__linux__) +#define MONITOR_PLATFORM "Linux" +#elif defined(__APPLE__) +#define MONITOR_PLATFORM "Darwin" +#endif #define MONITOR_ALIASNAME "PCB:" #if (OPTION_PCAN_BIT_TIMING == 1) diff --git a/Utilities/can_moni/Sources/.gitignore b/Utilities/can_moni/Sources/.gitignore index ce4476c..90ec22b 100644 --- a/Utilities/can_moni/Sources/.gitignore +++ b/Utilities/can_moni/Sources/.gitignore @@ -1,5 +1 @@ .svn -# Not realized yet -ipc_server.* -# Not using IPC client -ipc_client.* diff --git a/Utilities/can_moni/Sources/Options.cpp b/Utilities/can_moni/Sources/Options.cpp index 77bcd8e..4f9b9d7 100644 --- a/Utilities/can_moni/Sources/Options.cpp +++ b/Utilities/can_moni/Sources/Options.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Monitor for generic Interfaces (CAN API V3) // @@ -18,7 +18,7 @@ // with this program; if not, see . // #if defined(_WIN32) || defined(_WIN64) -// for Windows OS (x86 and x64) +// for Windows OS (x86 and x64) #include "Options_w.cpp" #else // for POSIX OS (Linux, Darwin) diff --git a/Utilities/can_moni/Sources/Options.h b/Utilities/can_moni/Sources/Options.h index 2ebccc8..1161c8f 100644 --- a/Utilities/can_moni/Sources/Options.h +++ b/Utilities/can_moni/Sources/Options.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Monitor for generic Interfaces (CAN API V3) // @@ -31,11 +31,11 @@ #if !defined(_WIN32) && !defined(_WIN64) #define CAN_MONI_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 `--version' for details."; + "under certain conditions; type `" CAN_MONI_PROGRAM " --version' for details."; #else #define CAN_MONI_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 '/VERSION' for details."; + "under certain conditions; type '" CAN_MONI_PROGRAM " /VERSION' for details."; #endif #define CAN_MONI_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" \ @@ -72,7 +72,7 @@ struct SOptions { } m_StdFilter, m_XtdFilter; char* m_szExcludeList; #if (CAN_TRACE_SUPPORTED != 0) - enum { + enum ETraceMode { eTraceOff, eTraceBinary, eTraceLogger, diff --git a/Utilities/can_moni/Sources/Options_p.cpp b/Utilities/can_moni/Sources/Options_p.cpp index 5b0474c..b2b45b2 100644 --- a/Utilities/can_moni/Sources/Options_p.cpp +++ b/Utilities/can_moni/Sources/Options_p.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Monitor for generic Interfaces (CAN API V3) // @@ -824,10 +824,13 @@ void SOptions::ShowUsage(FILE* stream, bool args) { fprintf(stream, " --bitrate= CAN bit-rate settings (as key/value list)\n"); fprintf(stream, " -v, --verbose show detailed bit-rate settings\n"); #if (CAN_TRACE_SUPPORTED != 0) - fprintf(stream, " -y, --trace=(ON|OFF) write a trace file (default=OFF)\n"); +#if (CAN_TRACE_SUPPORTED == 1) + fprintf(stream, " --trace=(ON|OFF) write a trace file (default=OFF)\n"); +#else + fprintf(stream, " --trace=(BIN|CSV|TRC) write a trace file (default=OFF)\n"); #endif #if (SERIAL_CAN_SUPPORTED != 0) - fprintf(stream, " -z, --protocol=(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); + fprintf(stream, " --protocol=(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); #endif #if (CAN_FD_SUPPORTED != 0) fprintf(stream, " --list-bitrates[=] list standard bit-rate settings and exit\n"); diff --git a/Utilities/can_moni/Sources/Options_w.cpp b/Utilities/can_moni/Sources/Options_w.cpp index ae53284..01e4626 100644 --- a/Utilities/can_moni/Sources/Options_w.cpp +++ b/Utilities/can_moni/Sources/Options_w.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Monitor for generic Interfaces (CAN API V3) // @@ -921,11 +921,15 @@ void SOptions::ShowUsage(FILE* stream, bool args) { fprintf(stream, " /BauDrate: CAN bit-timing in kbps (default=250), or\n"); fprintf(stream, " /BitRate: CAN bit-rate settings (as key/value list)\n"); fprintf(stream, " /Verbose show detailed bit-rate settings\n"); -#if (SERIAL_CAN_SUPPORTED != 0) - fprintf(stream, " /PRotocol:(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); -#endif #if (CAN_TRACE_SUPPORTED != 0) +#if (CAN_TRACE_SUPPORTED == 1) fprintf(stream, " /TRaCe:(ON|OFF) write a trace file (default=OFF)\n"); +#else + fprintf(stream, " /TRaCe:(BIN|CSV|TRC) write a trace file (default=OFF)\n"); +#endif +#endif +#if (SERIAL_CAN_SUPPORTED != 0) + fprintf(stream, " /PRotocol:(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); #endif #if (CAN_FD_SUPPORTED != 0) fprintf(stream, " /LIST-BITRATES[:(2.0|FDf[+BRS])] list standard bit-rate settings and exit\n"); diff --git a/Utilities/can_moni/Sources/main.cpp b/Utilities/can_moni/Sources/main.cpp index cc98d8b..fd1ee14 100644 --- a/Utilities/can_moni/Sources/main.cpp +++ b/Utilities/can_moni/Sources/main.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Monitor for generic Interfaces (CAN API V3) // diff --git a/Utilities/can_test/Driver.h b/Utilities/can_test/Driver.h index 5bb6d55..1aec0ae 100644 --- a/Utilities/can_test/Driver.h +++ b/Utilities/can_test/Driver.h @@ -26,12 +26,24 @@ #if (OPTION_CAN_2_0_ONLY != 0) #error Compilation with legacy CAN 2.0 frame format! #else -#define CAN_FD_SUPPORTED 1 // don't touch that dial -#define CAN_TRACE_SUPPORTED 0 // write trace file (1=PCAN) +#define CAN_FD_SUPPORTED 1 // don't touch that dial #endif +#define CAN_TRACE_SUPPORTED 0 // write trace file (1=PCAN) +#define CAN_SERVER_SUPPORTED 0 // IPC interface (server) +#define CAN_CLIENT_SUPPORTED 0 // IPC interface (client) +#if !defined(__APPLE__) #define TESTER_INTERFACE "PEAK-System PCAN Interfaces" +#else +#define TESTER_INTERFACE "PEAK-System PCAN USB Interfaces" +#endif #define TESTER_COPYRIGHT "2005-2010,2012-2025 by Uwe Vogt, UV Software, Berlin" +#if defined(_WIN32) || defined(_WIN64) #define TESTER_PLATFORM "Windows" +#elif defined(__linux__) +#define TESTER_PLATFORM "Linux" +#elif defined(__APPLE__) +#define TESTER_PLATFORM "Darwin" +#endif #define TESTER_ALIASNAME "PCB:" #if (OPTION_PCAN_BIT_TIMING == 1) diff --git a/Utilities/can_test/Sources/Options.cpp b/Utilities/can_test/Sources/Options.cpp index 7dbd453..bbe739a 100644 --- a/Utilities/can_test/Sources/Options.cpp +++ b/Utilities/can_test/Sources/Options.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Tester for generic Interfaces (CAN API V3) // @@ -19,7 +19,7 @@ // with this program; if not, see . // #if defined(_WIN32) || defined(_WIN64) -// for Windows OS (x86 and x64) +// for Windows OS (x86 and x64) #include "Options_w.cpp" #else // for POSIX OS (Linux, Darwin) diff --git a/Utilities/can_test/Sources/Options.h b/Utilities/can_test/Sources/Options.h index 827d791..91f9a60 100644 --- a/Utilities/can_test/Sources/Options.h +++ b/Utilities/can_test/Sources/Options.h @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Tester for generic Interfaces (CAN API V3) // @@ -32,11 +32,11 @@ #if defined(_WIN32) || defined(_WIN64) #define CAN_TEST_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 '/VERSION' for details."; + "under certain conditions; type '" CAN_TEST_PROGRAM " /VERSION' for details."; #else #define CAN_TEST_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 `--version' for details."; + "under certain conditions; type `" CAN_TEST_PROGRAM " --version' for details."; #endif #define CAN_TEST_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" \ @@ -88,7 +88,7 @@ struct SOptions { uint8_t m_nTxCanDlc; bool m_fTxXtdId; #if (CAN_TRACE_SUPPORTED != 0) - enum { + enum ETraceMode { eTraceOff, eTraceBinary, eTraceLogger, diff --git a/Utilities/can_test/Sources/Options_p.cpp b/Utilities/can_test/Sources/Options_p.cpp index cca7fd4..2fc2199 100644 --- a/Utilities/can_test/Sources/Options_p.cpp +++ b/Utilities/can_test/Sources/Options_p.cpp @@ -1,4 +1,4 @@ -// SPDX-License-Identifier: GPL-3.0-or-later +// SPDX-License-Identifier: GPL-2.0-or-later // // CAN Tester for generic Interfaces (CAN API V3) // @@ -920,11 +920,14 @@ void SOptions::ShowUsage(FILE* stream, bool args) { fprintf(stream, " -b, --baudrate= CAN bit-timing in kbps (default=250), or\n"); fprintf(stream, " --bitrate= CAN bit-rate settings (as key/value list)\n"); fprintf(stream, " -v, --verbose show detailed bit-rate settings\n"); -#if (SERIAL_CAN_SUPPORTED != 0) - fprintf(stream, " -z, --protocol=(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); -#endif #if (CAN_TRACE_SUPPORTED != 0) - fprintf(stream, " -y, --trace=(ON|OFF) write a trace file (default=OFF)\n"); +#if (CAN_TRACE_SUPPORTED == 1) + fprintf(stream, " --trace=(ON|OFF) write a trace file (default=OFF)\n"); +#else + fprintf(stream, " --trace=(BIN|CSV|TRC) write a trace file (default=OFF)\n"); +#endif +#if (SERIAL_CAN_SUPPORTED != 0) + fprintf(stream, " --protocol=(Lawicel|CANable) select SLCAN protocol (default=Lawicel)\n"); #endif fprintf(stream, "Options for transmitter test:\n"); fprintf(stream, " -t, --transmit=