Code Monkey home page Code Monkey logo

canbus's Introduction

canbus

Build Status GoDoc

canbus provides high-level facilities to interact with CAN sockets.

can-dump

can-dump prints data flowing on CAN bus.

Usage of can-dump:

sh> can-dump [options] <CAN interface>
   (use CTRL-C to terminate can-dump)

Examples:

 can-dump vcan0
$> can-dump vcan0
  vcan0  080 00000000  00 DE AD BE EF            |.....|
  vcan0  080 00000000  01 DE AD BE EF            |.....|
  vcan0  080 00000000  02 DE AD BE EF            |.....|
  vcan0  080 00000000  03 DE AD BE EF            |.....|
  vcan0  080 00000000  04 DE AD BE EF            |.....|
  vcan0  080 00000000  05 DE AD BE EF            |.....|
  vcan0  080 00000000  06 DE AD BE EF            |.....|
  vcan0  080 00000000  07 DE AD BE EF            |.....|
  vcan0  080 00000000  08 DE AD BE EF            |.....|
  vcan0  080 00000000  09 DE AD BE EF            |.....|
  vcan0  712 00000000  11 22 33 44 55 66 77 88   |."3DUFW.|
  vcan0  7fa 00000000  DE AD BE EF               |....|
[...]

can-send

can-send sends data on the CAN bus.

Usage of can-send:

sh> can-send [options] <CAN interface> <CAN frame>

where <CAN frame> is of the form: <ID-hex>#<frame data-hex>.

Examples:

 can-send vcan0 f12#1122334455667788
 can-send vcan0 ffa#deadbeef
$> can-dump vcan0 &
$> can-send vcan0 f12#1122334455667788
  vcan0  712 00000000  11 22 33 44 55 66 77 88   |."3DUFW.|
$> can-send vcan0 ffa#deadbeef
  vcan0  7fa 00000000  DE AD BE EF               |....|

References

$> modprobe can
$> modprobe can_raw
$> modprobe vcan

## setup vcan network devices
$> ip link add type vcan
$> ip link add dev vcan0 type vcan
$> ip link set vcan0 up

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.