From owner-freebsd-hackers@FreeBSD.ORG Sun Oct 2 10:49:40 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8A1616A41F for ; Sun, 2 Oct 2005 10:49:40 +0000 (GMT) (envelope-from garyj@jennejohn.org) Received: from peedub.jennejohn.org (Jaeac.j.pppool.de [85.74.174.172]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34A7243D45 for ; Sun, 2 Oct 2005 10:49:39 +0000 (GMT) (envelope-from garyj@jennejohn.org) Received: from jennejohn.org (localhost [127.0.0.1]) by peedub.jennejohn.org (8.13.4/8.11.6) with ESMTP id j92Anb5m004107; Sun, 2 Oct 2005 12:49:37 +0200 (CEST) (envelope-from garyj@jennejohn.org) Message-Id: <200510021049.j92Anb5m004107@peedub.jennejohn.org> X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.0.4 To: Divacky Roman In-Reply-To: Message from Divacky Roman of "Sun, 02 Oct 2005 11:51:40 +0200." <20051002095140.GA49735@stud.fit.vutbr.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 02 Oct 2005 12:49:37 +0200 From: Gary Jennejohn Cc: hackers@freebsd.org Subject: Re: serial port question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2005 10:49:41 -0000 Divacky Roman writes: > Hi, > > I need to set serial port to given parity/speed/etc. and then cat from it... > > when I: stty -f /dev/cuaa0 speed 1200 > its still at 9600 (the default setting) > > how do I alter speed of serial port? minicom/cu is able to do it but I want t > o > do it via stty. > > how can this be done? > See discussion of the initial-state and lock-state devices in the sio manual page. Another, hacky way to do it is like this: sleep 1000 < /dev/cuaa0& stty -f /dev/cuaa0 speed 1200 The sleep holds the device open so that the values set using stty remain effective. Without the sleep the stty values are only effective while the command is being executed because stty opens the device and then, once stty exits, the device is closed and all the new settings are lost. --- Gary Jennejohn / garyjATjennejohnDOTorg gjATfreebsdDOTorg garyjATdenxDOTde