Skip to content

About

C++17 transport library for Linkerbot SDKs with CAN/CAN FD, SLCAN, serial and Modbus RTU support.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

linkerbot-transport-cpp

Pixel-art banner showing a controller board connected to CAN and serial interfaces

C++ Report Card

English | 简体中文 | Documentation

C++17 transport library for Linkerbot SDKs, with CAN / CAN FD backends, serial byte streams and a Modbus RTU client. The CAN module manages physical connections, shared buses, incoming-frame routes and outgoing batches; CAN request/reply matching belongs in the device SDK. The optional RTU module handles register transactions. Device register maps and motion control remain in the device SDK. See the serial and RTU guide.

Current source version: 0.3.4, including optional serial and Modbus RTU modules. Published v0.3.2 packages do not contain those modules. See the latest published stable release. See downloads, checksums and release documentation. See the changelog; use the matching tag, headers and bundled documentation to determine a published SDK's actual interfaces.

The canonical package is linkerbot-transport; former linkerbot-comm calls and archives remain available as compatibility entries. See name migration.

Linux quick start

From the source root, with CMake 3.20+, a C++17 compiler and threads:

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel 4
(cd build && ctest --output-on-failure)
./build/can-example
cmake --install build --prefix "$PWD/install/transport"

The default build includes tests and examples. Tests require Catch2 3: CMake first looks for an installed package, then downloads v3.8.1 if permitted. For offline builds, provide Catch2_DIR and set -DLINKERBOT_ALLOW_DEPENDENCY_DOWNLOADS=OFF. The library itself does not require Catch2. See the build guide for prerequisites, library-only builds and dependency-specific CMake requirements. For MSVC and multi-configuration commands, use the Windows guide.

Run the minimal application

After the install step above, build the complete quickstart application with its supplied CMakeLists.txt:

cmake -S examples/quickstart -B build-quickstart \
  -DCMAKE_PREFIX_PATH="$PWD/install/transport"
cmake --build build-quickstart --parallel 4
(cd build-quickstart && ctest --output-on-failure)

It uses FakeTransport to send a request and check an in-memory reply, without an adapter or vendor library. It demonstrates routing, a send receipt and explicit session shutdown. For two devices on one connection, see shared_bus.cpp.

Use from CMake

The repository is named linkerbot-transport-cpp; the canonical installed package is linkerbot-transport:

find_package(linkerbot-transport 0.3 CONFIG REQUIRED)
target_link_libraries(your-sdk PRIVATE linkerbot::can)

For a source-tree dependency, replace find_package with add_subdirectory(../linkerbot-transport-cpp linkerbot-transport-cpp). Use linkerbot::can-compat for legacy flat includes, or linkerbot::headers for value-only headers. The 0.3.x line pairs with hand SDK 0.3.x; the transport SDK must be at least the hand version. Rebuild applications with matching headers, architecture, compiler and runtime.

Choose a backend

  • SocketCAN: Linux, Classic CAN / FD; a configured CAN network interface.
  • MiniCANFD: Linux / Windows x64, FD; matching vendor library and driver.
  • PCAN-Basic: Windows x64 hardware target, Classic CAN / FD; PEAK driver and DLL.
  • Native SLCAN: Linux / Windows, Classic / CANable FD; experimental, with an explicit port and firmware profile.
  • FakeTransport: in-memory transport for offline development and tests.

Linux amd64/ARM64 and Windows x64/ARM64 have offline CI. Hardware support depends on the adapter, driver and firmware; see validation evidence and limits. Coverage and Clang quality-check commands are in the build guide.

API and device integration

Start with public API and ownership, then Session routing and recovery. The detailed guides and README are maintained in English and Chinese; see the terminology guide.

Message.dlc counts bytes: Classic 0–8, FD 0–64. Set extended-ID and FD/BRS flags explicitly; untagged-frame behavior varies by backend. A send receipt describes backend acceptance, while CAN ACK and device execution require separate confirmation. A receipt timeout does not cancel an in-flight write.

Backend guides: SocketCAN, MiniCANFD, PCAN, SLCAN. See frame selection, timestamps and receive-own messages for opt-in metadata and per-backend limits. See diagnostics and upgrade/rollback before deploying with devices.

Project information

MIT license · Contributing · Changelog · Third-party notices · Support and sensitive reports

Installed documentation lives under share/linkerbot-transport. Vendor drivers, DLLs and test fixtures are not included in the SDK package.

中文内容已移至 简体中文 README。

Serial and Modbus RTU

Optional serial byte streams and a Modbus RTU client are available as separate linkerbot::serial and linkerbot::modbus targets. They do not implement hand register maps. See the RTU guide for configuration, transaction semantics and validation limits.

About

C++17 transport library for Linkerbot SDKs with CAN/CAN FD, SLCAN, serial and Modbus RTU support.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages