From owner-freebsd-questions@freebsd.org Mon Mar 25 10:16:23 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF5E155A451 for ; Mon, 25 Mar 2019 10:16:23 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from smh-06.1blu.de (smh-06.1blu.de [178.254.0.206]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A61C8ABAD for ; Mon, 25 Mar 2019 10:16:22 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [172.16.29.5] (helo=sh4-5.1blu.de) by smh-06.1blu.de with esmtp (Exim 4.86_2) (envelope-from ) id 1h8MeK-00039I-Ua; Mon, 25 Mar 2019 11:16:13 +0100 Received: from ftp51246-2575596 by sh4-5.1blu.de with local (Exim 4.86_2) (envelope-from ) id 1h8MeK-0003JI-SM; Mon, 25 Mar 2019 11:16:12 +0100 Date: Mon, 25 Mar 2019 11:16:12 +0100 From: Matthias Apitz To: Andrea Venturoli Cc: Polytropon , freebsd-questions@freebsd.org Subject: Re: Resetting a serial port Message-ID: <20190325101612.GB2415@sh4-5.1blu.de> Reply-To: Matthias Apitz Mail-Followup-To: Andrea Venturoli , Polytropon , freebsd-questions@freebsd.org References: <6623dd04-822d-dbdb-d2f5-3021debc1c2a@netfence.it> <20190319193907.b0f51931.freebsd@edvax.de> <360bcc93-b4fc-f9f5-4056-5c5b45b8fcbb@netfence.it> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <360bcc93-b4fc-f9f5-4056-5c5b45b8fcbb@netfence.it> X-Operating-System: FreeBSD 12.0-CURRENT r314251 (amd64) X-message-flag: Mails containing HTML will not be read! Please send only plain text. User-Agent: Mutt/1.5.24 (2015-08-30) X-Rspamd-Queue-Id: 8A61C8ABAD X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-3.31 / 15.00]; ARC_NA(0.00)[]; HAS_REPLYTO(0.00)[guru@unixarea.de]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[unixarea.de]; AUTH_NA(1.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[mail.unixarea.de]; NEURAL_HAM_SHORT(-0.78)[-0.783,0]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:42730, ipnet:178.254.0.0/19, country:DE]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-1.42)[ipnet: 178.254.0.0/19(-3.94), asn: 42730(-3.15), country: DE(-0.01)] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Mar 2019 10:16:23 -0000 El día Wednesday, March 20, 2019 a las 08:04:55PM +0100, Andrea Venturoli escribió: > On 3/19/19 7:39 PM, Polytropon wrote: > > > # /usr/bin/true > /dev/lpt0 > > > >Maybe the corresponding serial device can be reset > >in the same way? > > In case it locks again (it did two times the last month, but it hadn't > happened for years), I'll try. > Thanks. Note: In the command shown above the '/usr/bin/true' does nothing with the TTY. It is the shell opening the device for writing. I in your case would write some C-pgm to uses the syscalls open(2) and ioctl(2) to get information about the device status. matthias -- Matthias Apitz, ✉ guru@unixarea.de, http://www.unixarea.de/ +49-176-38902045 Public GnuPG key: http://www.unixarea.de/key.pub October, 7 -- The GDR was different: Peace instead of Bundeswehr and wars, Druschba instead of Nazis, to live instead of to survive.