Skip to content

zaben903/crystal_can

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crystal_can

Crystal CAN adds the ability to read from a Linux SocketCAN interface.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      crystal_can:
        github: zaben903/crystal_can
  2. Run shards install

Usage

require "crystal_can"

client = CrystalCan::Client.new
response = client.receive

Returned from the receive action is a LibC::CanFrame struct using the struct from /linux/can.h

Development

setting up vcan0 interface:

sudo ip link add dev vcan0 type vcan
sudo ifconfig vcan0 up

Testing reading CAN packets can be done using:

apt install can-utils
cansend vcan0 "01a#11223344"

Contributing

  1. Fork it (https://github.com/zaben903/crystal_can/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

Crystal SocketCAN Inferface

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published