InterfaceCfgs

InterfaceConfig

CANBus.InterfaceCfgs.InterfaceConfigType
InterfaceConfig(device::DeviceType, channel::Union{String,Int},
    bustype::BusType, bitrate::Int;
    datarate=nothing, silent=false,
    sample_point=70, sample_point_fd=70,
    stdfilter=nothing, extfilter=nothing,
    vector_appname="CANalyzer", slcan_serialbaud=2_000_000)

Strunct for interface configuration.

source
CANBus.InterfaceCfgs.InterfaceConfigMethod

Always required:

  • device: ::DeviceType. (KVASER, SLCAN...)
  • channel: Device specific channel name(0, can0, COM3...).
  • bustype: ::BusType. (CAN_20, CAN_FD...)

Required kwarg when bustype is CAN_FD or CAN_FD_NONISO:

  • datarate

Other optional kwargs:

  • silent: Bool. silent mode for some devices. (default: false)
  • sample_point: Real. sample point in percentage for CAN2.0. (default: 70)
  • sample_point_fd: Real. sample point in percentage for CAN-FD. (default: 70)
  • stdfilter: ::AcceptanceFilter or Vector{AcceptanceFilter} or nothing. standard id filter. (default: nothing)
  • extfilter: ::AcceptanceFilter or Vector{AcceptanceFilter} or nothing. extended id filter. (default: nothing)
  • vector_appname: String. application name for Vector device. (default: "CANalyzer")
  • slcan_serialbaud: Integer. serial baudrate for slcan device. (default: 2000000)
Devicesilentsample_point/_fdstd/extfiltervector_appname
KVASERign
SLCANignignign
SOCKETCANignignign
VECTOR

◯:required, ✓:supported, ign:ignored.

See Hardwares section to see vendor specific notations.

source
CANBus.InterfaceCfgs.InterfaceConfigFDMethod
InterfaceConfigFD(device::DeviceType, channel::Union{String,Int},
    bustype::BusType, bitrate::Int, datarate::Int; kwargs...)

Helper function to construct InterfaceConfig object for CAN-FD (ISO type) setup. kwargs is same as InterfaceConfig constructor.

source

Enumerates

Fiilter struct

CANBus.InterfaceCfgs.AcceptanceFilterType
AcceptanceFilter(code_id, mask)

Struct for accept filter.

If this struct is set to Interface, the id is accepted when <received_id> & mask == code_id & mask or (<received_id> xor code_id) & mask == 0. Those are equivalent.

source