Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,27 @@ Type `can_test --help` to display all program options.
- macOS 13.0 and later (Intel and Apple silicon)
- Debian GNU/Linux 12 (Linux Kernel 6.x)

### Development Environment
### Development Environments

#### macOS Sequoia

- macOS Sequoia (15.2) on a Mac mini (M1, 2020)
- macOS Sequoia (15.3.1) on a Mac mini (M4 Pro, 2024)
- Apple clang version 16.0.0 (clang-1600.0.26.6)

#### macOS Ventura

- macOS Ventura (13.7.2) on a MacBook Pro (2019)
- macOS Ventura (13.7.4) on a MacBook Pro (2019)
- Apple clang version 14.0.3 (clang-1403.0.22.14.1)

#### Debian 12.9 ("bookworm")
- Debian 6.1.123-1 (2024-11-22) x86_64 GNU/Linux
- Debian 6.1.128-1 (2025-02-07) x86_64 GNU/Linux
- gcc (Debian 12.2.0-14) 12.2.0
- PCAN Driver and Library for Linux v8.19

### Required PCBUSB Library
libPCBUSB.x.y.dylib - Version 0.13 or later (Latest is Greatest!)
### Required Library

#### macOS
- libPCBUSB.x.y.dylib - Version 0.13 or later (Latest is Greatest!)

#### Linux
- libpcanbasic.so - PCAN Driver and Library for Linux, Version 8.20

### Supported Devices

Expand Down Expand Up @@ -115,7 +117,7 @@ It can be downloaded from <https://www.mac-can.com/>.

### Trademarks

Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries. \
Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries and regions. \
PCAN is a registered trademark of PEAK-System Technik GmbH, Darmstadt, Germany. \
POSIX is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc. \
GNU C/C++ is a registered trademark of Free Software Foundation, Inc. \
Expand Down
12 changes: 6 additions & 6 deletions Utilities/Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#
# CAN Utilities for PEAK-System PCAN USB Interfaces (macOS, x86_64 & arm64)
#
# Copyright (c) 2007-2010 Uwe Vogt, UV Software, Friedrichshafen
# Copyright (c) 2012-2024 Uwe Vogt, UV Software, Berlin (info@mac-can.com)
# Copyright (c) 2005-2010 Uwe Vogt, UV Software, Friedrichshafen
# Copyright (c) 2012-2025 Uwe Vogt, UV Software, Berlin (info@mac-can.com)
#
# These utilities are free software: you can redistribute it and/or modify
# These utilities are free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# These utilities is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with these utilities. If not, see <https://www.gnu.org/licenses/>.
# You should have received a copy of the GNU General Public License along
# with these utilities; if not, see <https://www.gnu.org/licenses/>.
#
all:
@rm -r build_no.h 2> /dev/null || true
Expand Down
4 changes: 2 additions & 2 deletions Utilities/build_no.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ echo "/* -- Do not commit this file --" > ./build_no.h
echo " *" >> ./build_no.h
echo " * project : CAN - Controller Area Network" >> ./build_no.h
echo " *" >> ./build_no.h
echo " * purpose : CAN Tester (based on macOS Library for PCAN-USB Interfaces)" >> ./build_no.h
echo " * purpose : CAN Utilities (based on macOS Library for PCAN-USB Interfaces)" >> ./build_no.h
echo " *" >> ./build_no.h
echo " * copyright : (C) 2019,2023 UV Software, Berlin" >> ./build_no.h
echo " * copyright : (C) 2005-2025 UV Software, Berlin" >> ./build_no.h
echo " *" >> ./build_no.h
echo " * author(s) : Uwe Vogt, UV Software" >> ./build_no.h
echo " *" >> ./build_no.h
Expand Down
33 changes: 18 additions & 15 deletions Utilities/can_moni/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ MAIN_DIR = .

MISC_DIR = $(HOME_DIR)/misc
DRIVER_DIR = $(HOME_DIR)/driver
WRAPPER_DIR = $(HOME_DIR)/macOS
INCLUDE_DIR = $(HOME_DIR)/include

