GithubHelp home page GithubHelp logo

farly7 / xcan-router Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 5.0 30.01 MB

A CAN Gateway framework, offering CAN frame-based routing across multiple interfaces and protocols.

License: GNU General Public License v3.0

C 98.63% C++ 0.82% CMake 0.55%
can flexcan mpc5748g routing gateway framework frame ecu nxp freescale pdu pdu-router can-router fota ota mpc5746c

xcan-router's Introduction

XCAN Routing Stack

Background

CAN is a robust message-based multi-master bus protocol which is particularly dominant in the automotive industry. In large control systems with different domains, there are often several independent CAN buses with each bus connecting together the nodes of a particular domain in the system. It is the role of a central gateway/router device to pass certain messages between each these buses to enable the sharing of information across domains.

This is where the XCAN Routing Stack fits in.

The intention of this project is to provide an open-source CAN routing stack.

Features

This initial version will support the basic functionality:

  • Frame-based routing.
  • Static routing table creation tool.
  • Per interface frame filtering.
  • SocketCAN interface for testing.

Building

Project uses the cmake build system.

$ cmake .
$ make

Example

An example is provided which can be run on Linux using virtual SocketCAN interfaces.

Setup

Enable the virtual CAN kernel module and create 2 virtual CAN interfaces:

$ sudo modprobe vcan
$ sudo ip link add dev vcan0 type vcan
$ sudo ip link add dev vcan1 type vcan

Bring up the two virtual CAN interfaces:

$ sudo ip link set up vcan0
$ sudo ip link set up vcan1

sudo ifconfig vcan0 up

Running

Send data to the CAN bus, use the cansend utility:

$ cansend can0 123#1122334455667788

xcan-router's People

Contributors

farly7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

xcan-router's Issues

error: ‘struct xcan_routing_table’ declared inside parameter list not visible outside of definition

I tried to install your repo and can't compile. Am I missing something?

  • git clone <repo>
  • cd into <repo>
  • cmake ./
  • make

Error-Message :(

[ 12%] Building C object CMakeFiles/XCAN_EXE.dir/modules/xcan_dev_socketcan.c.o
In file included from /home/kali/xcan-router/modules/xcan_dev_socketcan.c:2:
/home/kali/xcan-router/stack/include/xcan_stack.h: In function ‘xcan_sendto_dev’:
/home/kali/xcan-router/stack/include/xcan_stack.h:31:28: error: ‘struct xcan_routing_table’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
   31 | int xcan_stack_init(struct xcan_routing_table *routing_table);
      |                            ^~~~~~~~~~~~~~~~~~
In file included from /home/kali/xcan-router/modules/xcan_dev_socketcan.c:5:
/usr/include/unistd.h:255:22: error: storage class specified for parameter ‘useconds_t’
  255 | typedef __useconds_t useconds_t;
      |                      ^~~~~~~~~~
/usr/include/unistd.h:274:21: error: storage class specified for parameter ‘socklen_t’
  274 | typedef __socklen_t socklen_t;
      |                     ^~~~~~~~~
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.