Skip to content

Commit 8514061

Browse files
author
Uwe Vogt
committed
Add README and LICENSE
1 parent 744b9d3 commit 8514061

File tree

3 files changed

+344
-0
lines changed

3 files changed

+344
-0
lines changed

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#.gitignore
2+
api/build_no.h
3+
x86
4+
x64
5+
dll/.vs
6+
dll/x64
7+
dll/Debug
8+
dll/Release
9+
dll/uvcanpcb.vcxproj.user
10+
tst/.vs
11+
tst/x64
12+
tst/Debug
13+
tst/Release
14+
tst/pcb_test.vcxproj.user

LICENSE

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
GNU LESSER GENERAL PUBLIC LICENSE
2+
Version 3, 29 June 2007
3+
4+
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5+
Everyone is permitted to copy and distribute verbatim copies
6+
of this license document, but changing it is not allowed.
7+
8+
9+
This version of the GNU Lesser General Public License incorporates
10+
the terms and conditions of version 3 of the GNU General Public
11+
License, supplemented by the additional permissions listed below.
12+
13+
0. Additional Definitions.
14+
15+
As used herein, "this License" refers to version 3 of the GNU Lesser
16+
General Public License, and the "GNU GPL" refers to version 3 of the GNU
17+
General Public License.
18+
19+
"The Library" refers to a covered work governed by this License,
20+
other than an Application or a Combined Work as defined below.
21+
22+
An "Application" is any work that makes use of an interface provided
23+
by the Library, but which is not otherwise based on the Library.
24+
Defining a subclass of a class defined by the Library is deemed a mode
25+
of using an interface provided by the Library.
26+
27+
A "Combined Work" is a work produced by combining or linking an
28+
Application with the Library. The particular version of the Library
29+
with which the Combined Work was made is also called the "Linked
30+
Version".
31+
32+
The "Minimal Corresponding Source" for a Combined Work means the
33+
Corresponding Source for the Combined Work, excluding any source code
34+
for portions of the Combined Work that, considered in isolation, are
35+
based on the Application, and not on the Linked Version.
36+
37+
The "Corresponding Application Code" for a Combined Work means the
38+
object code and/or source code for the Application, including any data
39+
and utility programs needed for reproducing the Combined Work from the
40+
Application, but excluding the System Libraries of the Combined Work.
41+
42+
1. Exception to Section 3 of the GNU GPL.
43+
44+
You may convey a covered work under sections 3 and 4 of this License
45+
without being bound by section 3 of the GNU GPL.
46+
47+
2. Conveying Modified Versions.
48+
49+
If you modify a copy of the Library, and, in your modifications, a
50+
facility refers to a function or data to be supplied by an Application
51+
that uses the facility (other than as an argument passed when the
52+
facility is invoked), then you may convey a copy of the modified
53+
version:
54+
55+
a) under this License, provided that you make a good faith effort to
56+
ensure that, in the event an Application does not supply the
57+
function or data, the facility still operates, and performs
58+
whatever part of its purpose remains meaningful, or
59+
60+
b) under the GNU GPL, with none of the additional permissions of
61+
this License applicable to that copy.
62+
63+
3. Object Code Incorporating Material from Library Header Files.
64+
65+
The object code form of an Application may incorporate material from
66+
a header file that is part of the Library. You may convey such object
67+
code under terms of your choice, provided that, if the incorporated
68+
material is not limited to numerical parameters, data structure
69+
layouts and accessors, or small macros, inline functions and templates
70+
(ten or fewer lines in length), you do both of the following:
71+
72+
a) Give prominent notice with each copy of the object code that the
73+
Library is used in it and that the Library and its use are
74+
covered by this License.
75+
76+
b) Accompany the object code with a copy of the GNU GPL and this license
77+
document.
78+
79+
4. Combined Works.
80+
81+
You may convey a Combined Work under terms of your choice that,
82+
taken together, effectively do not restrict modification of the
83+
portions of the Library contained in the Combined Work and reverse
84+
engineering for debugging such modifications, if you also do each of
85+
the following:
86+
87+
a) Give prominent notice with each copy of the Combined Work that
88+
the Library is used in it and that the Library and its use are
89+
covered by this License.
90+
91+
b) Accompany the Combined Work with a copy of the GNU GPL and this license
92+
document.
93+
94+
c) For a Combined Work that displays copyright notices during
95+
execution, include the copyright notice for the Library among
96+
these notices, as well as a reference directing the user to the
97+
copies of the GNU GPL and this license document.
98+
99+
d) Do one of the following:
100+
101+
0) Convey the Minimal Corresponding Source under the terms of this
102+
License, and the Corresponding Application Code in a form
103+
suitable for, and under terms that permit, the user to
104+
recombine or relink the Application with a modified version of
105+
the Linked Version to produce a modified Combined Work, in the
106+
manner specified by section 6 of the GNU GPL for conveying
107+
Corresponding Source.
108+
109+
1) Use a suitable shared library mechanism for linking with the
110+
Library. A suitable mechanism is one that (a) uses at run time
111+
a copy of the Library already present on the user's computer
112+
system, and (b) will operate properly with a modified version
113+
of the Library that is interface-compatible with the Linked
114+
Version.
115+
116+
e) Provide Installation Information, but only if you would otherwise
117+
be required to provide such information under section 6 of the
118+
GNU GPL, and only to the extent that such information is
119+
necessary to install and execute a modified version of the
120+
Combined Work produced by recombining or relinking the
121+
Application with a modified version of the Linked Version. (If
122+
you use option 4d0, the Installation Information must accompany
123+
the Minimal Corresponding Source and Corresponding Application
124+
Code. If you use option 4d1, you must provide the Installation
125+
Information in the manner specified by section 6 of the GNU GPL
126+
for conveying Corresponding Source.)
127+
128+
5. Combined Libraries.
129+
130+
You may place library facilities that are a work based on the
131+
Library side by side in a single library together with other library
132+
facilities that are not Applications and are not covered by this
133+
License, and convey such a combined library under terms of your
134+
choice, if you do both of the following:
135+
136+
a) Accompany the combined library with a copy of the same work based
137+
on the Library, uncombined with any other library facilities,
138+
conveyed under the terms of this License.
139+
140+
b) Give prominent notice with the combined library that part of it
141+
is a work based on the Library, and explaining where to find the
142+
accompanying uncombined form of the same work.
143+
144+
6. Revised Versions of the GNU Lesser General Public License.
145+
146+
The Free Software Foundation may publish revised and/or new versions
147+
of the GNU Lesser General Public License from time to time. Such new
148+
versions will be similar in spirit to the present version, but may
149+
differ in detail to address new problems or concerns.
150+
151+
Each version is given a distinguishing version number. If the
152+
Library as you received it specifies that a certain numbered version
153+
of the GNU Lesser General Public License "or any later version"
154+
applies to it, you have the option of following the terms and
155+
conditions either of that published version or of any later version
156+
published by the Free Software Foundation. If the Library as you
157+
received it does not specify a version number of the GNU Lesser
158+
General Public License, you may choose any version of the GNU Lesser
159+
General Public License ever published by the Free Software Foundation.
160+
161+
If the Library as you received it specifies that a proxy can decide
162+
whether future versions of the GNU Lesser General Public License shall
163+
apply, that proxy's public statement of acceptance of any version is
164+
permanent authorization for you to choose that version for the
165+
Library.