OBJECTS = $(OUTDIR)/main.o $(OUTDIR)/bitrates.o $(OUTDIR)/timer.o $(OUTDIR)/printmsg.o

Expand All @@ -47,15 +47,15 @@ ifeq ($(current_OS),Darwin) # macOS - libPCBUSB.dylib
ifneq ($(VARIANT),STANDALONE)
DEFINES += -DOPTION_PCBUSB_STANDALONE=0

HEADERS += -I$(HOME_DIR)/macOS
HEADERS += -I$(INCLUDE_DIR)/mac/pcbusb

OBJECTS += $(OUTDIR)/PCBUSB.o

BIN_DIR = $(HOME_DIR)/Binaries
else
DEFINES += -DOPTION_PCBUSB_STANDALONE=1

HEADERS += -I$(HOME_DIR)/macOS -I$(DRIVER_DIR)
HEADERS += -I$(INCLUDE_DIR)/mac/pcbusb -I$(DRIVER_DIR)

OBJECTS += $(OUTDIR)/pcan_api.o \
$(OUTDIR)/pcan_drv.o \
Expand All @@ -79,20 +79,20 @@ CXXFLAGS += -O2 -g -Wall -Wextra -pthread \
$(DEFINES) \
$(HEADERS)

LDFLAGS += -rpath /usr/local/lib

LIBRARIES = -lpthread

ifeq ($(VARIANT),STANDALONE)
LDFLAGS += -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation
endif
LDFLAGS += -rpath /usr/local/lib

ifeq ($(BINARY),UNIVERSAL)
CFLAGS += -arch arm64 -arch x86_64
CXXFLAGS += -arch arm64 -arch x86_64
LDFLAGS += -arch arm64 -arch x86_64
endif

ifeq ($(VARIANT),STANDALONE)
LDFLAGS += -Wl,-framework -Wl,IOKit -Wl,-framework -Wl,CoreFoundation
endif

LIBRARIES = -lpthread

CXX = clang++
CC = clang
LD = clang
Expand All @@ -102,7 +102,7 @@ ifeq ($(current_OS),Linux) # linux - libpcanbasic.so

DEFINES +=

HEADERS += -I$(HOME_DIR)/Linux
HEADERS += -I$(INCLUDE_DIR)/linux/pcanbasic

OBJECTS += $(OUTDIR)/PCBUSB.o

Expand Down Expand Up @@ -131,6 +131,7 @@ CP = cp -f

CHECKER = warning,information
IGNORE = -i tester.c -i dosopt.c
LEVEL = exhaustive # normal or exhaustive

OUTDIR = .objects
BINDIR = $(BIN_DIR)
Expand All @@ -155,7 +156,7 @@ incdir:
@mkdir -p $(INCDIR)

check:
cppcheck --enable=$(CHECKER) --suppressions-list=$(HOME_DIR)/suppress.txt \
cppcheck --enable=$(CHECKER) --check-level=$(LEVEL) --suppressions-list=$(HOME_DIR)/suppress.txt \
-D__APPLE__ $(DEFINES) $(HEADERS) $(IGNORE) $(MAIN_DIR) $(MISC_DIR)

clean:
Expand All @@ -167,13 +168,14 @@ pristine:

install:
@echo "Copying binary file..."
@-$(CP) $(TARGET) $(INSTALL)
@mkdir -p $(INSTALL)
$(CP) $(TARGET) $(INSTALL)


$(OUTDIR)/main.o: $(MAIN_DIR)/main.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<

$(OUTDIR)/PCBUSB.o: $(WRAPPER_DIR)/PCBUSB.c
$(OUTDIR)/PCBUSB.o: $(MISC_DIR)/PCBUSB.c
$(CC) $(CFLAGS) -MMD -MF $*.d -o $@ -c $<

$(OUTDIR)/bitrates.o: $(MISC_DIR)/bitrates.c
Expand Down Expand Up @@ -215,8 +217,9 @@ $(OUTDIR)/pcan_log.o: $(DRIVER_DIR)/pcan_log.c

