From mint-bounce@lists.fishpool.fi Tue Oct 11 01:05:21 2005 X-Original-To: fnaumann@mail.boerde.de Delivered-To: fnaumann@mail.boerde.de To: From: Peter Slegg Subject: Re: [MiNT] ioctl.h X-Mailer: MyMAIL Rev:1.83.12191 (Atari/(STiK/STinG/GlueSTiK)) X-Hardware: Atari Milan MIME-Version: 1.0 Date: Mon, 10 Oct 2005 23:03:14 +0200 (GMT) Content-Type: text/plain; charset="iso-8859-1" X-Priority: 3 X-MSMail-Priority: Normal Message-Id: <003a4509.01c15c7e4432@smtp.freeola.net> References: <1128977142.12010.23.camel@taro.coolrunningconcepts.com> In-Reply-To: 1128977142.12010.23.camel@taro.coolrunningconcepts.com X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-To: mint-bounce@lists.fishpool.fi X-original-sender: p.slegg@scubadivers.co.uk Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: X-Virus-Scanned: by amavisd-new at relay.boerde.de X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de X-Spam-Status: No, hits=1.7 tagged_above=-50.5 required=7.0 tests=AWL, BAYES_00, MISSING_MIMEOLE, MISSING_OUTLOOK_NAME X-Spam-Level: * Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by wh58-902.st.uni-magdeburg.de id j9AN5KYc021134 On Mon, 10 Oct 2005 15:45:42 -0500, Evan Langlois wrote: > > On Mon, 2005-10-10 at 19:53 +0200, Peter Slegg wrote: > > I am trying to compile a Linux application for dowloading > > data from a Suunto dive computer. > > You'll likely have to know some details about what hardware serial > signals it needs. If its standard RTS/CTS, then you can just turn that > on and comment out the code that doesn't work. If it uses something > stranger, it might be easier to make a cable to swap a few control lines > around. > > > TIOCMSET isn't found. I expected to find it in ioctl.h where > > TIOCMGET is defined. > > TIOCMGET retrieves the status of serial port signals, and TIOCMSET will > set them, such as DTR and RTS. MiNT has the first (but only a hack - > may not work on anything but the first serial port) as part of > Ssystem(), but not the second at all. > > > Is there much I can do about this ? > > I don't think so. I don't believe mint supports these itself. You'd > likely have to replace the call with something Atari specific. The > situation looks grim as far as getting instant access to the state of > the serial control signals. Just hacking the source to your app as a > work-around and faking whatever its trying to do signal-wise may be > easier. Supporting this properly looks like it would require changing > the drivers to actually query the hardware registers for the > information, adding an OS calls to get it, adding a mintlib function to > call the OS, etc. > > Not even sure if booting Linux would get you closer since you can't be > guaranteed that the serial drivers support the call under m68k-linux > anyway. > > -- Evan Thanks. This is an example of the code. It's used in routines to wake-up and close the serial device. The wake-up may not be needed but I am not sure about the close down. I originally started writing my own version of this program and then and found the Linux one yesterday so I thought it was worth a try. /* ---- Set RTS high ---- */ (void) ioctl(device, TIOCMGET, &erg); erg &= ~TIOCM_RTS; (void) ioctl(device, TIOCMSET, &erg); ---snip--- /* ---- Set RTS low ---- */ (void) ioctl(device, TIOCMGET, &erg); erg &= ~TIOCM_RTS; (void) ioctl(device, TIOCMSET, &erg);