Skip to content
/ canary Public

A lightweight implementation of Linux SocketCAN bindings for ASIO/Boost.ASIO

License

Notifications You must be signed in to change notification settings

djarek/canary

Repository files navigation

Canary

Language Build Coverage License Documentation
Standard Build Status codecov License Documentation

Introduction

Canary is a thin, C++11 wrapper over the SocketCAN API in Linux, which enables communication over CAN bus using idioms from the Boost.ASIO and ASIO libraries.

Dependencies

Canary depends only on ASIO and the C++11 standard library. By default, it uses Boost.ASIO, but can be configured to use standalone ASIO. The CANARY_STANDALONE_ASIO macro makes the library depend only on standalone ASIO.

Running tests requires lightweight test facilities from Boost.Core (which is a header only library).

Installation

Canary is header-only, so you only need to add the include directory to the include paths in your build system. An install target is available in CMake which will install the headers and a CMake find_package configuration script for easy consumption in projects built with CMake:

mkdir build
cd build
cmake ..
make install

After installation, a project built with CMake can consume the library using find_package:

find_package(canary REQUIRED)
target_link_libraries(my_target PUBLIC canary::canary)

Running tests

Tests require the existence of 2 virtual CAN interfaces - vcan0 and vcan1, which can be created with the create_vcans.sh script:

sudo tools/create_vcans.sh vcan0 vcan1

Tests can be run using the standard test target generated by CMake:

mkdir build
cd build
cmake ..
make test

Documentation

About

A lightweight implementation of Linux SocketCAN bindings for ASIO/Boost.ASIO

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published