diff options
author | Andre Hartmann <aha_1980@gmx.de> | 2017-01-11 22:03:34 +0100 |
---|---|---|
committer | André Hartmann <aha_1980@gmx.de> | 2017-01-17 14:26:38 +0000 |
commit | d4bbdb83b26f8219b6c64bcff3967aa15db07d9c (patch) | |
tree | cd95d46d532298757ac6b3620953cb3a2e792c4d /src/serialbus/doc | |
parent | 52967158da2c02efceea610e83786bbd6b5a888a (diff) |
CAN: Introduce CAN FD Bitrate Switch (BRS)
QCanBusFrame:
Added hasBitrateSwitch and setBitrateSwitch to QCanBusFrame
and therefore, increased the QCanBusFrame version number.
* Setting QCanBusFrame::setBitrateSwitch(true)
also sets QCanBusFrame::setFlexibleDataRateFormat(true)
* Setting QCanBusFrame::setFlexibleDataRateFormat(false)
also sets QCanBusFrame::setBitrateSwitch(false)
QCanBusDevice:
Reference implementation and documentation are done for
the SocketCAN plugin. The CAN Example allows to send
frames with Bitrate Switch enabled and visualize received
frames with Bitrate Switch set.
Unfortunately, the SocketCAN plugin does not allow to change
any bitrate yet, so the newly added data bitrate selection
box in ConnectDialog seems a bit useless. This box is
however needed once other plugins become CAN FD capable and
implement bitrate switching.
[ChangeLog][QCanBusFrame] Introduced flag to allow data
bitrate switching for CAN FD frames. Reference
implementation is done for the SocketCAN plugin.
Task-number: QTBUG-56720
Change-Id: Ieab04020f4750c8b0085624d2250ad7cd982cd96
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/serialbus/doc')
-rw-r--r-- | src/serialbus/doc/src/socketcan.qdoc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/serialbus/doc/src/socketcan.qdoc b/src/serialbus/doc/src/socketcan.qdoc index 919955d..f5aec83 100644 --- a/src/serialbus/doc/src/socketcan.qdoc +++ b/src/serialbus/doc/src/socketcan.qdoc @@ -47,6 +47,8 @@ This section assumes, that the device driver is already loaded (most likely automatically when connecting the CAN hardware). + \section3 Default settings + To set the device can0 to a bitrate of 250 kBit/s: \code sudo ip link set up can0 type can bitrate 250000 @@ -56,6 +58,13 @@ the following command can be used: \code sudo ip link set up can0 type can bitrate 250000 restart-ms 100 + + \section3 CAN FD settings + + To set the device can0 to an arbitration bitrate of 500 kBit/s and a data + bitrate of 4 MBit/s (for frames with bitrate switch flag): + \code + sudo ip link set can0 up type can bitrate 500000 dbitrate 4000000 fd on \endcode \section2 Setting up a virtual CAN bus @@ -73,10 +82,10 @@ the \l{https://github.com/linux-can/can-utils}{can-utils} package: \code - # Display received CAN messages - candump vcan0 + # Display received CAN messages with absolute timestamps and flags + candump -ta -x vcan0 - # Send a CAN message + # Send a CAN FD message with flags BRS and EFI set cansend vcan0 123##3112233445566778899aabbccddeeff # Generate random CAN messages @@ -163,6 +172,11 @@ \li This configuration option determines whether CANFD frames may be sent or received. By default, this option is disabled. It controls the CAN_RAW_FD_FRAMES option of the CAN socket. + \row + \li QCanBusDevice::DataBitRateKey + \li This configuration is not supported by the socketcan plugin. However + it is possible to set the data rate when configuring the CAN network interface + using the \c {ip link} command. \endtable For example: |