# 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
  - Manually Enumerating CAN channels
- 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
  - Check Channel Capabilities
  - 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
- t Programming
  - Load and Unload t Program
  - Start and Stop a t Program
  - Example
  - Environment Variables
  - Send Event
- I/O Pin Handling
  - Initialize
  - Pin Information
  - I/O pin types
    - Analog Pins
    - Digital Pins
    - Relay Pins