# Using canlib (CANlib)

The canlib module wraps the CAN bus API (CANlib), which is used to interact with Kvaser CAN devices connected to your computer and the CAN bus. At its core you have functions to set bus parameters (e.g. bit rate), go bus on/off and read/write CAN messages. You can also use CANlib to download and start t programs on supported devices.

- Introduction
  - Hello, CAN!
  - canlib Core API Calls
- Initialization
  - Library Initialization
  - Library Deinitialization and Cleanup
- Devices and Channels
  - Identifying Devices and Channels
  - Channel Information
  - Customized Channel Name
  - Virtual Channels
- Open Channel
  - Open as CAN
  - Open as CAN FD
  - Close Channel
  - Set CAN Bitrate
  - Set CAN FD Bitrate
  - CAN Driver Modes
  - Legacy Functions
    - Set CAN Bitrate
    - Set CAN FD Bitrate
- CAN Frames
  - CAN Data Frames
  - CAN FD Data Frames
  - Error Frames
  - Remote Requests
  - Overload Frames
  - Other frame features of interest
- Send and Receive
  - Bus On / Bus Off
  - Reading Messages
  - Acceptance Filters
    - Code and Mask Format
  - Sending Messages
  - Using Extended CAN (CAN 2.0B)
  - Object Buffers
- Bus Errors
  - Obtaining Bus Status Information
  - Overruns
  - Error Frames
- Time Measurement
  - Accuracy
  - Resolution
- Using Threads
  - Handles are thread-specific
  - Local echo feature
  - Init access
  - Using the same handle in different threads
- I/O Pin Handling
  - Initialize
  - Pin Information
  - I/O pin types
    - Analog Pins
    - Digital Pins
    - Relay Pins