We use cookies on our website to provide you with the best possible service and to further improve our website. By clicking the "Accept All" button, you agree to the use of all cookies. You can limit the cookies used by clicking on "Accept selection". Further information and an option to revoke your selection can be found in our privacy policy.


These cookies are necessary for basic functionality. This allows you to register on our website and forum or order products with our online shop.


With these cookies, we collect anonymized usage data for our website. For example, we can see which content is interesting for our visitors and which resolutions are used. We use the information to optimize our website to provide you with the best possible user experience.


show more

PCAN-Basic API for Linux Version History

2024-01-18 - Version 4.8.0

  • Updated thread to listen to devices' plugin/plugout disabled by default
  • Fixed call to pcanlog_set(...)
  • Updated log level
  • Misc. improvements to prevent buffer overruns


2023-09-28 - Version 4.7.1

  • Added support to device plugin/plugout notifications
  • Added support to parameter PCAN_HARD_RESET_STATUS

2023-04-04 - Version 4.7.0


  • Added support of value TRACE_FILE_DATA_LENGTH with parameter PCAN_TRACE_CONFIGURE
  • Added .NET headers in "include" directory


  • Moved PCANBasic.h to "include" directory
  • Generated trace file includes a suffixed index only if TRACE_FILE_SEGMENTED is set
  • If TRACE_FILE_OVERWRITE is not set and a file already exists, tracing will fail (EOPNOTSUPP) and be disabled
  • In Makefile, commented LDFLAGS_CLEANUP_SO to prevent warnings due to an issue with Binutils <2.33 on ARM
  • Updated: CAN_SetValue with PCAN_TRACE_LOCATION and PCAN_TRACE_STATUS better handles I/O error and returns corresponding PCAN-Basic status code

2022-10-04 - Version 4.6.2

  • Fixed STARTTIME in trace file to use local time
  • Improved logs for firmware update checks

2022-07-25 - Version 4.6.1

  • Prevented possible buffer overflows with PCAN_ALLOW_ECHO_FRAMES and PCAN_BUSOFF_AUTORESET
  • PCANBasic.h includes <stdint.h> if UINT64 is not defined
  • CAN_Initialize and CAN_InitializeFD wait for bus to be active (up to 1ms) (PCAN_ERROR_CAUTION is returned if initialization succeeded but bus_state is not active)
  • Reduced required buffer size for GetValue(PCAN_FIRMWARE_VERSION) (required size was >= 257)

2022-04-08 - Version 4.6.0


  • Added support to parameter PCAN_ALLOW_ECHO_FRAMES and frame flag PCAN_MESSAGE_ECHO that allows the reception of self-sent messages.
  • Added support to parameter PCAN_DEVICE_PART_NUMBER to get the part number of a PCAN hardware (a.k.a. IPEH number).
  • Added support to fw and driver update checks.


  • Changed format ouput (hex) for pcaninfo fields: base, btr0btr1, devid, init_flags.
  • pcanbasic_get_hw returns PCAN_ERROR_ILLHANDLE if hw group is unknown.

2022-01-26 - Version 4.5.4


  • Added internal support to get the part number of a PCAN hardware (a.k.a. IPEH number).
  • Added translations for error PCAN_ERROR_ILLMODE.


  • Changed required size for parameter PCAN_LOG_STATUS to uint8_t
  • Parameter PCAN_LOG_TEXT automatically enables PCAN_LOG_STATUS
  • Corrected a bug in pcanbasic_bus_state_to_condition (ERROR_ACTIVE flag was detected as ERROR_PASSIVE)
  • If a status message is read the return value of CAN_Read/CAN_ReadFD is also the error code of the status frame.
  • Corrected memory leak: close log file on exit
  • Fixed issue when uninitializing/initializing channel with different bitrates within a few milliseconds.
  • Fixed incorrect returned value when calling parameter channel condition on a specific use-case
  • Fixed CAN_SetValue with parameters PCAN_TRACE_LOCATION and PCAN_LOG_LOCATION to allow a NULL buffer of size 0.
  • Improved size checks for null-terminated get/set parameters
  • Normalized status code for pcanbasic_get_value_xxx functions
  • Updated some returned codes (in case of errors) for every entry points to match exactly PCANBasic Windows 4.6 behaviour.
  • Added return values for functions in pcblog.h
  • Updated PCANBasic_enu_linux_addenda.txt

2021-11-18 - Version 4.5.3


  • Fixed timestamp issue with CAN_Read.

2021-10-04 - Version 4.5.2


  • Fixed year in "start time" comments for .trc files

