Skip to content

Commit

Permalink
Merge pull request #18 from mac-can/development
Browse files Browse the repository at this point in the history
Release candidate 1 for version v0.2 SR9
  • Loading branch information
mac-can authored Jun 12, 2024
2 parents 4b57e39 + d9a15ad commit 44b0d6e
Show file tree
Hide file tree
Showing 73 changed files with 9,461 additions and 3,091 deletions.
9 changes: 2 additions & 7 deletions Deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ _All rights reserved._

### Preparation

1. If necessary, update the PCBUSB header file in `$(PROJROOT)/Sources/PCANBasic`
1. If necessary, update the PCBUSB header file in `$(PROJROOT)/Sources/PCANBasic/macOS`
from MacCAN´s website and commit it with commit comment:
- `Update PCBUSB header file (version `_n_`.`_n_`.`_n_`)` \
`- `_list of major changes (optional)_
Expand All @@ -27,14 +27,9 @@ _All rights reserved._
`- `_list of major changes (optional)_
4. Check and update the version and date information in the following files:
- `$(PROJROOT)\Sources\Version.h`
- `$(PROJROOT)/Sources/PeakCAN.h`
- `$(PROJROOT)/Sources/PeakCAN.cpp`
- `$(PROJROOT)/Sources/Wrapper\can_api.c`
- `$(PROJROOT)/Libraries/CANAPI/Makefile`<sup>*</sup>
- `$(PROJROOT)/Libraries/PeakCAN/Makefile`<sup>*</sup>
- `$(PROJROOT)/Utilities/can_moni/Driver.h`
- `$(PROJROOT)/Utilities/can_moni/README.md`
- `$(PROJROOT)/Utilities/can_test/Driver.h`
- `$(PROJROOT)/Utilities/can_test/README.md`

<sup>*</sup>_) Set variable_ `CURRENT_VERSION` _and_ `COMPATIBILITY_VERSION` _accordingly._
Expand Down Expand Up @@ -105,7 +100,7 @@ _All rights reserved._

