Skip to content

Commit

Permalink
slcan_attach: 'close' the slcan adapter before setting a bitrate
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
hartkopp committed Jan 9, 2011
1 parent c9cdc9d commit eb1a99f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slcan_attach.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ int main(int argc, char **argv)
if (waitkey || !detach) {

if (speed) {
sprintf(buf, "S%s\r", speed);
sprintf(buf, "C\rS%s\r", speed);
write(fd, buf, strlen(buf));
}

if (btr) {
sprintf(buf, "s%s\r", btr);
sprintf(buf, "C\rs%s\r", btr);
write(fd, buf, strlen(buf));
}

Expand Down

0 comments on commit eb1a99f

Please sign in to comment.