mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
slcan_attach: 'close' the slcan adapter before setting a bitrate
As investigated by Thorsten Godau the bitrate can only be set after the slcan adapter is in 'close' state. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Tested-by: Thorsten Godau <dl9sec@gmx.net>
This commit is contained in:
+2
-2
@@ -150,12 +150,12 @@ int main(int argc, char **argv)
|
|||||||
if (waitkey || !detach) {
|
if (waitkey || !detach) {
|
||||||
|
|
||||||
if (speed) {
|
if (speed) {
|
||||||
sprintf(buf, "S%s\r", speed);
|
sprintf(buf, "C\rS%s\r", speed);
|
||||||
write(fd, buf, strlen(buf));
|
write(fd, buf, strlen(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btr) {
|
if (btr) {
|
||||||
sprintf(buf, "s%s\r", btr);
|
sprintf(buf, "C\rs%s\r", btr);
|
||||||
write(fd, buf, strlen(buf));
|
write(fd, buf, strlen(buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user