2021-09-24 - Version 4.5.1


  • Fixed CAN_Uninitialize when Tx queue is not empty, waiting time was 50ms instead of 500ms
  • CAN_Uninitialize clears Tx queue before closing (avoiding any driver's extra waiting time)
  • Fixed issue when calling CAN_Uninitialize(PCAN_NONEBUS) and continue using the API (involving parameter PCAN_AVAILABLE_CHANNELS)
  • Fixed side-effects in CAN_SetValue on non-ARM systems (see previous ARM patch)
  • Fixed syslog log_level
  • library initialization now also initializes internal parameters

2021-09-02 - Version 4.5.0


  • Added support to new API entry point: CAN_LookUpChannel
  • Added automatic compilation of libpcanbasic 32 bit version
  • Added mechanism to ignore status frame on reset (and CAN_Initialize, use definition KEEP_STATUS_FRAME_ON_RESET to disable)
  • Added timestamps usage to examples
  • Added support to future PCAN Linux 8.13 features (ioctl resets)
  • Added missing functions to handle logging of LOG_FUNCTION_READ, LOG_FUNCTION_WRITE
  • Header upgraded to match PCANBasic Windows v4.5.3
  • Fixed possible infinite loop in pcanbasic_parse_fd_init


  • Fixed $STARTTIME in trc file to match PEAK-TRACE spec.
  • Replaced uses of deprecated 'gettimeofday' with 'clock_gettime'
  • Function pcanbasic_get_device now initializes a status parameter to get same error code as on Windows
  • Function pcanbasic_get_channel now have a TCANStatus param to improve and give information to caller
  • Factorized duplicate code with internal function pcanbasic_get_fd.
  • Updated MakeFile to specify precisely exported functions (see def file)
  • Fixed returned code (in case of erros) for every entry points to match exactly PCANBasic Windows behaviour
  • Given pathes are now internally converted and stored as absolute pathes (internal pathes are dynamically allocated)
  • Enabling logging now checks and immediately opens the log file (same as Windows)
  • CAN_Read/CAN_ReadFD and CAN_Write/CAN_WriteFD now check if the corresponding CAN_Initialize/CAN_InitializeFD was used (PCAN_ERROR_ILLOPERATION)
  • CAN_Write/CAN_WriteFD now supports PCAN_ERROR_XMTFULL error code
  • Changed trace to support chronological ordering: libpcanfd msg-echoing is enabled by default (if supported, FD fw only)
  • Fixed CAN_SetValue to return an error when the size of the buffer is invalid
  • Improved CAN_SetValue to better handle buffer with a size smaller than expected (ARM)

2020-04-27 - Version 4.4.3


  • CAN_SetValue for PCAN_DEVICE_ID and PCAN_5VOLTS_POWER now requires an initialized channel (as mentionned by documentation)
  • Calls to deprecated function gettimeofday(..) was replaced with clock_gettime(clk_ref,...)
  • Trace file now have a starttime set a few milliseconds prior initialisation
  • Trace file can display negative relative timestamp
  • Fixed minor typos in logs
  • Compilation now supports distinct preprocessor's definitions of LOG_LEVEL and _DEBUG
  • PCAN_PARAMETER_CHANNEL_VERSION now includes channel's type and PEAK copyright (to match string returned by PCANBasic Windows API)

2020-12-16 - Version 4.4.2


  • Fixed compilation error in -std=gnu90
  • 'Initialize' functions will try to retrieve a more precise error when 'pcanfd_open' fails
  • API version string will end with "(debug)" if library is built in debug mode
  • Refactored logging in debug mode and fixed syslog logging
  • pcaninfo changed to v1.2.0: Outputs version of the installed PCAN-Basic API

2020-08-14 - Version 4.4.1


  • Added checks to prevent possible buffer overflows when copying CAN/CANFD message's DATA
  • Added mutex in API entries to provide more robust thread-safe system

2020-08-07 - Version 4.4.0


  • Updated libpcanbasic/pcanbasic to match features from Windows PCAN-Basic 4.4
  • Updated libpcanbasic/pcaninfo to display a short or detailed list of devices
  • Updated pcanbasic_java/libpcanbasic_jni to support features from PCAN-Basic 4.4
  • Updated pcanbasic_java/examples to support features from PCAN-Basic 4.4

2020-03-05 - Version 4.3.4

  • Fixed pcanbasic/Makefile_latest.mk so that shared object can be built under Xenomai 3.1

2020-02-19 - Version 4.3.3

  • Updated the included licensing information

2019-10-09 - Version 4.3.2


  • PCAN-Basic example now supports Python 3
  • Added change logs to the sub projects (libpcanbasic, pcanbasic_java and libpcanbasic_jni)


  • PCANBasic.java: loadLibrary will try "pcanbasic_jni" first and fallback to "PCANBasic_JNI" on failure

2019-04-15 - Version

  • Added support to param PCAN_FIRMWARE_VERSION (0x29)
  • Added support to sysfs params: clk_drift, dev_name, init_flags, mass_storage_mode, nom_sample_point, nom_tq, data_sample_point, data_tq, and ts_fixed
  • Fixed check on pcanfd_open's return value as RT system can return the value 0

2018-08-03 - Version

  • Added missing support of device PCAN_USBX6

2018-03-16 - Version

  • Added a 50ms temporisation when closing a channel that still has Tx pending messages

2018-03-06 - Version

  • Fixed PCANBasic status when receiving EAGAIN from libpcanfd (error is either QXMTFULL or QRCVEMPTY whether read or write function is called)

2018-03-03 - Version

  • Fixed CAN FD timestamp issue
  • Added PCANBasic_enu_linux_addenda.txt that lists differences within documentation compared to Windows

2017-11-03 - Version

  • Fixed alignments in generated trace file (timestamp and 11bit CAN ids)

2017-10-31 - Version

  • Fixed wrong month number in generated trace file
  • Fixed ill use of snprintf in trace file leading to trace only first byte of message data

2017-10-09 - Version

  • Added support of features of PCAN-Basic 4.2 for Windows® (only with PCAN Linux driver > 8.5.x):
    • Reception of status frames: PCAN_ALLOW_STATUS_FRAMES
    • Reception of RTR frames: PCAN_ALLOW_RTR_FRAMES
    • Reception of error frames: PCAN_ALLOW_ERROR_FRAMES
    • Interframe Transmit Delay: PCAN_INTERFRAME_DELAY
  • The package now includes documentation (same as the Windows® version, open .chm files with "xchm" for instance)

2017-10-04 - Version

  • Fixed PCAN_TRACE_xxx features (the feature was never launched when a session was activated by the user)
  • Header now includes new features of PCAN-Basic 4.2 for Windows® (not yet implemented, status will return "illegal operation")

2017-02-17 - Version 4.1.1

  • Patched overflow timestamp issue
  • Corrected a few status error (bad convertions from errno to status)

2016-09-08 - Version

  • Fixed memory leaks issues within "pcanjni" library
  • Replaced the PCANBasic java example with the sample in pcanjni folder

2016-07-20 - Version

  • Changed the version number to match PCAN-Basic for Windows
  • Fixed C99 problem in make file
  • Fixed a bug in Java implementation

Please note: The old API 2.0.4.x is still included to support PEAK linux driver prior version 8.x).

