From: Oliver Hartkopp Date: Sun, 9 Jan 2011 11:35:03 +0000 (+0000) Subject: slcan_attach: 'close' the slcan adapter before setting a bitrate X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/can-utils.git/commitdiff_plain/eb1a99f8c7e2f69b76d7edb90625e910e8326cf0 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 Tested-by: Thorsten Godau --- diff --git a/slcan_attach.c b/slcan_attach.c index 4a91ba0..147ec6b 100644 --- a/slcan_attach.c +++ b/slcan_attach.c @@ -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)); }