0
\$\begingroup\$

Can anyone help me out how to use -r parameter in the candump utility?

-r (set socket receive buffer to size)

Wanted to verify: Configurable receive buffer feature.

I verified the above as follows:

In terminal 1: cansend can0 001#001122334455 -> sending 6 bytes of data

In terminal 2: candump can0 -r 4 -> but allocated the receiver buffer size as 4

Observed all the 6 bytes have been received: can0 001 [6] 00 11 22 33 44 55

\$\endgroup\$
3
  • \$\begingroup\$ The -r option uses setsockopt() to configure the receive buffer. The socket option SO_RCVBUF describes the minimum value as 256 (socket manpage). \$\endgroup\$
    – Velvet
    Commented Dec 21, 2023 at 8:08
  • \$\begingroup\$ hi @Velvet can you plz let me know how to make use of this parameter -r to verify Configurable receive buffer through an example \$\endgroup\$
    – Sukanya U
    Commented Dec 21, 2023 at 9:28
  • \$\begingroup\$ The -r option is used for the socket driver, not your application layer. If for instance the receive buffer of the socket is too small, you can increase it: candump -r 8192 can0 \$\endgroup\$
    – Velvet
    Commented Dec 21, 2023 at 9:44

0

Browse other questions tagged or ask your own question.