[bit.listserv.i-amiga] Summary of detecting CD in C - Thanks!

A0NJ@UNB.CA (Greg Patterson) (02/05/90)

Robert Brown wrote:
>Greg,
>According to the source code of PROBBS, written by David R. Stromberger
>which is PD and available on GEnie, CIS, etc.), he detects the modem
>carrier detect in this fashion...
>
>check_carrier()
>{
>int status;
>
>WriteSer_Req->IOSer.io_Command = SDCMD_QUERY;
>DoIO(WriteSer_Req);
>status = WriteSer_Req->io_status & CIAF_COMCD;
>WriteSer_Req->IOSer.io_Command = CMD_WRITE;
>return(status?FALSE:TRUE);
>}
>
>The ROM Kernel manual I have describes DoIO() as being a synchronous
>I/O function that does not return control to the caller until it's task
>is completed. As I understand it, you describe the type of I/O request
>you wish (as in WriteSer_Req, above) and use that description as the
>request parameter for DoIO().
>
>PROgrammers BBS is a very interesting piece of code. It illustrates
>many of the functions you might use in serial IO. I would recommend
>you downloading a copy (usually called PROBBS.ARC) and examining it's
>contents.
>
>Robert Brown
>RDBROWN@UALR.BITNET

Wouldn't happen to know of a specific BBS or site that has this file
kicking around do you? Don't see it around here at all..

Stephen Vermeulen wrote:
> Greg,
>
>     Funny you should ask about how to detect the CD line through
>     the serial device, I too am about to do it....  Anyway, it looks
>     like you need to send the serial device a CMD_QUERY command
>     and then look at the io_Status word when the command completes.
>     Bit 5 is the Carrier Detect (active low).
>
> Regards,
> Stephen Vermeulen                                             PO Box 3295
> Author: Express Paint, Spritz and Fusion Paint                Station B
> Newsletter Editor of AMUC (the AMiga Users of Calgary)        Calgary, Alberta
> SVermeulen % Janus.MtRoyal.AB.CA @ UncaNet.BITnet ...or...    CANADA
> SVermeulen % Janus.MRC.AdhocNet.CA @ UncaEdu.BITnet           T2M 4L8

Thanks guys! That should do it.. I think its time to upgrade my manuals
as I don't think SDCMD_QUERY is even mentioned in the 1.2: Libraries
and Devices.

I know that the 1.3 Includes and Autodocs is out now but is the new
1.3 Libraries and Devices out yet or the 1.3 Hardware Ref manual?

A0NJ@UNB.CA