$(TARGET): $(OBJECTS)
$(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBRARIES)
$(CP) $(TARGET) $(BINDIR)
ifeq ($(current_OS),Darwin)
@lipo -archs $@
endif
@mkdir -p $(BINDIR)
$(CP) $(TARGET) $(BINDIR)
@echo "\033[1mTarget '"$@"' successfully build\033[0m"
23 changes: 13 additions & 10 deletions Utilities/can_moni/README
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
CAN Monitor for PEAK-System PCAN USB Interfaces (macOS, x86_64 & arm64)

Copyright (c) 2007,2012-2024 by Uwe Vogt, UV Software, Berlin.
Copyright (c) 2007,2012-2025 by Uwe Vogt, UV Software, Berlin.

Usage: can_moni <interface> [<option>...]
Options:
-t, --time=(ZERO|ABS|REL) absolute or relative time (default=0)
-i --id=(HEX|DEC|OCT) display mode of CAN-IDs (default=HEX)
-d, --data=(HEX|DEC|OCT) display mode of data bytes (default=HEX)
-a, --ascii=(ON|OFF) display data bytes in ASCII (default=ON)
-x, --exclude=[~]<id-list> exclude CAN-IDs: <id>[-<id>]{,<id>[-<id>]}
-a, --ascii=(ON|OFF) display data bytes in ASCII (default=ON)
-x, --exclude=[~]<id-list> exclude CAN-IDs: <id-list>=<id>[-<id>]{,<id>[-<id>]}
--code=<id> acceptance code for 11-bit IDs (default=0x000)
--mask=<id> acceptance mask for 11-bit IDs (default=0x7FF)
--xtd-code=<id> acceptance code for 29-bit IDs (default=0x00000000)
--xtd-mask=<id> acceptance mask for 29-bit IDs (default=0x1FFFFFFF)
-m, --mode=(2.0|FDF[+BRS]) CAN operation mode: CAN 2.0 or CAN FD format
--listen-only monitor mode (transmitter is off)
-m, --mode=(CCF|FDF[+BRS]) CAN operation mode: CAN CC or CAN FD
--listen-only monitor mode (listen-only mode)
--no-status-frames suppress reception of status frames
--no-remote-frames suppress reception of remote frames
-b, --baudrate=<baudrate> CAN 2.0 bit timing in kbps (default=250)
--bitrate=<bit-rate> CAN FD bit rate (as a string)
-v, --verbose show detailed bit rate settings
-y, --trace=(ON|OFF) write a trace file (default=OFF)
-b, --baudrate=<baudrate> CAN bit-timing in kbps (default=250)
--bitrate=<bit-rate> CAN bit-rate settings (as key/value list)
-v, --verbose show detailed bit-rate settings
--trace=(ON|OFF) write a trace file (default=OFF)
--list-bitrates[=<mode>] list standard bit-rate settings and exit
-L, --list-boards list all supported CAN interfaces and exit
-T, --test-boards list all available CAN interfaces and exit
Expand All @@ -45,7 +45,7 @@ CAN 2.0 baud rate index (default=3):
6 = 50 kbps
7 = 20 kbps
8 = 10 kbps
CAN FD bit rate as comma-separeted <key>=<value>-list:
CAN FD bit rate as comma-separated <key>=<value>-list:
f_clock=<value> frequency in Hz or
f_clock_mhz=<value> frequency in MHz
nom_brp=<value> bit-rate prescaler (nominal)
Expand All @@ -68,6 +68,9 @@ Hazard note:
License type:
This software is freeware without any warranty or support!
Change log:
- Version 0.6 SR2 of March 1, 2025:
Minor changes: mainly commandline argument handling
Compiled against PCBUSB v0.13 sources as Universal macOS Binary
- Version 0.6 SR1 of December 30, 2024:
Realized new program option:
- '--list-bitrates[=<mode>]' list standard bit-rate settings and exit
Expand Down
Loading