package socketcan

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The SocketCAN BroadCast Manager (BCM) allows to send CAN message frames from kernel space; the kernel e.g. can then send periodic messages without having to be triggered by user space.

type t

CAN broadcast manager

type opcode =
  1. | TX_SETUP
  2. | TX_DELETE
  3. | TX_READ
  4. | TX_SEND
  5. | TX_STATUS
  6. | TX_EXPIRED
  7. | RX_SETUP
  8. | RX_DELETE
  9. | RX_READ
  10. | RX_STATUS
  11. | RX_TIMEOUT
  12. | RX_CHANGED
type flag =
  1. | SETTIMER
  2. | STARTTIMER
  3. | TX_COUNTEVT
  4. | TX_ANNOUNCE
  5. | TX_CP_CAN_ID
  6. | RX_FILTER_ID
  7. | RX_CHECK_DLC
  8. | RX_NO_AUTOTIMER
  9. | RX_ANNOUNCE_RESUME
  10. | TX_RESET_MULTI_IDX
  11. | RX_RTR_FRAME
val create : string -> (t, [> `EUnix of Unix.error ]) Result.result

create s opens the can-interface named s (e.g. "can0")

val close : t -> unit

close s closes the socket s.

time value with seconds tv_sec and microseconds tv_usec

val write : t -> opcode list -> flag list -> (int * timer * timer * Id.t) -> Frame.t list -> (unit, [> `EUnix of Unix.error ]) Result.result

write socket ops flags (x, t1, t2, id) frames writes the configuration to the broadcast socket

val fd : t -> Unix.file_descr

fs s will return a Unix-file-descriptor of the socket s; this file-descriptor can then be used with e.g. Unix.select.

OCaml

Innovation. Community. Security.