1. Click on `Draft a new release` in the [GitHub](https://github.com/mac-can/PCBUSB-Wrapper) repo.
2. Fill out all required fields:
- Tag version: e.g `v0.2.8` (cf. semantic versioning)
- Tag version: e.g `v0.2.9` (cf. semantic versioning)
- Target: `main` (default branch)
- Release title: e.g. `Release of January 19, 2038`
- Change-log: list all major changes, e.g. from commit comments
Expand Down
16 changes: 14 additions & 2 deletions Libraries/CANAPI/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ current_OS := $(patsubst MSYS%,MinGW,$(current_OS))

MAJOR = 0
MINOR = 2
PATCH = 8
PATCH = 9

ifeq ($(PATCH),0)
VERSION = $(MAJOR).$(MINOR)
Expand All @@ -77,7 +77,6 @@ DEFINES = -DOPTION_CAN_2_0_ONLY=0 \

HEADERS = -I$(SOURCE_DIR) \
-I$(CANAPI_DIR) \
-I$(PCBUSB_DIR)/macOS \
-I$(WRAPPER_DIR)


Expand All @@ -94,8 +93,12 @@ COMPATIBILITY_VERSION = $(MAJOR).$(MINOR).0

INSTALL = /usr/local/lib

OBJECTS += $(OUTDIR)/PCBUSB.o

DEFINES += -DOPTION_CANAPI_PCBUSB_DYLIB=1

HEADERS += -I$(PCBUSB_DIR)/macOS

CFLAGS += -O2 -Wall -Wextra -Wno-parentheses \
-fno-strict-aliasing \
$(DEFINES) \
Expand Down Expand Up @@ -138,8 +141,13 @@ STATIC = $(LIBRARY).a

INSTALL = /usr/local/lib

# note: take the loader from MacCAN-PCBUSB dylib
OBJECTS += $(OUTDIR)/PCBUSB.o

DEFINES += -DOPTION_CANAPI_PCANBASIC_SO=1

HEADERS += -I$(PCBUSB_DIR)/Linux

CFLAGS += -fPIC -O2 -Wall -Wextra -Wno-parentheses \
-fno-strict-aliasing \
$(DEFINES) \
Expand Down Expand Up @@ -222,6 +230,10 @@ ifeq ($(current_OS),Linux)
endif


ifeq ($(current_OS),$(filter $(current_OS),Linux Darwin))
$(OUTDIR)/PCBUSB.o: $(PCBUSB_DIR)/macOS/PCBUSB.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<
endif
$(OUTDIR)/can_api.o: $(WRAPPER_DIR)/can_api.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<

Expand Down
16 changes: 14 additions & 2 deletions Libraries/PeakCAN/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ current_OS := $(patsubst MSYS%,MinGW,$(current_OS))

MAJOR = 0
MINOR = 2
PATCH = 8
PATCH = 9

ifeq ($(PATCH),0)
VERSION = $(MAJOR).$(MINOR)
Expand All @@ -77,7 +77,6 @@ DEFINES = -DOPTION_CAN_2_0_ONLY=0 \

HEADERS = -I$(SOURCE_DIR) \
-I$(CANAPI_DIR) \
-I$(PCBUSB_DIR)/macOS \
-I$(WRAPPER_DIR)


Expand All @@ -94,9 +93,13 @@ COMPATIBILITY_VERSION = $(MAJOR).$(MINOR).0

INSTALL = /usr/local/lib

OBJECTS += $(OUTDIR)/PCBUSB.o

DEFINES += -DOPTION_CANAPI_PCBUSB_DYLIB=0 \
-DOPTION_PEAKCAN_DYLIB=1

HEADERS += -I$(PCBUSB_DIR)/macOS

CFLAGS += -O2 -Wall -Wextra -Wno-parentheses \
-fno-strict-aliasing \
$(DEFINES) \
Expand Down Expand Up @@ -139,9 +142,14 @@ STATIC = $(LIBRARY).a

INSTALL = /usr/local/lib

# note: take the loader from MacCAN-PCBUSB dylib
OBJECTS += $(OUTDIR)/PCBUSB.o

DEFINES += -DOPTION_CANAPI_PCANBASIC_SO=0 \
-DOPTION_PEAKCAN_SO=1

HEADERS += -I$(PCBUSB_DIR)/Linux

CFLAGS += -fPIC -O2 -Wall -Wextra -Wno-parentheses \
-fno-strict-aliasing \
$(DEFINES) \
Expand Down Expand Up @@ -224,6 +232,10 @@ ifeq ($(current_OS),Linux)
endif


ifeq ($(current_OS),$(filter $(current_OS),Linux Darwin))
$(OUTDIR)/PCBUSB.o: $(PCBUSB_DIR)/macOS/PCBUSB.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<
endif
$(OUTDIR)/can_api.o: $(WRAPPER_DIR)/can_api.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Note: _The PCBUSB library is not included in this repo, and must be installed se

```C++
/// \name PeakCAN API
/// \brief CAN API V3 wrapper for PEAK-System PCAN-USB interfaces
/// \brief CAN API V3 wrapper for PEAK-System PCAN USB interfaces
/// \note See CCanApi for a description of the overridden methods
/// \{
class CPeakCAN : public CCanApi {
Expand Down Expand Up @@ -124,19 +124,19 @@ Type `can_test --help` to display all program options.
#### macOS Sonoma
- macOS Sonoma (14.4.1) on a Mac mini (M1, 2020)
- macOS Sonoma (14.5) on a Mac mini (M1, 2020)
- Apple clang version 15.0.0 (clang-1500.3.9.4)
- Xcode Version 15.3 (15E204a)
- Xcode Version 15.4 (15F31d)
#### macOS Monterey
- macOS Monterey (12.7.4) on a MacBook Pro (2019)
- macOS Monterey (12.7.5) on a MacBook Pro (2019)
- Apple clang version 13.0.0 (clang-1300.0.29.30)
- Xcode Version 13.2.1 (13C100)
#### Debian "bookworm" (12.5)
- Debian 6.1,76-1 (2024-02-01) x86_64 GNU/Linux
- Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
- gcc (Debian 12.2.0-14) 12.2.0
- PCAN Driver and Library for Linux v8.17
Expand All @@ -161,7 +161,7 @@ Please note the copyright and license agreements.
The PCAN Linux (chardev) driver and library can be downloaded form [Peak's](https://www.peak-system.com/fileadmin/media/linux/index.htm/) website.
### Wrapper Library for Windows&reg;
### PCAN Wrapper Library for Windows&reg;
A CAN API V3 compatible Wrapper Library for Windows is also available.
It is build upon Peak´s PCANBasic DLL and can be downloaded from / cloned at [GitHub](https://github.com/uv-software/PCANBasic-Wrapper).
Expand All @@ -176,8 +176,6 @@ Except where otherwise noted, this work is dual-licensed under the terms of the
and under the terms of the GNU General Public License v3.0 (or any later version).
You can choose between one of them if you use these portions of this work in whole or in part.
`SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-or-later`
### Trademarks
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries. \
Expand Down
5 changes: 5 additions & 0 deletions Sources/CANAPI/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.svn
# we don't use the JSON files yet
can_dev.?
vanilla.?
# other blacklisted files
SerialCAN_Defines.h
SocketCAN_Defines.h
RocketCAN_Defines.h
39 changes: 30 additions & 9 deletions Sources/CANAPI/CANAPI.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
/// zero to compile your program with the CAN API source files or to
/// link your program with the static library at compile-time.
///
/// \author $Author: eris $
/// \author $Author: quaoar $
//
/// \version $Rev: 1270 $
/// \version $Rev: 1294 $
//
/// \defgroup can_api CAN Interface API, Version 3
/// \{
Expand Down Expand Up @@ -191,7 +191,20 @@ class CANCPP CCanApi {
char m_szVendorName[CANPROP_MAX_BUFFER_SIZE]; ///< vendor name at actual index in the vendor list
char m_szVendorDllName[CANPROP_MAX_BUFFER_SIZE]; ///< file name of the DLL at actual index in the vendor list
};
/// \brief query library information of the first CAN API library in the
/// \brief sets the search path for readings library informations from
/// JSON files.
//
/// \note The search path can only be set once, either by ths function
/// or by the non-default constructor with a path argument.
//
/// \param[in] path - path name, or NULL for current working directory
//
/// \returns true if the search path has been successfully set, or
/// false on error.
//
static bool SetSearchPath(const char *path);

/// \brief queries library information of the first CAN API library in the
/// list of vendors, if any.
//
/// \param[out] info - the library information of the first entry in the list
Expand All @@ -201,7 +214,7 @@ class CANCPP CCanApi {
//
static bool GetFirstLibrary(SLibraryInfo &info);

/// \brief query library information of the next CAN API library in the
/// \brief queries library information of the next CAN API library in the
/// list of vendors, if any.
//
/// \param[out] info - the library information of the next entry in the list
Expand All @@ -211,7 +224,7 @@ class CANCPP CCanApi {
//
static bool GetNextLibrary(SLibraryInfo &info);
#endif
/// \brief query channel information of the first CAN interface in the
/// \brief queries channel information of the first CAN interface in the
/// list of CAN interfaces, if any.
//
/// \param[in] library - library id of the CAN interface list, or -1 for all vendors
Expand All @@ -227,7 +240,7 @@ class CANCPP CCanApi {
static bool GetFirstChannel(SChannelInfo &info, void *param = NULL);
#endif

/// \brief query channel information of the next CAN interface in the
/// \brief queries channel information of the next CAN interface in the
/// list of CAN interfaces, if any.
//
/// \param[out] info - the channel information of the next entry in the list
Expand Down Expand Up @@ -464,8 +477,16 @@ class CANCPP CCanApi {
//
virtual char *GetFirmwareVersion() = 0; // deprecated

/// \brief retrieves version information of the CAN API V3 driver
/// as a zero-terminated string.
#if (OPTION_CANAPI_LIBRARY != 0)
/// \brief retrieves version information of the CAN API V3 wrapper
/// library as a zero-terminated string.
//
/// \returns pointer to a zero-terminated string, or NULL on error.
//
virtual char *GetSoftwareVersion() = 0; // deprecated
#endif
/// \brief retrieves version information of the CAN API V3 wrapper
/// (or loader) library as a zero-terminated string.
//
/// \returns pointer to a zero-terminated string, or NULL on error.
//
Expand Down Expand Up @@ -515,4 +536,4 @@ class CANCPP CCanApi {
/// \}
#endif // CANAPI_H_INCLUDED
/// \}
// $Id: CANAPI.h 1270 2024-04-15 18:42:43Z eris $ Copyright (c) UV Software //
// $Id: CANAPI.h 1294 2024-05-16 19:50:25Z quaoar $ Copyright (c) UV Software //
20 changes: 11 additions & 9 deletions Sources/CANAPI/CANAPI_Defines.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 - Definitions and Options
*
* @author $Author: eris $
* @author $Author: quaoar $
*
* @version $Rev: 1270 $
* @version $Rev: 1293 $
*
* @addtogroup can_api
* @{
Expand Down Expand Up @@ -79,23 +79,25 @@ extern "C" {

/** @name Library IDs
* @brief Unique IDs to identify a CAN API library (CAN API V1 compatible)
* @note These defines are still valid, but IDs are taken from JSON files.
* @{ */
#define CANLIB_IXXAT_VCI 100 /**< IXXAT Virtual CAN interfaces */
#define CANLIB_IXXAT_CAC 800 /**< IXXAT canAnalyzer/32 Client */
#define CANLIB_PEAK_PCAN 200 /**< PEAK PCAN interfaces */
#define CANLIB_PEAK_PCAN 200 /**< PEAK PCAN-Light interfaces */
#define CANLIB_VECTOR_XL 300 /**< Vector XL-Driver library */
#define CANLIB_PCANBASIC 400 /**< PEAK PCAN-Basic interfaces */
#define CANLIB_RUSOKU_LT 500 /**< Rusuko TouCAN interfaces */
#define CANLIB_RUSOKU_LT 500 /**< Rusoku TouCAN interfaces */
#define CANLIB_KVASER_32 600 /**< Kvaser CANLIB (canlib32) */
#define CANLIB_ROCKETCAN 700 /**< CAN-over-IP (RocketCAN) */
#define CANLIB_SERIALCAN 900 /**< Serial-Line (SerialCAN) */
#define CANLIB_SOCKETCAN 1000 /**< Linux CAN (SocketCAN) */
#define CANLIB_SOCKETCAN 1000 /**< Linux-CAN (SocketCAN) */
#define CANLIB_CANAPILIB (-1) /**< CAN API Main Library */
/** @note Peak's PCAN-Light DLL is outdated, so the library ID can be reused.
/** @note PCAN-Light is outdated, its ID is reused by macCAN-PeakCAN.
* @} */

/** @name Library Names
* @brief Filenames of the CAN API libraries (depending on the platform)
* @note Theses defines are outdated. DLL names are taken from JSON files.
* @{ */
#if defined(__linux__)
#define CANAPI_PLATFORM "Linux"
Expand Down Expand Up @@ -154,9 +156,9 @@ extern "C" {
#define CAN_API_WEBSITE "www.uv-software.com"
#define CAN_API_CONTACT "info@uv-software.com"
#define CAN_API_LICENSE "BSD-2-Clause OR GPL-3.0-or-later"
#define CAN_API_COPYRIGHT "Copyright (c) 2005-20%02u, UV Software, Berlin"
#define CAN_API_HAZARD_NOTE "Do not connect your CAN device to a real CAN network when using this program.\n" \
"This can damage your application."
#define CAN_API_COPYRIGHT "Copyright (c) 2004-20%02u, UV Software, Berlin"
#define CAN_API_HAZARD_NOTE "If you connect your CAN device to a real CAN network when using this library,\n" \
"you might damage your application."
/** @} */


Expand Down
Loading

0 comments on commit 44b0d6e

Please sign in to comment.