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>pull/7/head
parent
c9cdc9d069
commit
eb1a99f8c7
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue