Skip to content

Commit

Permalink
Merge pull request #13 from uv-software/development
Browse files Browse the repository at this point in the history
Release candidate 2 for version 0.3
  • Loading branch information
uv-software authored Mar 12, 2024
2 parents 2c0f17e + e5d39d7 commit 52af5a9
Show file tree
Hide file tree
Showing 12 changed files with 96 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ PROJECT_NAME = KvaserCAN-Wrapper
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = v0.2
PROJECT_NUMBER = v0.3

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Type `can_test /?` to display all program options.
### Target Platform
- Windows 10 (x64 operating systems)
- Windows 10 & 11 (x64 operating systems)
### Development Environment
Expand All @@ -147,13 +147,14 @@ For a list of known bugs and caveats see tab [Issues](https://github.com/uv-soft
Kvaser´s CANlib SDK can be downloaded form the [Kvaser](https://www.kvaser.com/) website. \
Please note the copyright and license agreements.
### CAN API V3 Reference
A generic documentation of the CAN API V3 application programming interface can be found [here](https://uv-software.github.io/CANAPI-Docs).
### Wrapper Library for macOS®
A version for macOS can be downloaded from / cloned at [GitHub](https://github.com/mac-can/KvaserCAN-Library).
### CAN API V3 Reference
A generic documentation of the CAN API V3 application programming interface can be found [here](https://uv-software.github.io/CANAPI-Docs/#/).
### Dual-License
This work is dual-licensed under the terms of the BSD 2-Clause "Simplified" License
Expand Down
6 changes: 3 additions & 3 deletions Sources/CANAPI/CANBTR_Defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/*
* CAN Interface API, Version 3 (Definitions and Options)
*
* Copyright (c) 2004-2021 Uwe Vogt, UV Software, Berlin ([email protected])
* Copyright (c) 2004-2024 Uwe Vogt, UV Software, Berlin ([email protected])
* All rights reserved.
*
* This file is part of CAN API V3.
Expand Down Expand Up @@ -49,9 +49,9 @@
*
* @brief CAN API V3 for generic CAN Interfaces - Definitions and Options
*
* @author $Author: eris $
* @author $Author: quaoar $
*
* @version $Rev: 1090 $
* @version $Rev: 1256 $
*
* @addtogroup can_btr
* @{
Expand Down
2 changes: 1 addition & 1 deletion Sources/CANAPI/LICENSE.BSD-2-Clause
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 2-Clause License

Copyright (c) 2021, Uwe Vogt, UV Software
Copyright (c) 2004-2024, Uwe Vogt, UV Software
All rights reserved.

Redistribution and use in source and binary forms, with or without
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 © 2004-2024 Uwe Vogt, UV Software, Berlin ([email protected])_ \
_Copyright © 2004-2024 Uwe Vogt, UV Software, Berlin ([email protected])_ \
_All rights reserved._

Version $Rev: 1249 $
Version $Rev: 1256 $

# A CAN Interface Wrapper Specification

Expand Down
3 changes: 1 addition & 2 deletions Sources/KvaserCAN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
#define PLATFORM "x64"
#elif defined(_WIN32)
#define PLATFORM "x86"
#elif defined(__linux__)
#define PLATFORM "Linux"
#else
#error Unsupported architecture
#endif
static const char version[] = "CAN API V3 for Kvaser CAN Interfaces, Version " VERSION_STRING;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Wrapper/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@
#define PLATFORM "x64"
#elif defined(_WIN32)
#define PLATFORM "x86"
#elif defined(__linux__)
#define PLATFORM "Linux"
#else
#error Unsupported architecture
#endif
static const char version[] = "CAN API V3 for Kvaser CAN Interfaces, Version " VERSION_STRING;
Expand Down
4 changes: 2 additions & 2 deletions Tests/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
### CAN API V3 Testing with GoogleTest

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

Version $Rev: 1254 $
Version $Rev: 1255 $

# CAN Interface Wrapper Specification

Expand Down
10 changes: 8 additions & 2 deletions Tests/Testcases/TC05_WriteMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2169,12 +2169,18 @@ TEST_F(WriteMessage, GTEST_TESTCASE(WithFlagEsi, GTEST_ENABLED)) {
retVal = dut2.ReadMessage(rcvMsg, TEST_READ_TIMEOUT);
EXPECT_EQ(CCanApi::NoError, retVal);
// @- compare sent and received message
EXPECT_TRUE(dut2.CompareMessages(trmMsg, rcvMsg));
EXPECT_TRUE(dut2.CompareMessages(trmMsg, rcvMsg, false));
#if (1)
// @ note: flag ESI is not set in received message in CAN FD mode
// @ (KvaserCAN-Wrapper and PCANBasic-Wrapper on Windows)
EXPECT_EQ(0, rcvMsg.esi);
#else
// @ note: flag ESI should also be set in received message in CAN FD mode
if (dut2.GetOpMode().fdoe)
EXPECT_EQ(1, rcvMsg.esi);
else
EXPECT_EQ(0, rcvMsg.esi);
#endif
// @post:
counter.Clear();
// @- send some frames to DUT2 and receive some frames from DUT2
Expand Down Expand Up @@ -2205,4 +2211,4 @@ TEST_F(WriteMessage, GTEST_TESTCASE(WithFlagEsi, GTEST_ENABLED)) {
// @todo: (1) blocking write
// @todo: (2) test reentrancy

// $Id: TC05_WriteMessage.cc 1218 2023-10-14 12:18:19Z makemake $ Copyright (c) UV Software, Berlin.
// $Id: TC05_WriteMessage.cc 1255 2024-03-12 16:53:58Z quaoar $ Copyright (c) UV Software, Berlin.
6 changes: 3 additions & 3 deletions Tests/Version.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
//
#ifndef VERSION_H_INCLUDED
#define VERSION_H_INCLUDED
// SVN revision number (update with each commit: IX)
#define REVISION_NO "$Rev: 1254 $"
// SVN revision number (update with each commit: X)
#define REVISION_NO "$Rev: 1255 $"
#endif // VERSION_H_INCLUDED

// $Id: Version.h 1254 2024-03-10 20:41:16Z haumea $ Copyright (c) UV Software, Berlin //
// $Id: Version.h 1255 2024-03-12 16:53:58Z quaoar $ Copyright (c) UV Software, Berlin //
43 changes: 34 additions & 9 deletions x64_build.bat
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
@echo off

pushd
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" x64
popd
rem parse arguments: [[NOVARS] NOTRIAL]
if "%1" == "NOVARS" (
set VCVARS="False"
) else (
set VCVARS="True"
)
SHIFT
if "%1" == "NOTRIAL" (
set TRIAL="False"
) else (
set TRIAL="True"
)

rem set MSBuild environment variables
if %VCVARS% == "True" (
pushd
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" x64
popd
)
pushd
call build_no.bat
rem type .\Sources\build_no.h
rem pause

call msbuild.exe .\Trial\kvl_test.vcxproj /t:Clean;Build /p:"Configuration=Debug";"Platform=x64"
if errorlevel 1 goto end
rem generate a pseudo build number
call build_no.bat

rem build the trial program
if %TRIAL% == "True" (
call msbuild.exe .\Trial\kvl_test.vcxproj /t:Clean;Build /p:"Configuration=Debug";"Platform=x64"
if errorlevel 1 goto end
)
rem build the CAN API V3 C library (dynamic and static)
call msbuild.exe .\Libraries\CANAPI\uvcankvl.vcxproj /t:Clean;Build /p:"Configuration=Release_dll";"Platform=x64"
if errorlevel 1 goto end

call msbuild.exe .\Libraries\CANAPI\uvcankvl.vcxproj /t:Clean;Build /p:"Configuration=Debug_lib";"Platform=x64"
if errorlevel 1 goto end

rem build the CAN API V3 C++ library (dynamic and static)
call msbuild.exe .\Libraries\KvaserCAN\KvaserCAN.vcxproj /t:Clean;Build /p:"Configuration=Release_dll";"Platform=x64"
if errorlevel 1 goto end

call msbuild.exe .\Libraries\KvaserCAN\KvaserCAN.vcxproj /t:Clean;Build /p:"Configuration=Debug_lib";"Platform=x64"
if errorlevel 1 goto end

rem copy the arifacts into the Binaries folder
echo Copying artifacts...
set BIN=".\Binaries"
if not exist %BIN% mkdir %BIN%
Expand Down Expand Up @@ -53,12 +73,14 @@ copy /Y .\Sources\CANAPI\CANBTR_Defaults.h %INC%
copy /Y .\Sources\CANAPI\can_api.h %INC%
copy /Y .\Sources\CANAPI\can_btr.h %INC%

rem build the utilities 'can_mone' and 'can_test'
call msbuild.exe .\Utilities\can_moni\can_moni.vcxproj /t:Clean;Build /p:"Configuration=Release";"Platform=x64"
if errorlevel 1 goto end

call msbuild.exe .\Utilities\can_test\can_test.vcxproj /t:Clean;Build /p:"Configuration=Release";"Platform=x64"
if errorlevel 1 goto end

rem copy the utilities into the Binaries folder
echo Copying utilities...
set BIN=".\Binaries"
if not exist %BIN% mkdir %BIN%
Expand All @@ -67,6 +89,9 @@ if not exist %BIN% mkdir %BIN%
copy /Y .\Utilities\can_moni\x64\Release\can_moni.exe %BIN%
copy /Y .\Utilities\can_test\x64\Release\can_test.exe %BIN%

rem end of the job
:end
popd
pause
if %VCVARS% == "True" (
pause
)
44 changes: 35 additions & 9 deletions x86_build.bat
Original file line number Diff line number Diff line change
@@ -1,29 +1,49 @@
@echo off

pushd
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" x86
popd
rem parse arguments: [[NOVARS] NOTRIAL]
if "%1" == "NOVARS" (
set VCVARS="False"
) else (
set VCVARS="True"
)
SHIFT
if "%1" == "NOTRIAL" (
set TRIAL="False"
) else (
set TRIAL="True"
)

rem set MSBuild environment variables
if %VCVARS% == "True" (
pushd
call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat" x86
popd
)
pushd
call build_no.bat
rem type .\Sources\build_no.h
rem pause

call msbuild.exe .\Trial\kvl_test.vcxproj /t:Clean;Build /p:"Configuration=Debug";"Platform=Win32"
if errorlevel 1 goto end
rem generate a pseudo build number
call build_no.bat

rem build the trial program
if %TRIAL% == "True" (
call msbuild.exe .\Trial\kvl_test.vcxproj /t:Clean;Build /p:"Configuration=Debug";"Platform=Win32"
if errorlevel 1 goto end
)
rem build the CAN API V3 C library (dynamic and static)
call msbuild.exe .\Libraries\CANAPI\uvcankvl.vcxproj /t:Clean;Build /p:"Configuration=Release_dll";"Platform=Win32"
if errorlevel 1 goto end

call msbuild.exe .\Libraries\CANAPI\uvcankvl.vcxproj /t:Clean;Build /p:"Configuration=Debug_lib";"Platform=Win32"
if errorlevel 1 goto end

rem build the CAN API V3 C++ library (dynamic and static)
call msbuild.exe .\Libraries\KvaserCAN\KvaserCAN.vcxproj /t:Clean;Build /p:"Configuration=Release_dll";"Platform=Win32"
if errorlevel 1 goto end

call msbuild.exe .\Libraries\KvaserCAN\KvaserCAN.vcxproj /t:Clean;Build /p:"Configuration=Debug_lib";"Platform=Win32"
if errorlevel 1 goto end

rem copy the arifacts into the Binaries folder
echo Copying artifacts...
set BIN=".\Binaries"
if not exist %BIN% mkdir %BIN%
Expand All @@ -42,6 +62,7 @@ copy /Y .\Libraries\KvaserCAN\Debug_lib\uvKvaserCAN.pdb %BIN%
copy /Y .\Sources\CANlib\x86\canlib32.lib %BIN%
echo Static libraries (x86) > %BIN%\readme.txt

rem copy the header files into the Includes folder
echo Copying header files...
set INC=".\Includes"
if not exist %INC% mkdir %INC%
Expand All @@ -53,12 +74,14 @@ copy /Y .\Sources\CANAPI\CANBTR_Defaults.h %INC%
copy /Y .\Sources\CANAPI\can_api.h %INC%
copy /Y .\Sources\CANAPI\can_btr.h %INC%

rem build the utilities 'can_mone' and 'can_test'
call msbuild.exe .\Utilities\can_moni\can_moni.vcxproj /t:Clean;Build /p:"Configuration=Release";"Platform=Win32"
if errorlevel 1 goto end

call msbuild.exe .\Utilities\can_test\can_test.vcxproj /t:Clean;Build /p:"Configuration=Release";"Platform=Win32"
if errorlevel 1 goto end

rem copy the utilities into the Binaries folder
echo Copying utilities...
set BIN=".\Binaries"
if not exist %BIN% mkdir %BIN%
Expand All @@ -67,6 +90,9 @@ if not exist %BIN% mkdir %BIN%
copy /Y .\Utilities\can_moni\Release\can_moni.exe %BIN%
copy /Y .\Utilities\can_test\Release\can_test.exe %BIN%

rem end of the job
:end
popd
pause
if %VCVARS% == "True" (
pause
)

0 comments on commit 52af5a9

Please sign in to comment.