delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/14/04:29:34

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-Id: <5.1.0.14.0.20020214195624.00a03ec0@mail.mckinn1.vic.optushome.com.au>
X-Sender: menhennitt AT mail DOT mckinn1 DOT vic DOT optushome DOT com DOT au
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Thu, 14 Feb 2002 20:26:49 +1100
To: cygwin AT cygwin DOT com
From: Graham Menhennitt <gmenhennitt AT optushome DOT com DOT au>
Subject: Lego IR tower USB driver vs. Cygwin
Mime-Version: 1.0

A bit of background for those who aren't Lego fans...
Lego (as in childrens' brick toy) make a robotics kit named Mindstorms. The 
robot is controlled by a microprocessor brick named the RCX.which is 
programmed on a PC. The program is downloaded to the RCX via infra-red 
communications. The PC end of the IR is a device (called the tower) that, 
until recently, plugged into a serial port. Later versions of MIndstorms 
use a USB tower instead. Lego provides Windows software for programming and 
downloading the users' software into the RCX via the tower. Naturally, 
various people have hacked the software. There is an alternate operating 
system for the RCX called LegOS. With it comes programs for downloading to 
the RCX. The serial version of the tower software for LegOS works 
successfully under both Windows and Unix.

For the USB tower, however, there is less support. There is no Unix driver 
(yet). There is a version of the download software that (apparently) works 
with older versions of Cygwin and/or Windows. However, there has been no 
success (that I know of) of using the USB tower with recent versions of Cygwin.

The download program attempts to open a device named \\.\legotower1. This 
works via the standard Win32 call CreateFile(). However, under Cygwin, the 
effect is quite strange. When you try to open the device using:
	open("\\\\.\\legotower1, O_RDWR)
the machine hangs for a considerable period (~30 seconds). In this time, 
the machine is essentially dead - the mouse cursor moves but the cursor in 
a bash shell window stops flashing and Alt-Tab does nothing. Eventually the 
open succeeds. However, writing to the opened device does nothing. I've 
also tried with the device name "//./legotower1" instead with exactly the 
same result. It is definitely opening the device since, if I spell 
legotower wrongly or if I use legotower2, I get a "no such file or 
directory" response. This happens just using "cat" from a shell prompt too 
- "cat > //./legotower1".

I've tried debugging it to see the exact parameters that open() eventually 
uses when it internally calls CreateFIle() - so far no success.

I'm doing this using Cygwin version 1.3.9-1 under Windows 98 SE.

Can somebody please explain to me why:
- this would (presumably) have worked with older versions of Cygwin
- why opening the device works with Win32 CreateFile() but not Cygwin open()
- why the long hang
- why I can't write to the device even after it does open
Has anybody got any suggestions on how to debug this further?

Thanks in advance for any help,
	Graham


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019