X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=docs%2F4_APIs_and_Services%2F4.5_Message_Signaling%2F7_CanDevStudio_Quickstart%2Fcandevstudio%2F3_Add_CAN_Device.md;fp=docs%2F4_APIs_and_Services%2F4.5_Message_Signaling%2F7_CanDevStudio_Quickstart%2Fcandevstudio%2F3_Add_CAN_Device.md;h=9eef2c7b3a6a11d26ab9c1cfe2d3a4ba666a9a6a;hb=4aad369c9728061c97b3de792286e743ee884b09;hp=0000000000000000000000000000000000000000;hpb=619a7e48085be1538c3b01eb93dcb9dc95bf0436;p=AGL%2Fdocumentation.git diff --git a/docs/4_APIs_and_Services/4.5_Message_Signaling/7_CanDevStudio_Quickstart/candevstudio/3_Add_CAN_Device.md b/docs/4_APIs_and_Services/4.5_Message_Signaling/7_CanDevStudio_Quickstart/candevstudio/3_Add_CAN_Device.md new file mode 100644 index 0000000..9eef2c7 --- /dev/null +++ b/docs/4_APIs_and_Services/4.5_Message_Signaling/7_CanDevStudio_Quickstart/candevstudio/3_Add_CAN_Device.md @@ -0,0 +1,41 @@ +--- +edit_link: '' +title: Add a CAN device in CANdevStudio +origin_url: >- + https://raw.githubusercontent.com/automotive-grade-linux/docs-sources/master/agl-documentation/candevstudio/docs/3_Add_CAN_Device.md +--- + + + +# Add a CAN device in CANdevStudio + +Start a new project and grab a ***CanDevice*** from the left pane in the +***Device Layer*** section and drop it on the grid workspace. Right-Click on it +and open its ***Properties***. Here you have to set the ***backend*** and the +***interface*** name you'll want to use. Backend available are: + +- socketcan: CAN stack present by default in the Linux Kernel. This use Linux socket and open source CAN device driver (More information here). +- systeccan: CAN bus backend using the SYS TEC CAN adapters. +- peakcan: CAN bus plugin using the PEAK CAN adapters. +- tinycan: CAN bus plugin using the MHS CAN adapters. +- vectorcan: CAN bus plugin using the Vector CAN adapters. + +More details about CANdevStudio CAN bus support [here](http://doc.qt.io/qt-5.10/qtcanbus-backends.html). + +***Interface*** is the name of the device you want to use. Bring up your CAN device and use the following command to find out which one are available: + +```bash +ip link +1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 +2: enp0s25: mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 + link/ether 90:b1:1c:6b:b2:21 brd ff:ff:ff:ff:ff:ff +3: virbr0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000 + link/ether 52:54:00:56:86:80 brd ff:ff:ff:ff:ff:ff +4: virbr0-nic: mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000 + link/ether 52:54:00:56:86:80 brd ff:ff:ff:ff:ff:ff +5: docker0: mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default + link/ether 02:42:81:38:a8:75 brd ff:ff:ff:ff:ff:ff +12: can0: mtu 72 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 + link/can +```