2016-05-20 - Version + Version legacy driver

  • CAN_GetErrorText now returns PCAN_ERROR_ILLPARAMVAL on unknown error status
  • v2.0.4.6: Fixed an issue when retrieving/setting PCAN_DEVICE_NUMBER
  • Java 'peak.can' package updated to match the Windows version of PCAN-Basic

2016-03-16 - Version + Version legacy driver

  • v4.0.0.3: Fixed a null pointer exception when calling CAN_Unitialize(PCAN_NONEBUS) and continuing using the API

2016-03-01 - Version + Version legacy driver

  • v4.0.0.2: Upgraded pcaninfo to match changes in PCAN driver v8.0.17

2016-01-29 - Version + Version legacy driver

  • v4.0.0.1: Upgraded to match changes in PCAN driver v8.0.7

2016-01-18 - Version 4.0.0 + Version legacy driver

  • v2.0.4.5: Fixed GetStatus function. Please note: PCAN driver v7.16.0 is required
  • v2.0.4.5: Known issue: USB channel's handles will be offset if the minor number of the first PCAN-USB device is not 0 (or n=32 in cat /proc/pcan)

2016-01-12 - Version 4.0.0

  • Upgraded PCAN-Basic Linux API to match the Windows version 4.0.2 of PCAN-Basic
  • Please note: PCAN driver v8.0.6 is required

2015-11-04 - Version 2.0.4

  • Fixed impossibility to write an enhanced message with RTR flag

2014-10-17 - Version 2.0.3

  • Changed licences from GPL to LGPL
  • Fixed an issue with using CAN2 of PCAN-USB Pro

2014-01-08 - Version 2.0.2

  • Changed DWORD definition in pcanbasic_jni.c to ensure 32-bits implementation whatever Linux arch data model is used

2013-11-12 - Version 2.0.1

  • Changed all "c_ulong" types to "c_uint" to ensure 32-bits implementation whatever Linux arch data model is used

2013-11-08 - Version 2.0.0

  • Fixed a problem running in 32-bits applications with 64-bits Kernel in python and C++ examples

2013-11-05 - Version 1.0.0

  • Included the version number in PCANBAsic.h and removed the TPCANMsg struc definition to use the one in <pcan.h>
  • Examples setup an initial bitrate of 500k now