delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/12/23/23:32:32

From: dan DOT hensley AT sdrc DOT com (Dan Hensley)
Subject: Re: Can outsiders get simple questions answered?
23 Dec 1998 23:32:32 -0800 :
Message-ID: <36811E54.995A0AF8.cygnus.gnu-win32@sdrc.com>
References: <367F31DC DOT B8E71A57 AT sdrc DOT com>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

    Many thanks to all of you who responded.  I guess my question wasn't so simple
after all, but it's good to see the responses!  :-)  For those who are curious,
here's some background:  I originally wrote a FORTRAN program for HP-UX, which as
part of its input, would allow the user to enter something either via a barcode
reader or keyboard using the select() function.  About a year ago, I had to start
porting this program to NT.  I discovered that MS FORTRAN 4.0 is a horrible
compiler, and that the MS select() function only worked with sockets (as the cygwin
developers had discovered).  Then I discovered cygwin, which seems to be the only
way I'll solve my problem.  I was very impressed to see that the select function
works like it does on Unix.  So to cut out the rest of the details, I'm still
trying to get this functionality to work.  I discovered that in notty mode,
select() works differently from tty mode (extra <CR> required), so I need to run in
tty mode.
    Once I've had a chance to try out all the suggestions and find a way to get it
all working, I may try to write a FAQ on the subject.

Thanks again,
Dan

P.S.  Eventually I'd like to take my C routine and link it in with the rest of my
FORTRAN code, but so far my attempts have been unsuccessful.  But I'll wait to ask
specific questions until I get to that point again.


Theodore Jump wrote:

> I have some mount points, that I setup in the registry manually, for hitting
> the serial and parallel ports, but I haven't done much with them yet.
>
> To set them up, a registry init file with contents similar to this:
>
> ;; begin registry file "CYGSERIAL2.REG"
>
> REGEDIT4
>
> [HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06]
> "native"="\\\\.\\COM2"
> "unix"="/dev/serial2"
> "fbinary"=dword:00000001
> "fsilent"=dword:00000000
>
> ;; end registry file
>
> may be used.  This particular example creates a virtual device '/dev/serial2'
> which let's me (at least) send bits to the COM2: port.
>
> This works, in as much as I can create small text files with
>
>         ATZ
>
> or
>
>         ATDT
>
> and if I "cat dial.mdm /dev/serial2" then I hear it pickup and go to dial tone.
> Additionally, a small test program using open() also allows me to cause the
> modem to pickup:
>
> /* begin sample sertest.c */
>
> #include <stdlib.h>
> #include <fcntl.h>
> #include <io.h>
>
> int main(int n,char **a)
> {
>         int s;
>
>         s = open("/dev/serial2",O_RDWR|O_BINARY);
>
>         if (s==-1)
>                 printf("Could not open /dev/serial2 for output!\n");
>         else
>         {
>                 write(s,"ATDT\r\n",5);
>                 close(s);
>         }
>
>         return 0;
> }
>
> /* end sample sertest.c */
>
> I have not done more complex examples though.  Note that you can define virtual
> devices for other serial and parallel ports similarly.  BE CAREFUL if you use
> the registry file path for putting in mounts, so that you don't override an
> existing one - check to make sure you don't already have something significant
> in "mounts\06" under the path above by using REGEDIT.EXE to view your registry
> contents.
>
> Note: I have *not* tested this on Win9x, only NT4, using Beta 20.1.
>
> -Ted
> ______________________________________________________________________
> http://www.i21.com/~tjump                   http://www.fighterduel.com
>
> The train stops at the train station, the bus stops at the bus station,
> So why am I sitting at a work station? -Ralph Hempel


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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