Skip to content

Commit

Permalink
Merge pull request #23 from uv-software/development
Browse files Browse the repository at this point in the history
Release Candidate 1 for Version 0.5.2
  • Loading branch information
uv-software authored Aug 2, 2024
2 parents de11394 + 8d41e7d commit b429a55
Show file tree
Hide file tree
Showing 60 changed files with 1,214 additions and 637 deletions.
Binary file modified Libraries/CANAPI/uvcanpcb.rc
Binary file not shown.
Binary file modified Libraries/PeakCAN/PeakCAN.rc
Binary file not shown.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Type `can_test /?` to display all program options.
### Development Environment
- Microsoft Visual Studio Community 2022 (Version 17.10.1)
- Microsoft Visual Studio Community 2022 (Version 17.10.5)
### Required PCANBasic DLL
Expand Down
37 changes: 35 additions & 2 deletions Sources/CANAPI/CANAPI_Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
*
* @brief CAN API V3 for generic CAN Interfaces - Data Types and Defines
*
* @author $Author: quaoar $
* @author $Author: makemake $
*
* @version $Rev: 1286 $
* @version $Rev: 1356 $
*
* @addtogroup can_api
* @{
Expand Down Expand Up @@ -350,6 +350,19 @@ extern "C" {
#define CANPROP_SET_FILTER_11BIT 42U /**< set value for acceptance filter code and mask for 11-bit identifier (uint64_t) */
#define CANPROP_SET_FILTER_29BIT 43U /**< set value for acceptance filter code and mask for 29-bit identifier (uint64_t) */
#define CANPROP_SET_FILTER_RESET 44U /**< reset acceptance filter code and mask to default values (NULL) */
#define CANPROP_SET_FROMTO_11BIT 45U /**< add an 11-bit identifier range to the from-to filter list (uint64_t) */
#define CANPROP_SET_FROMTO_29BIT 46U /**< add an 11-bit identifier range to the from-to filter list (uint64_t) */
#define CANPROP_GET_TRACE_ACTIVE 48U /**< trace file activation state: STOPPED/RUNNING (uint8_t) */
#define CANPROP_GET_TRACE_FOLDER 49U /**< trace file folder location (directory only) (char[]) */
#define CANPROP_GET_TRACE_TYPE 50U /**< trace file type (for possible values see below) (uint8_t) */
#define CANPROP_GET_TRACE_MODE 51U /**< trace file mode (for possible options see below) (uint16_t) */
#define CANPROP_GET_TRACE_SIZE 52U /**< trace file segment size (in 10 KB steps, 0 = 100MB) (uint 16_t) */
#define CANPROP_GET_TRACE_FILE 55U /**< trace file name: directory + basename + extension (char[]) */
#define CANPROP_SET_TRACE_ACTIVE 56U /**< start/stop trace file logging with configured settings (uint8_t) */
#define CANPROP_SET_TRACE_FOLDER 57U /**< set trace file folder location (directory only) (char[]) */
#define CANPROP_SET_TRACE_TYPE 58U /**< set trace file type (for possible values see below) (uint8_t) */
#define CANPROP_SET_TRACE_MODE 59U /**< set trace file mode (for possible options see below) (uint16_t) */
#define CANPROP_SET_TRACE_SIZE 60U /**< set trace file segment size (in 10 KB steps, 0 = 100MB) (uint 16_t) */
#if (OPTION_CANAPI_LIBRARY != 0)
/* - - build-in bit-rate conversion - - - - - - - - - - - - - - - - - */
#define CANPROP_GET_BTR_INDEX 64U /**< bit-rate as CiA index (int32_t) */
Expand Down Expand Up @@ -428,6 +441,26 @@ extern "C" {
/** @name Property Values
* @brief Values which can be used as property value (argument)
* @{ */
/* - - trace file - - - - - - - - - - - - - - - - - - - - - - - - - - */
#define CANPARA_TRACE_OFF 0U /**< trace file activation: STOP */
#define CANPARA_TRACE_ON 1U /**< trace file activation: START */
/* - - trace file type - - - - - - - - - - - - - - - - - - - - - - - - */
#define CANPARA_TRACE_TYPE_BINARY 0U /**< trace file: binary format */
#define CANPARA_TRACE_TYPE_LOGGER 1U /**< trace file: CSV format */
#define CANPARA_TRACE_TYPE_VENDOR 0x80U /**< trace file: vendor-specific */
/* - - trace file mode - - - - - - - - - - - - - - - - - - - - - - - - */
#define CANPARA_TRACE_MODE_DEFAULT 0x0000U /**< trace file: default (create/append) */
#define CANPARA_TRACE_MODE_OVERWRITE 0x80U /**< trace file: overwrite existing */
#define CANPARA_TRACE_MODE_SEGMENTED 0x01U /**< trace file: segmented trace file */
#define CANPARA_TRACE_MODE_COMPRESSED 0x40U /**< trace file: compressed trace file */
#define CANPARA_TRACE_MODE_PREFIX_DATE 0x02U /**< trace file: date as file name prefix */
#define CANPARA_TRACE_MODE_PREFIX_TIME 0x04U /**< trace file: time as file name prefix */
#define CANPARA_TRACE_MODE_OUTPUT_DLC 0x000U /**< trace file: length as Data Length Code */
#define CANPARA_TRACE_MODE_OUTPUT_LEN 0x100U /**< trace file: length as LENGTH in bytes */
#define CANPARA_TRACE_MODE_OUTPUT_HEX 0x000U /**< trace file: Id., length and data as HEX */
#define CANPARA_TRACE_MODE_OUTPUT_DEC 0x200U /**< trace file: Id., length and data as DEC */
#define CANPARA_TRACE_MODE_CUSTOM_NAME 0x8000U /**< trace file: use of custom file name (basename and extension) */
/* - - message formatter - - - - - - - - - - - - - - - - - - - - - - - */
#define CANPARA_FORMAT_DEFAULT 0 /**< message formatter output (default) */
/* - - formatter option: ON or OFF - - - - - - - - - - - - - - - - - - */
#define CANPARA_OPTION_OFF 0 /**< formatter option: OFF (false, no, 0) */
Expand Down
4 changes: 2 additions & 2 deletions Sources/CANAPI/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### CAN Interface API, Version 3

_Copyright &copy; 2004-2024 Uwe Vogt, UV Software, Berlin ([email protected])_ \
_Copyright &copy; 2004-2024 Uwe Vogt, UV Software, Berlin ([email protected])_ \
_All rights reserved._

Version $Rev: 1312 $
Version $Rev: 1356 $

# A CAN Interface Wrapper Specification

Expand Down
37 changes: 22 additions & 15 deletions Sources/CANAPI/can_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
*
* @brief CAN Message Formatter
*
* @author $Author: eris $
* @author $Author: makemake $
*
* @version $Rev: 1270 $
* @version $Rev: 1355 $
*
* @defgroup can_msg CAN Message Formatter
* @{
Expand All @@ -66,37 +66,44 @@ extern "C" {
/* ----------- includes -----------------------------------------------
*/

#if (OPTION_CANAPI_COMPANIONS != 0) // set it in the build environment!
#include "CANAPI_Types.h" // use CAN API V3 types and defines
#else // otherwise:
#define CANBTR_STANDALONE_VARIANT // don't include CAN API V3 headers
#include <stdint.h> // C99 header for sized integer types
#include <stdbool.h> // C99 header for boolean type
#include <time.h> // time types for time-stamp
#if (OPTION_CANAPI_COMPANIONS != 0) /* set it in the build environment! */
#include "CANAPI_Types.h" /* use CAN API V3 types and defines */
#else /* otherwise: */
#define CANMSG_STANDALONE_VARIANT /* don't include CAN API V3 headers */
#include <stdint.h> /* C99 header for sized integer types */
#include <stdbool.h> /* C99 header for boolean type */
#include <time.h> /* for structure 'timespec' */
#endif

/* ----------- options ------------------------------------------------
*/

/** @name Compiler Switches
* @brief Options for conditional compilation.
* @{ */
/** @note Set define OPTION_CANAPI_COMPANIONS to a non-zero value to compile
* this module in conjunction with the CAN API V3 sources (e.g. in
* the build environment).
*/
/** @note Set define OPTION_CAN_2_0_ONLY to a non-zero value to compile
* with CAN 2.0 frame format only (e.g. in the build environment).
*/
#if (OPTION_CAN_2_0_ONLY != 0)
#ifndef OPTION_DISABLED
#define OPTION_DISABLED 0 /**< if a define is not defined, it is automatically set to 0 */
#endif
#if (OPTION_CAN_2_0_ONLY != OPTION_DISABLED)
#ifdef _MSC_VER
#pragma message ( "Compilation with with legacy CAN 2.0 frame format!" )
#pragma message ( "Compilation with legacy CAN 2.0 frame format!" )
#else
#warning Compilation with with legacy CAN 2.0 frame format!
#warning Compilation with legacy CAN 2.0 frame format!
#endif
#endif
/** @} */

/* ----------- defines ------------------------------------------------
*/

#ifdef CANBTR_STANDALONE_VARIANT
#ifdef CANMSG_STANDALONE_VARIANT
/** @name CAN Identifier
* @brief CAN Identifier range
* @{ */
Expand Down Expand Up @@ -223,14 +230,14 @@ typedef enum msg_fmt_wraparound_t_ {

/** @brief CAN Time-stamp:
*/
#ifdef CANMSG_STANDALONE
#ifdef CANMSG_STANDALONE_VARIANT
typedef struct timespec msg_timestamp_t; /* w/ nanoseconds resolution */
#else
typedef can_timestamp_t msg_timestamp_t; /* CAN API V3 time-stamp */
#endif
/** @brief CAN Message (with Time-stamp):
*/
#ifdef CANMSG_STANDALONE
#ifdef CANMSG_STANDALONE_VARIANT
typedef struct msg_message_t_ {
uint32_t id; /**< CAN identifier */
struct {
Expand Down
2 changes: 1 addition & 1 deletion Sources/PeakCAN_Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ extern "C" {
#define PCAN_LIB_BASIC "libPCBUSB.dylib"
#define PCAN_LIB_WRAPPER "libUVCANPCB.dylib"
#define PCAN_LIB_MIN_MAJOR 0U
#define PCAN_LIB_MIN_MINOR 9U
#define PCAN_LIB_MIN_MINOR 13U
#elif defined(__linux__)
#define PCAN_LIB_BASIC "libpcanbasic.so"
#define PCAN_LIB_WRAPPER "libuvcanpcb.so"
Expand Down
6 changes: 3 additions & 3 deletions Sources/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
#ifdef _MSC_VER
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
#define VERSION_PATCH 1
#define VERSION_PATCH 2
#else
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 9
#define VERSION_MINOR 3
#define VERSION_PATCH 0
#endif
#define VERSION_BUILD BUILD_NO
#if (VERSION_PATCH == 0)
Expand Down
20 changes: 18 additions & 2 deletions Sources/Wrapper/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1378,9 +1378,26 @@ static TPCANStatus pcan_reset_filter(int handle)

assert(IS_HANDLE_VALID(handle)); // just to make sure

#if defined(__linux__)
UINT64 value = 0x0ull; // PCAN filter value

// note: it seems that the hardware filter is not resetted by 'PCAN_MESSAGE_FILTER' := 'PCAN_FILTER_OPEN'
switch (can[handle].filter.mode) {
case FILTER_STD: // 11-bit identifier
value = (FILTER_RESET_VALUE ^ FILTER_STD_XOR_MASK); // SJA100 has inverted masks bits!
(void)CAN_SetValue(can[handle].board, PCAN_ACCEPTANCE_FILTER_11BIT, (void*)&value, sizeof(value));
break;
case FILTER_XTD: // 29-bit identifier
value = (FILTER_RESET_VALUE ^ FILTER_XTD_XOR_MASK); // SJA100 has inverted masks bits!
(void)CAN_SetValue(can[handle].board, PCAN_ACCEPTANCE_FILTER_29BIT, (void*)&value, sizeof(value));
break;
default: // no filtering
break;
}
#endif
// reset the filter value to device
if ((sts = CAN_SetValue(can[handle].board, (BYTE)PCAN_MESSAGE_FILTER,
(void*)&filter, (DWORD)sizeof(uint8_t))) == PCAN_ERROR_OK) {
(void*)&filter, (DWORD)sizeof(uint8_t))) == PCAN_ERROR_OK) {
can[handle].filter.mode = FILTER_OFF;
}
return sts;
Expand Down Expand Up @@ -1592,7 +1609,6 @@ static int drv_parameter(int handle, uint16_t param, void *value, size_t nbyte)
can_mode_t mode; // current operation mode
uint8_t status = 0u; // status register
uint8_t load = 0u; // bus load
uint64_t filter = 0ull; // acceptance filter
char str[MAX_LENGTH_HARDWARE_NAME+1]; // device name
TPCANStatus sts; // represents a status

Expand Down
25 changes: 13 additions & 12 deletions Tests/Driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,19 @@ typedef CPeakCAN CCanDriver;

// ($4) define macros for driver-specific features
// at least the mandatory macros (cf. compiler warnings)
#define FEATURE_BITRATE_5K FEATURE_UNSUPPORTED
#define FEATURE_BITRATE_800K FEATURE_SUPPORTED
#define FEATURE_BITRATE_SAM FEATURE_SUPPORTED
#define FEATURE_BITRATE_FD_SAM FEATURE_UNSUPPORTED
#define FEATURE_BITRATE_SJA1000 FEATURE_SUPPORTED
#define FEATURE_FILTERING FEATURE_SUPPORTED
#define FEATURE_ERROR_FRAMES FEATURE_SUPPORTED
#define FEATURE_ERROR_CODE_CAPTURE FEATURE_SUPPORTED
#define FEATURE_BLOCKING_READ FEATURE_SUPPORTED
#define FEATURE_BLOCKING_WRITE FEATURE_UNSUPPORTED
#define FEATURE_SIZE_RECEIVE_QUEUE 32767
#define FEATURE_SIZE_TRANSMIT_QUEUE 32767
#define FEATURE_BITRATE_5K FEATURE_UNSUPPORTED
#define FEATURE_BITRATE_800K FEATURE_SUPPORTED
#define FEATURE_BITRATE_SAM FEATURE_SUPPORTED
#define FEATURE_BITRATE_FD_SAM FEATURE_UNSUPPORTED
#define FEATURE_BITRATE_SJA1000 FEATURE_SUPPORTED
#define FEATURE_FILTERING FEATURE_SUPPORTED
#define FEATURE_TRACE_FILE FEATURE_UNSUPPORTED
#define FEATURE_ERROR_FRAMES FEATURE_SUPPORTED
#define FEATURE_ERROR_CODE_CAPTURE FEATURE_SUPPORTED
#define FEATURE_BLOCKING_READ FEATURE_SUPPORTED
#define FEATURE_BLOCKING_WRITE FEATURE_UNSUPPORTED
#define FEATURE_SIZE_RECEIVE_QUEUE 32767
#define FEATURE_SIZE_TRANSMIT_QUEUE 32767

// (§5) define macros for CAN Classic bit-rate settings
// at least BITRATE_1M, BITRATE_500K, BITRATE_250K, BITRATE_125K,
Expand Down
1 change: 1 addition & 0 deletions Tests/GoogleTest/CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Russ Cox <[email protected]>
Russ Rufer <[email protected]>
Sean Mcafee <[email protected]>
Sigurður Ásgeirsson <[email protected]>
Soyeon Kim <[email protected]>
Sverre Sundsdal <[email protected]>
Szymon Sobik <[email protected]>
Takeshi Yoshino <[email protected]>
Expand Down
22 changes: 9 additions & 13 deletions Tests/GoogleTest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,29 @@ GoogleTest now follows the
We recommend
[updating to the latest commit in the `main` branch as often as possible](https://github.com/abseil/abseil-cpp/blob/master/FAQ.md#what-is-live-at-head-and-how-do-i-do-it).
We do publish occasional semantic versions, tagged with
`v${major}.${minor}.${patch}` (e.g. `v1.13.0`).
`v${major}.${minor}.${patch}` (e.g. `v1.15.0`).

#### Documentation Updates

Our documentation is now live on GitHub Pages at
https://google.github.io/googletest/. We recommend browsing the documentation on
GitHub Pages rather than directly in the repository.

#### Release 1.13.0
#### Release 1.15.0

[Release 1.13.0](https://github.com/google/googletest/releases/tag/v1.13.0) is
[Release 1.15.0](https://github.com/google/googletest/releases/tag/v1.15.0) is
now available.

The 1.13.x branch requires at least C++14.
The 1.15.x branch requires at least C++14.

#### Continuous Integration

We use Google's internal systems for continuous integration. \
GitHub Actions were added for the convenience of open-source contributors. They
are exclusively maintained by the open-source community and not used by the
GoogleTest team.
We use Google's internal systems for continuous integration.

#### Coming Soon

* We are planning to take a dependency on
[Abseil](https://github.com/abseil/abseil-cpp).
* More documentation improvements are planned.

## Welcome to **GoogleTest**, Google's C++ test framework!

Expand Down Expand Up @@ -100,12 +96,12 @@ tools.
In addition to many internal projects at Google, GoogleTest is also used by the
following notable projects:

* The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser
and Chrome OS).
* The [LLVM](http://llvm.org/) compiler.
* The [Chromium projects](https://www.chromium.org/) (behind the Chrome
browser and Chrome OS).
* The [LLVM](https://llvm.org/) compiler.
* [Protocol Buffers](https://github.com/google/protobuf), Google's data
interchange format.
* The [OpenCV](http://opencv.org/) computer vision library.
* The [OpenCV](https://opencv.org/) computer vision library.

## Related Open Source Projects

Expand Down
10 changes: 5 additions & 5 deletions Tests/GoogleTest/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ URL: https://github.com/google/googletest

Current Version used by CAN API V3 C++ Testing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
v1.14.0 (https://github.com/google/googletest/releases/tag/v1.14.0)
v1.14.0 (https://github.com/google/googletest/releases/tag/v1.15.0)

Installation and Usage of GoogleTest
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1. Clone the GoogleTest main branch or download the sources from a tag
e.g. into 'C:\Projekte\gtest'
2. Copy all header files from 'C:\Projekte\gtest\googletest\include'
into '$(PROJROOT)\Tests\GoogleTest\include'
3. Build static libraries for x64_x84 and x86_x64 with CMake
2. Copy all header files from 'C:\Projekte\gtest\googletest\include\gtest'
into '$(PROJROOT)\Tests\GoogleTest\include\gtest'
3. Build static libraries for x64 and x86 with CMake
note: GoogleMock (aka gmock) does not need to be created for this project.
4. Copy all files from 'C:\Projekte\gtest\googletest\out\build\x64-Debug\lib'
into $(PROJROOT)\Tests\GoogleTest\build\x64-Debug\lib'
Expand All @@ -35,4 +35,4 @@ Important Notes

Last Updated
~~~~~~~~~~~~
August 23, 2023
August 17, 2024
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Tests/GoogleTest/build/x64-Debug/lib/gtest_main.lib
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed Tests/GoogleTest/build/x86-Debug/lib/gtest_main.lib
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Tests/GoogleTest/include/gtest/gtest-assertion-result.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace testing {
//
// Expected: Foo() is even
// Actual: it's 5
//

class GTEST_API_ AssertionResult {
public:
// Copy constructor.
Expand Down
8 changes: 4 additions & 4 deletions Tests/GoogleTest/include/gtest/gtest-death-test.h
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ class GTEST_API_ KilledBySignal {
// statement is compiled but not executed, to ensure that
// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
// parameter if and only if EXPECT_DEATH compiles with it.
// regex - A regex that a macro such as EXPECT_DEATH would use to test
// the output of statement. This parameter has to be
// regex_or_matcher - A regex that a macro such as EXPECT_DEATH would use
// to test the output of statement. This parameter has to be
// compiled but not evaluated by this macro, to ensure that
// this macro only accepts expressions that a macro such as
// EXPECT_DEATH would accept.
Expand All @@ -311,13 +311,13 @@ class GTEST_API_ KilledBySignal {
// statement unconditionally returns or throws. The Message constructor at
// the end allows the syntax of streaming additional messages into the
// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
#define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \
#define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex_or_matcher, terminator) \
GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
if (::testing::internal::AlwaysTrue()) { \
GTEST_LOG_(WARNING) << "Death tests are not supported on this platform.\n" \
<< "Statement '" #statement "' cannot be verified."; \
} else if (::testing::internal::AlwaysFalse()) { \
::testing::internal::RE::PartialMatch(".*", (regex)); \
::testing::internal::MakeDeathTestMatcher(regex_or_matcher); \
GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
terminator; \
} else \
Expand Down
Loading

0 comments on commit b429a55

Please sign in to comment.