README.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
### Wrapper Library for PEAK PCAN&reg; Interfaces (Windows&reg;)
2+
3+
_Copyright &copy; 2005-2021 Uwe Vogt, UV Software, Berlin ([email protected])_
4+
5+
# CAN API V3 for PCAN Interfaces
6+
7+
CAN API V3 is a wrapper specification to have a uniform CAN Interface API for various CAN interfaces from different vendors running under multiple operating systems.
8+
9+
## PCANBasic-Wrapper
10+
11+
This repo contains the source code for a CAN API V3 compatible wrapper library under Windows for PCAN Interfaces from PEAK-System Technik GmbH.
12+
The wrapper library is build upon the PCANBasic DLL.
13+
14+
### CAN Interface API, Version 3
15+
16+
```C
17+
#if (OPTION_CANAPI_LIBRARY != 0)
18+
extern int can_test(int32_t library, int32_t board, uint8_t mode, const void *param, int *result);
19+
extern int can_init(int32_t library, int32_t board, uint8_t mode, const void *param);
20+
#else
21+
extern int can_test(int32_t board, uint8_t mode, const void *param, int *result);
22+
extern int can_init(int32_t board, uint8_t mode, const void *param);
23+
#endif
24+
extern int can_exit(int handle);
25+
extern int can_kill(int handle);
26+
27+
extern int can_start(int handle, const can_bitrate_t *bitrate);
28+
extern int can_reset(int handle);
29+
30+
extern int can_write(int handle, const can_message_t *message, uint16_t timeout);
31+
extern int can_read(int handle, can_message_t *message, uint16_t timeout);
32+
33+
extern int can_status(int handle, uint8_t *status);
34+
extern int can_busload(int handle, uint8_t *load, uint8_t *status);
35+
36+
extern int can_bitrate(int handle, can_bitrate_t *bitrate, can_speed_t *speed);
37+
extern int can_property(int handle, uint16_t param, void *value, uint32_t nbyte);
38+
39+
extern char *can_hardware(int handle);
40+
extern char *can_software(int handle);
41+
42+
#if (OPTION_CANAPI_LIBRARY != 0)
43+
extern char *can_library(int handle);
44+
#endif
45+
extern char* can_version(void);
46+
```
47+
See header file `can_api.h` for a description of the provided functions.
48+
49+
50+
## Build Targets
51+
52+
Important note: _To build any of the following build targets run the script_ `build_no.bat` _to generate a pseudo build number._
53+
```
54+
C:\Users\haumea>cd C:\Projects\CAN\DRV\Drivers\PCANBbasic
55+
C:\Projects\CAN\DRV\Drivers\PCANBbasic>build_no.bat
56+
```
57+
Repeat this step after each `git commit`, `git pull`, `git clone`, etc.
58+
59+
_Tbd._
60+
61+
#### pcan (DLL)
62+
63+
___pcan___ is a dynamic link library with a CAN API V3 compatible application programming interface for use in __C++__ applications.
64+
See header file `PCAN.h` for a description of all class members.
65+
66+
#### u3canpcb (DLL)
67+
68+
___u3canpcb___ is a dynamic link library with a CAN API V3 compatible application programming interface for use in __C__ applications.
69+
See header file `can_api.h` for a description of all API functions.
70+
71+
#### can_moni (CLI)
72+
73+
`can_moni` is a command line tool to view incoming CAN messages.
74+
I hate this messing around with binary masks for identifier filtering.
75+
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.
76+
77+
Type `can_moni /?` to display all program options.
78+
79+
#### can_test (CLI)
80+
81+
`can_test` is a command line tool to test CAN communication.
82+
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.
83+
84+
Type `can_test /?` to display all program options.
85+
86+
### Target Platform
87+
88+
- Windows 10 (x64 operating systems)
89+
90+
### Development Environments
91+
92+
- Microsoft Visual Studio Community 2017 (Version 15.9)
93+
94+
### Supported CAN Hardware
95+
96+
- PCAN-USB - single channel, CAN 2.0 (Peak´s item no.: IPEH-002021, IPEH-002021)
97+
- PCAN-USB FD - single channel, CAN 2.0 and CAN FD (Peak´s item no.: IPEH-004022)
98+
- PCAN-USB Pro FD - dual channel, CAN 2.0 and CAN FD (Peak´s item no.: IPEH-004061)
99+
100+
### Required PCANBasic DLL
101+
102+
- Version 4.5 or later _(Latest is Greatest!)_
103+
104+
## Known Bugs and Caveats
105+
106+
- ...
107+
108+
## This and That
109+
110+
The PCANBasic DLL can be downloaded form [Peak-System](https://www.peak-system.com/) website.
111+
Please note the copyright and license agreements.
112+
113+
### Licenses
114+
115+
#### CAN API V3 License
116+
117+
CAN API V3 is free software: you can redistribute it and/or modify
118+
it under the terms of the GNU Lesser General Public License as published by
119+
the Free Software Foundation, either version 3 of the License, or
120+
(at your option) any later version.
121+
122+
CAN API V3 is distributed in the hope that it will be useful,
123+
but WITHOUT ANY WARRANTY; without even the implied warranty of
124+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
125+
GNU Lesser General Public License for more details.
126+
127+
You should have received a copy of the GNU Lesser General Public License
128+
along with CAN API V3. If not, see <http://www.gnu.org/licenses/>.
129+
130+
#### PCANBasic-Wrapper License
131+
132+
PCANBasic-Wrapper is free software: you can redistribute it and/or modify
133+
it under the terms of the GNU Lesser General Public License as published by
134+
the Free Software Foundation, either version 3 of the License, or
135+
(at your option) any later version.
136+
137+
PCANBasic-Wrapper is distributed in the hope that it will be useful,
138+
but WITHOUT ANY WARRANTY; without even the implied warranty of
139+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
140+
GNU Lesser General Public License for more details.
141+
142+
You should have received a copy of the GNU Lesser General Public License
143+
along with PCANBasic-Wrapper. If not, see <http://www.gnu.org/licenses/>.
144+
145+
### Trademarks
146+
147+
Windows is a registered trademark of Microsoft Corporation in the United States and/or other countries. \
148+
PCAN is a registered trademark of PEAK-System Technik GmbH, Darmstadt, Germany.
149+
150+
### Hazard Note
151+
152+
_If you connect your CAN device to a real CAN network when using this library, you might damage your application._
153+
154+
### Contact
155+
156+
Uwe Vogt \
157+
UV Software \
158+
Chausseestrasse 33a \
159+
10115 Berlin \
160+
Germany
161+
162+
E-Mail: mailto://[email protected] \
163+
Internet: https://www.uv-software.de
164+
165+
##### *Enjoy!*

0 commit comments

Comments
 (0)