Skip to content

Commit 0f79a31

Browse files
authored
Merge pull request #25 from uv-software/development
Release candidate 2 for version 0.6
2 parents f6b8905 + 09948b9 commit 0f79a31

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+5060
-275
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ Utilities/can_moni/Release
3939
Utilities/can_moni/can_moni
4040
Utilities/can_moni/*.sln
4141
Utilities/can_moni/*.vcxproj.user
42+
Utilities/can_send/.vs
43+
Utilities/can_send/x64
44+
Utilities/can_send/x86
45+
Utilities/can_send/Debug
46+
Utilities/can_send/Release
47+
Utilities/can_send/can_send
48+
Utilities/can_send/*.sln
49+
Utilities/can_send/*.vcxproj.user
4250
Utilities/can_test/.vs
4351
Utilities/can_test/x64
4452
Utilities/can_test/x86

Deployment.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@ _All rights reserved._
1717
from PEAK's website and commit it with commit comment:
1818
- `Update PEAK's PCANBasic DLL (version `_n_`.`_n_`.`_n_`)` \
1919
`- `_list of major changes (optional)_
20-
2. If necessary, update the CAN API V3 sources in `$(PROJROOT)\Sources\CANAPI`
20+
1. If necessary, update the CAN API V3 sources in `$(PROJROOT)\Sources\CANAPI`
2121
from the SVN repo and commit them with commit comment:
2222
- `Update CAN API V3 sources to rev. `_nnn_ \
2323
`- `_list of major changes (optional)_
24-
3. If necessary, update the CAN API V3 testing sources in `$(PROJROOT)\Tests`
24+
1. If necessary, update the CAN API V3 testing sources in `$(PROJROOT)\Tests`
2525
from the SVN repo and commit them with commit comment:
2626
- `Update CAN API V3 testing sources to rev. `_nnn_ \
2727
`- `_list of major changes (optional)_
28-
4. Check and update the version and date information in the following files:
28+
1. Check and update the version and date information in the following files:
2929
- `$(PROJROOT)\Sources\Version.h`
30-
- `$(PROJROOT)\Sources\PeakCAN.h`
31-
- `$(PROJROOT)\Sources\PeakCAN.cpp`
32-
- `$(PROJROOT)\Sources\Wrapper\can_api.c`
3330
- `$(PROJROOT)\Libraries\CANAPI\uvcanpcb.rc`
3431
- `$(PROJROOT)\Libraries\PeakCAN\PeakCAN.rc`
35-
- `$(PROJROOT)\Utilities\can_moni\Driver.h`
36-
- `$(PROJROOT)\Utilities\can_test\Driver.h`
32+
- `$(PROJROOT)/Utilities/can_moni/README.md`
33+
- `$(PROJROOT)/Utilities/can_port/README.md`
34+
- `$(PROJROOT)/Utilities/can_send/README.md`
35+
- `$(PROJROOT)/Utilities/can_test/README.md`
3736

3837
### Procedure
3938

@@ -43,7 +42,7 @@ _All rights reserved._
4342
2. Open the trial program with Visual Studio and run a code analysis.
4443
- _**There should not be any serious finding.**_
4544
- _If there are findings then fix them or create an issue in the repo._
46-
3. Run `x86_build.bat` and `x64_build.bat` in the project root directory.
45+
3. Run `x64_build.bat` in the project root directory.
4746
- _**There should be absolutely no compiler or linker error!**_
4847
- _If there are compiler or linker warnings then think twice._
4948
4. Try out the trial program with different options.
@@ -71,16 +70,13 @@ _All rights reserved._
7170
2. Double check all version numbers again (see above).
7271
3. Run the batch files in the project root directory:
7372
- `C:\Users\haumea>cd C:\Projects\CAN\Drivers\PeakCAN`
74-
- `C:\Projects\CAN\Drivers\PeakCAN>x86_build.bat`
75-
- `C:\Projects\CAN\Drivers\PeakCAN>x86_install.bat`
7673
- `C:\Projects\CAN\Drivers\PeakCAN>x64_build.bat`
7774
- `C:\Projects\CAN\Drivers\PeakCAN>x64_install.bat`
7875
4. Build the CAN API V3 GoogleTest program:
7976
- `C:\Users\haumea>cd C:\Projects\CAN\Drivers\PeakCAN\Tests`
80-
- `C:\Projects\CAN\Drivers\PeakCAN\Tests>x86_build.bat`
8177
- `C:\Projects\CAN\Drivers\PeakCAN\Tests>x64_build.bat`
8278
5. Run the CAN API V3 GoogleTest program with two PCAN-USB devices in CAN 2.0 mode:
83-
- `C:\Projects\CAN\Drivers\PeakCAN\Tests>Debug\pcb_testing --can_dut1=PCAN-USB1 --can_dut2=PCAN-USB2 --can_mode=2.0 --can_bitrate=DEFAULT --gtest_output=xml:TestReport_PCAN-USB.xml --run_all=YES --smoketest_frames=100000` [...]
79+
- `C:\Projects\CAN\Drivers\PeakCAN\Tests>x64\Debug\pcb_testing --can_dut1=PCAN-USB1 --can_dut2=PCAN-USB2 --can_mode=2.0 --can_bitrate=DEFAULT --gtest_output=xml:TestReport_PCAN-USB.xml --run_all=YES --smoketest_frames=100000` [...]
8480
- _If there is any error then **stop** here or create an issue for each error in the repo._
8581
- Copy the test report into the binary's directory `$(PROJROOT)\Binaries`.
8682
6. Run the CAN API V3 GoogleTest program with two PCAN-USB FD devices in CAN FD mode:
@@ -98,7 +94,7 @@ _All rights reserved._
9894

9995
1. Click on `Draft a new release` in the [GitHub](https://github.com/uv-software/PeakCAN-Wrapper) repo.
10096
2. Fill out all required fields:
101-
- Tag version: e.g `v0.5` (cf. semantic versioning)
97+
- Tag version: e.g `v0.6` (cf. semantic versioning)
10298
- Target: `main` (default branch)
10399
- Release title: e.g. `Release of January 19, 2038`
104100
- Change-log: list all major changes, e.g. from commit comments

Examples/C++/can_recv.cpp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,22 @@ int main(/*int argc, const char * argv[]*/) {
5454
std::cerr << "+++ error: interface could not be started" << std::endl;
5555
goto teardown;
5656
}
57-
std::cout << "Press Ctrl+C to abort..." << std::endl;
57+
std::cout << "Press ^C to abort." << std::endl;
5858
while (running) {
5959
if ((retVal = myDriver.ReadMessage(message, CANREAD_INFINITE)) == CCanApi::NoError) {
6060
fprintf(stdout, "%i\t", frames++);
6161
fprintf(stdout, "%7li.%04li\t", (long)message.timestamp.tv_sec, message.timestamp.tv_nsec / 100000);
62-
if (!opMode.fdoe)
63-
fprintf(stdout, "%03X\t%c%c [%u] ", message.id, message.xtd ? 'X' : 'S', message.rtr ? 'R' : ' ', message.dlc);
64-
else
65-
fprintf(stdout, "%03X\t%c%c%c%c%c [%u] ", message.id, message.xtd ? 'X' : 'S', message.rtr ? 'R' : ' ',
66-
message.fdf ? 'F' : ' ', message.brs ? 'B' : ' ', message.esi ? 'E' :' ', CCanApi::Dlc2Len(message.dlc));
62+
fprintf(stdout, "%03X\t", message.id);
63+
if (!message.sts) {
64+
fputc(message.xtd ? 'X' : 'S', stdout);
65+
fputc(message.fdf ? 'F' : '-', stdout);
66+
fputc(message.brs ? 'B' : '-', stdout);
67+
fputc(message.esi ? 'E' : '-', stdout);
68+
fputc(message.rtr ? 'R' : '-', stdout);
69+
} else {
70+
fprintf(stdout, "Error");
71+
}
72+
printf(" [%u]", CCanApi::Dlc2Len(message.dlc));
6773
for (uint8_t i = 0; i < CCanApi::Dlc2Len(message.dlc); i++)
6874
fprintf(stdout, " %02X", message.data[i]);
6975
if (message.sts)

Examples/Python/CANAPI.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
#
33
# CAN Interface API, Version 3 (Python Wrapper)
44
#
5-
# Copyright (c) 2005-2025 Uwe Vogt, UV Software, Berlin ([email protected])
6-
# All rights reserved.
5+
# Copyright (c) 2005-2012 Uwe Vogt, UV Software, Friedrichshafen
6+
# Copyright (c) 2013-2025 Uwe Vogt, UV Software, Berlin ([email protected])
7+
# All rights reserved.
78
#
89
# This file is part of CAN API V3.
910
#
@@ -21,7 +22,7 @@
2122
# this list of conditions and the following disclaimer in the documentation
2223
# and/or other materials provided with the distribution.
2324
#
24-
# CAN API V3 IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
25+
# CAN API V3 IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2526
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2627
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
2728
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
@@ -54,9 +55,9 @@
5455
Interface API for various CAN interfaces from different
5556
vendors running under multiple operating systems.
5657
57-
$Author: quaoar $
58+
$Author: makemake $
5859
59-
$Rev: 1408 $
60+
$Rev: 1416 $
6061
"""
6162
from ctypes import *
6263
import platform
@@ -71,7 +72,7 @@
7172

7273
# CAN API V3 - Python Wrapper
7374
#
74-
CAN_API_V3_PYTHON = {'major': 0, 'minor': 3, 'patch': 1}
75+
CAN_API_V3_PYTHON = {'major': 0, 'minor': 3, 'patch': 2}
7576

7677
# CAN Identifier Ranges
7778
#

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,38 +83,43 @@ C:\Projects\CAN\Drivers\PeakCAN>build_no.bat
8383
```
8484
Repeat this step after each `git commit`, `git pull`, `git clone`, etc.
8585
86-
To build all 32-bit targets (x86) run the script `x86_build.bat`.
87-
```
88-
C:\Users\haumea>cd C:\Projects\CAN\Drivers\PeakCAN
89-
C:\Projects\CAN\Drivers\PeakCAN>x86_build.bat
90-
```
91-
92-
To build all 64-bit targets (x64) run the script `x64_build.bat`.
86+
To build all targets (x64) run the script `x64_build.bat`.
9387
```
9488
C:\Users\haumea>cd C:\Projects\CAN\Drivers\PeakCAN
9589
C:\Projects\CAN\Drivers\PeakCAN>x64_build.bat
9690
```
9791
(The version number of the libraries can be adapted by editing the `.rc` files in the corresponding subfolders. Don´t forget to set the version number also in the header file `Version.h`.)
9892
99-
#### uvPeakCAN (DLL)
93+
#### Libraries
94+
95+
##### uvPeakCAN (DLL)
10096
10197
___uvPeakCAN___ is a dynamic link library with a CAN API V3 compatible application programming interface for use in __C++__ applications.
10298
See header file `PeakCAN.h` for a description of all class members.
10399
104-
#### u3canpcb (DLL)
100+
##### u3canpcb (DLL)
105101
106102
___u3canpcb___ is a dynamic link library with a CAN API V3 compatible application programming interface for use in __C__ applications.
107103
See header file `can_api.h` for a description of all API functions.
108104
109-
#### can_moni (CLI)
105+
#### Utilities
106+
107+
##### can_send
108+
109+
`can_send` is a command line tool to send CAN messages that are entered at the program prompt.
110+
The syntax is taken from the Linux SocketCAN utility [can_utils\cansend](https://github.com/linux-can/can-utils/tree/master).
111+
112+
Type `can_send /?` to display all program options.
113+
114+
##### can_moni (CLI)
110115
111116
`can_moni` is a command line tool to view incoming CAN messages.
112117
I hate this messing around with binary masks for identifier filtering.
113118
So I wrote this little program to have an exclude list for single identifiers or identifier ranges (see program option `/EXCLUDE` or just `/X`). Precede the list with a `~` and you get an include list.
114119
115120
Type `can_moni /?` to display all program options.
116121
117-
#### can_test (CLI)
122+
##### can_test (CLI)
118123
119124
`can_test` is a command line tool to test CAN communication.
120125
Originally developed for electronic environmental tests on an embedded Linux system with SocketCAN, I´m using it for many years as a traffic generator for CAN stress-tests.
@@ -127,7 +132,7 @@ Type `can_test /?` to display all program options.
127132
128133
### Development Environment
129134
130-
- Microsoft Visual Studio Community 2022 (Version 17.12.4)
135+
- Microsoft Visual Studio Community 2022 (Version 17.13.2)
131136
132137
### Required PCANBasic DLL
133138
@@ -168,7 +173,7 @@ You can choose between one of them if you use these portions of this work in who
168173
169174
Windows is a registered trademark of Microsoft Corporation in the United States and/or other countries. \
170175
PCAN is a registered trademark of PEAK-System Technik GmbH, Darmstadt, Germany. \
171-
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries. \
176+
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries and regions. \
172177
Linux is a registered trademark of Linus Torvalds. \
173178
All other company, product and service names mentioned herein may be trademarks, registered trademarks, or service marks of their respective owners.
174179

Sources/CANAPI/.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
.svn
2-
# Not realized yet
3-
CANIPC_Message.h
42
# we don't use the JSON files yet
53
can_dev.?
64
vanilla.?
75
# other blacklisted files
86
SerialCAN_Defines.h
97
SocketCAN_Defines.h
108
RocketCAN_Defines.h
9+
CANIPC_Message.h

Sources/CANAPI/CANAPI_Version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@
5353
*
5454
* @note This is only a dummy file to have a SVN revision number.
5555
*
56-
* @author $Author: makemake $
56+
* @author $Author: quaoar $
5757
*
58-
* @version $Rev: 1407 $
58+
* @version $Rev: 1467 $
5959
*
6060
* @addtogroup can_api
6161
* @{
6262
*/
6363
#ifndef CANAPI_VERSION_H_INCLUDED
6464
#define CANAPI_VERSION_H_INCLUDED
65-
// SVN revision number (update with each commit: III)
66-
#define CAN_API_REV "$Rev: 1407 $"
65+
// SVN revision number (update with each commit: VI)
66+
#define CAN_API_REV "$Rev: 1467 $"
6767
#endif /* CANAPI_VERSION_H_INCLUDED */
6868
/** @}
6969
*/

0 commit comments

Comments
 (0)