forked from mac-can/SerialCAN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'mac-can:main' into main
- Loading branch information
Showing
100 changed files
with
3,627 additions
and
2,792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Never modify line endings of bash scripts | ||
*.sh text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Makefile CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build | ||
run: make clean all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: MSBuild | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
env: | ||
# Path to the solution file relative to the root of the project. | ||
SOLUTION_FILE_PATH: . | ||
|
||
# Configuration type to build. | ||
# You can convert this to a build matrix if you need coverage of multiple configuration types. | ||
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | ||
BUILD_CONFIGURATION: Release | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Add MSBuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
- name: Build for x64 | ||
working-directory: ${{env.GITHUB_WORKSPACE}} | ||
# Add additional options to the MSBuild command line here (like platform or verbosity level). | ||
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference | ||
run: ${{env.SOLUTION_FILE_PATH}}\x64_build.bat NOVARS NOTRIAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# CAN Interface API, Version 3 (Python Wrapper) | ||
# | ||
# Copyright (c) 2005-2022 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# Copyright (c) 2005-2024 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# All rights reserved. | ||
# | ||
# This file is part of CAN API V3. | ||
|
@@ -43,7 +43,7 @@ | |
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with CAN API V3. If not, see <http://www.gnu.org/licenses/>. | ||
# along with CAN API V3. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
""" | ||
CAN API V3 Python Wrapper for generic CAN Interfaces. | ||
|
@@ -54,7 +54,7 @@ | |
$Author: haumea $ | ||
$Rev: 1046 $ | ||
$Rev: 1258 $ | ||
""" | ||
from ctypes import * | ||
import platform | ||
|
@@ -69,7 +69,7 @@ | |
|
||
# CAN API V3 - Python Wrapper | ||
# | ||
CAN_API_V3_PYTHON = {'major': 0, 'minor': 1, 'patch': 1} | ||
CAN_API_V3_PYTHON = {'major': 0, 'minor': 2, 'patch': 0} | ||
|
||
# CAN Identifier Ranges | ||
# | ||
|
@@ -158,8 +158,8 @@ | |
|
||
# General CAN error codes (negative) | ||
# Note: Codes less or equal than -100 are for vendor-specific error codes | ||
# and codes less or equal than -10000 are for OS-specific error codes | ||
# (add 10000 to get the reported OS error code, e.g. errno). | ||
# and codes less or equal than -10000 are for OS-specific error codes | ||
# (add 10000 to get the reported OS error code, e.g. errno). | ||
# | ||
CANERR_NOERROR = 0 # no error! | ||
CANERR_BOFF = (-1) # CAN - busoff status | ||
|
@@ -176,7 +176,7 @@ | |
CANERR_LEC_CRC = (-16) # LEC - checksum error | ||
CANERR_TX_BUSY = (-20) # USR - transmitter busy | ||
CANERR_RX_EMPTY = (-30) # USR - receiver empty | ||
CANERR_ERR_FRAME = (-40) # USR - error frame | ||
CANERR_QUE_OVR = (-40) # USR - queue overrun | ||
CANERR_TIMEOUT = (-50) # USR - time-out | ||
CANERR_RESOURCE = (-90) # USR - resource allocation | ||
CANERR_BAUDRATE = (-91) # USR - illegal baudrate | ||
|
@@ -210,8 +210,9 @@ | |
|
||
# Control of blocking read | ||
# | ||
CANREAD_INFINITE = c_uint16(65535) # infinite time-out (blocking read) | ||
|
||
CANWAIT_INFINITE = 65535 # infinite time-out (blocking operation) | ||
CANREAD_INFINITE = CANWAIT_INFINITE | ||
CANWRITE_INFINITE = CANWAIT_INFINITE | ||
|
||
# CAN Status-register | ||
# | ||
|
@@ -324,7 +325,7 @@ class SpeedNominal(LittleEndianStructure): | |
CAN Nominal Transmission Rate | ||
""" | ||
_fields_ = [ | ||
('fdoe', c_bool), | ||
('_reserved', c_bool), | ||
('speed', c_float), | ||
('samplepoint', c_float), | ||
] | ||
|
@@ -335,7 +336,7 @@ class SpeedData(LittleEndianStructure): | |
CAN Data Transmission Rate | ||
""" | ||
_fields_ = [ | ||
('brse', c_bool), | ||
('_reserved', c_bool), | ||
('speed', c_float), | ||
('samplepoint', c_float), | ||
] | ||
|
@@ -762,5 +763,5 @@ def len2dlc(length): | |
# have a great time | ||
print('Bye, bye!') | ||
|
||
# * $Id: CANAPI.py 1046 2022-03-08 20:38:47Z haumea $ *** (c) UV Software, Berlin *** | ||
# * $Id: CANAPI.py 1258 2024-03-19 21:35:15Z haumea $ *** (c) UV Software, Berlin *** | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/usr/bin/env python3 | ||
# | ||
# SerialCAN - CAN API V3 Driver for CAN over Serial-line Interfaces | ||
# SerialCAN - CAN API V3 Driver for CAN-over-Serial-Line Interfaces | ||
# | ||
# Copyright (c) 2020-2022 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# Copyright (c) 2020-2024 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# All rights reserved. | ||
# | ||
# This file is part of SerialCAN. | ||
|
@@ -54,7 +54,7 @@ | |
$Author: makemake $ | ||
$Rev: 1049 $ | ||
$Rev: 1261 $ | ||
""" | ||
from CANAPI import * | ||
from ctypes import * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# | ||
# SerialCAN - CAN API V3 Driver for CAN over Serial-line Interfaces | ||
# SerialCAN - CAN API V3 Driver for CAN-over-Serial-Line Interfaces | ||
# | ||
# Copyright (c) 2020-2022 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# Copyright (c) 2020-2024 Uwe Vogt, UV Software, Berlin ([email protected]) | ||
# All rights reserved. | ||
# | ||
# This file is part of SerialCAN. | ||
|
@@ -42,14 +42,25 @@ | |
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with SerialCAN. If not, see <http://www.gnu.org/licenses/>. | ||
# along with SerialCAN. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
current_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown OS') | ||
current_OS := $(patsubst CYGWIN%,Cygwin,$(current_OS)) | ||
current_OS := $(patsubst MINGW%,MinGW,$(current_OS)) | ||
current_OS := $(patsubst MSYS%,MinGW,$(current_OS)) | ||
|
||
MAJOR = 0 | ||
MINOR = 1 | ||
PATCH = 1 | ||
|
||
ifeq ($(PATCH),0) | ||
VERSION = $(MAJOR).$(MINOR) | ||
else | ||
VERSION = $(MAJOR).$(MINOR).$(PATCH) | ||
endif | ||
|
||
HOME_DIR = ../.. | ||
MAIN_DIR = . | ||
|
||
SOURCE_DIR = $(HOME_DIR)/Sources | ||
SERIAL_DIR = $(HOME_DIR)/Sources/SLCAN | ||
|
@@ -65,16 +76,11 @@ ifeq ($(current_OS),Darwin) # macOS - libUVCANSLC.dylib | |
|
||
LIBRARY = libUVCANSLC | ||
|
||
MAJOR = 0 | ||
MINOR = 1 | ||
PATCH = 0 | ||
|
||
VERSION = $(MAJOR).$(MINOR) | ||
TARGET = $(LIBRARY).$(VERSION).dylib | ||
STATIC = $(LIBRARY).a | ||
|
||
INSTALL_NAME = $(TARGET) | ||
CURRENT_VERSION = $(MAJOR).$(MINOR).0 | ||
CURRENT_VERSION = $(MAJOR).$(MINOR).$(PATCH) | ||
COMPATIBILITY_VERSION = $(MAJOR).$(MINOR).0 | ||
|
||
INSTALL = /usr/local/lib | ||
|
@@ -129,11 +135,6 @@ ifeq ($(current_OS),$(filter $(current_OS),Linux Cygwin)) # linux - libuvcanslc. | |
|
||
LIBRARY = libuvcanslc | ||
|
||
MAJOR = 0 | ||
MINOR = 1 | ||
PATCH = 0 | ||
|
||
VERSION = $(MAJOR).$(MINOR) | ||
SONAME = $(LIBRARY).so.1 | ||
TARGET = $(SONAME).$(VERSION) | ||
STATIC = $(LIBRARY).a | ||
|
@@ -143,6 +144,7 @@ INSTALL = /usr/local/lib | |
INCLUDE = /usr/local/include | ||
|
||
DEFINES = -DOPTION_CAN_2_0_ONLY=0 \ | ||
-DOPTION_CANAPI_SERIALCAN_SO=1 \ | ||
-DOPTION_CANAPI_DRIVER=1 \ | ||
-DOPTION_CANAPI_RETVALS=1 \ | ||
-DOPTION_CANAPI_COMPANIONS=1 \ | ||
|
@@ -203,9 +205,11 @@ bindir: | |
incdir: | ||
@mkdir -p $(INCDIR) | ||
$(CP) $(SOURCE_DIR)/SerialCAN_Defines.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/can_api.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/CANAPI_Types.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/CANAPI_Defines.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/CANBTR_Defaults.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/can_api.h $(INCDIR) | ||
$(CP) $(CANAPI_DIR)/can_btr.h $(INCDIR) | ||
|
||
clean: | ||
$(RM) $(TARGET) $(STATIC) $(OUTDIR)/*.o $(OUTDIR)/*.d | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//{{NO_DEPENDENCIES}} | ||
// Microsoft Visual C++ generated include file. | ||
// Used by u3canslc.rc | ||
|
||
// Next default values for new objects | ||
// | ||
#ifdef APSTUDIO_INVOKED | ||
#ifndef APSTUDIO_READONLY_SYMBOLS | ||
#define _APS_NEXT_RESOURCE_VALUE 101 | ||
#define _APS_NEXT_COMMAND_VALUE 40001 | ||
#define _APS_NEXT_CONTROL_VALUE 1001 | ||
#define _APS_NEXT_SYMED_VALUE 101 | ||
#endif | ||
#endif |
Binary file not shown.
Oops, something went wrong.