network-can: CAN bus networking

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Warnings:

Talk to CAN buses using Linux SocketCAN and SLCAN


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.0
Change log CHANGELOG.md
Dependencies attoparsec (>=0.14), base (>=4.7 && <5), bytestring, containers, data-default-class, mtl, network (>=3.1), network-can, QuickCheck, serialport (>=0.5.5), transformers, unliftio [details]
License BSD-3-Clause
Copyright 2024 sorki
Author sorki
Maintainer srk@48.io
Category Network
Home page https://github.com/DistRap/network-can
Source repo head: git clone https://github.com/DistRap/network-can
Uploaded by srk at 2025-05-19T14:52:56Z

Modules

[Index] [Quick Jump]

Flags

Automatic Flags
NameDescriptionDefault
build-apps

Build example applications

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for network-can-0.1.0.0

[back to package description]

network-can

GitHub Workflow Status Hackage version

CAN bus networking using Linux SocketCAN or SLCAN backends.

Usage

import qualified Control.Monad
import qualified Control.Monad.IO.Class
import qualified Network.CAN
import qualified Network.SocketCAN

main :: IO ()
main = do
  Network.SocketCAN.runSocketCAN
    (Network.SocketCAN.mkCANInterface "vcan0")
    $ do
        Network.CAN.send
          $ Network.CAN.standardMessage
              0x123
              [0xDE, 0xAD]

        Control.Monad.forever
          $ Network.CAN.recv
            >>= Control.Monad.IO.Class.liftIO . print