@database TimedSerial.guide
@rem Source: TimedSerial.c
@rem Generated with RoboDoc v3.0j (May 24 1999)
@rem RoboDoc is copyright 1994-1997 by Maverick Software Development

@node Main TimedSerial.guide
@{jcenter}
@{fg highlight}@{b}TABLE OF CONTENTS@{ub}@{fg text}

@{"TimeSerial.c          " Link "TimeSerial.c"} -- Read me first!

@{"BreakSerial()         " Link "BreakSerial()"}
@{"ClearSerial()         " Link "ClearSerial()"}
@{"CloseSerial()         " Link "CloseSerial()"}
@{"CloseTimer()          " Link "CloseTimer()"}
@{"FlushSerial()         " Link "FlushSerial()"}
@{"GetErrNum()           " Link "GetErrNum()"}
@{"GetSerialStatus()     " Link "GetSerialStatus()"}
@{"KillTimer()           " Link "KillTimer()"}
@{"OpenSerial()          " Link "OpenSerial()"}
@{"QuerySerial()         " Link "QuerySerial()"}
@{"ReadChar()            " Link "ReadChar()"}
@{"ReadString()          " Link "ReadString()"}
@{"ResetSerial()         " Link "ResetSerial()"}
@{"SetSerialParams()     " Link "SetSerialParams()"}
@{"SetupTimer()          " Link "SetupTimer()"}
@{"StartSerial()         " Link "StartSerial()"}
@{"StartTimer()          " Link "StartTimer()"}
@{"StopSerial()          " Link "StopSerial()"}
@{"TestTimer()           " Link "TestTimer()"}
@{"TimerDelay()          " Link "TimerDelay()"}
@{"TranslateErrorNumber()" Link "TranslateErrorNumber()"}
@{"WriteChar()           " Link "WriteChar()"}
@{"WriteString()         " Link "WriteString()"}
@{jleft}
@endnode

@Node "BreakSerial()" "BreakSerial()"
@{fg shine}BreakSerial()@{fg text}

@{b}NAME@{ub}
@{b}    BreakSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = BreakSerial( int timeout, int duration );


@{b}DESCRIPTION@{ub}
    Issue a SDCMD_BREAK to the Serial device with the break
    duration given (success < 0 means the timer timed out). 

@endnode
@Node "ClearSerial()" "ClearSerial()"
@{fg shine}ClearSerial()@{fg text}

@{b}NAME@{ub}
@{b}    ClearSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = ClearSerial( int timeout );


@{b}DESCRIPTION@{ub}
    Issue a CMD_CLEAR to the Serial device (success < 0 means
    the timer timed out). 

@endnode
@Node "CloseSerial()" "CloseSerial()"
@{fg shine}CloseSerial()@{fg text}

@{b}NAME@{ub}
@{b}    CloseSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    void CLoseSerial( void );


@{b}DESCRIPTION@{ub}
    Close the Serial & timeout timer devices, then Free the memory
    allocated to them.

@endnode
@Node "CloseTimer()" "CloseTimer()"
@{fg shine}CloseTimer()@{fg text}

@{b}NAME@{ub}
@{b}    CloseTimer()

@{ub}
@{b}DESCRIPTION@{ub}
    Close the Timer & Serial devices & Free memory allocated.  

@endnode
@Node "FlushSerial()" "FlushSerial()"
@{fg shine}FlushSerial()@{fg text}

@{b}NAME@{ub}
@{b}    FlushSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = FlushSerial( int timeout );


@{b}DESCRIPTION@{ub}
    Issue a CMD_FLUSH to the Serial device (success < 0 means
    the timer timed out). 

@endnode
@Node "GetErrNum()" "GetErrNum()"
@{fg shine}GetErrNum()@{fg text}

@{b}NAME@{ub}
@{b}    GetErrNum()

@{ub}
@{b}SYNOPSIS@{ub}
    int errnum = GetErrNum( void );


@{b}DESCRIPTION@{ub}
    Return the value that the internal ErrorNumber variable is set at.

@endnode
@Node "GetSerialStatus()" "GetSerialStatus()"
@{fg shine}GetSerialStatus()@{fg text}

@{b}NAME@{ub}
@{b}    GetSerialStatus()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = GetSerialStatus( void );


@{b}DESCRIPTION@{ub}
    Return the internal SerialStatus variable setting.

@endnode
@Node "KillTimer()" "KillTimer()"
@{fg shine}KillTimer()@{fg text}

@{b}NAME@{ub}
@{b}    KillTimer()

@{ub}
@{b}DESCRIPTION@{ub}
    Stop the Serial timeout timer 


@{b}NOTES@{ub}
@{b}@{fg shine}    CloseTimer() still has to be called in order to shut down
    completely!
@{fg text}@{ub}
@endnode
@Node "OpenSerial()" "OpenSerial()"
@{fg shine}OpenSerial()@{fg text}

@{b}NAME@{ub}
@{b}    OpenSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = OpenSerial( char *serName,    // Name of Serial device
                              int   unit,       // Serial Unit #
                              int   HowLong,    // Timeout delay
                              int   buffersize, // Serial buffer size
                              int   flags       // SerialIO Flags
                            );


@{b}DESCRIPTION@{ub}
    Initialize & Open the Serial & timer devices.

@endnode
@Node "QuerySerial()" "QuerySerial()"
@{fg shine}QuerySerial()@{fg text}

@{b}NAME@{ub}
@{b}    QuerySerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = QuerySerial( int timeout );


@{b}DESCRIPTION@{ub}
    Issue a SDCMD_QUERY to the Serial device (success < 0 means
    the timer timed out). 

@endnode
@Node "ReadChar()" "ReadChar()"
@{fg shine}ReadChar()@{fg text}

@{b}NAME@{ub}
@{b}    ReadChar()

@{ub}
@{b}SYNOPSIS@{ub}
    UBYTE ch = ReadChar( int timeout );


@{b}DESCRIPTION@{ub}
    Read a single character from the Serial port.

@endnode
@Node "ReadString()" "ReadString()"
@{fg shine}ReadString()@{fg text}

@{b}NAME@{ub}
@{b}    ReadString()

@{ub}
@{b}SYNOPSIS@{ub}
    char *string = ReadString( int timeout, int strsize );


@{b}DESCRIPTION@{ub}
    Read a string characters strsize long from the Serial port.

@endnode
@Node "ResetSerial()" "ResetSerial()"
@{fg shine}ResetSerial()@{fg text}

@{b}NAME@{ub}
@{b}    ResetSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = ResetSerial( int timeout );


@{b}DESCRIPTION@{ub}
    Reset the Serial Port & change the timeout value.
    (success >= 0 means NO ERROR).

@endnode
@Node "SetSerialParams()" "SetSerialParams()"
@{fg shine}SetSerialParams()@{fg text}

@{b}NAME@{ub}
@{b}    SetSerialParams()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = SetSerialParams( int timeout,
                                   int whichparm,
                                   int param
                                 );


@{b}DESCRIPTION@{ub}
    Issue a SDCMD_SETPARAMS to the Serial device for the given
    parameter type & value (success < 0 means the timer timed 
    out or an unknown value for whichparm).

@endnode
@Node "SetupTimer()" "SetupTimer()"
@{fg shine}SetupTimer()@{fg text}

@{b}NAME@{ub}
@{b}    SetupTimer()

@{ub}
@{b}DESCRIPTION@{ub}
    Initialize the timer's Port & Open the device.

@endnode
@Node "StartSerial()" "StartSerial()"
@{fg shine}StartSerial()@{fg text}

@{b}NAME@{ub}
@{b}    StartSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = StartSerial( int timeout );


@{b}DESCRIPTION@{ub}
    Issue a CMD_START to the Serial device (success < 0 means
    the timer timed out). 


@{b}SEE ALSO@{ub}
    StopSerial()

@endnode
@Node "StartTimer()" "StartTimer()"
@{fg shine}StartTimer()@{fg text}

@{b}NAME@{ub}
@{b}    StartTimer()

@{ub}
@{b}DESCRIPTION@{ub}
    Tell the timeout timer to begin timing the serial device.

@endnode
@Node "StopSerial()" "StopSerial()"
@{fg shine}StopSerial()@{fg text}

@{b}NAME@{ub}
@{b}    StopSerial()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = StopSerial( int timeout );


@{b}DESCRIPTION@{ub}
    Issue a CMD_STOP to the Serial device (success < 0 means
    the timer timed out). 


@{b}SEE ALSO@{ub}
    StartSerial()

@endnode
@Node "TestTimer()" "TestTimer()"
@{fg shine}TestTimer()@{fg text}

@{b}NAME@{ub}
@{b}    TestTimer()

@{ub}
@{b}DESCRIPTION@{ub}
    Return any timer error values (zero means NO ERROR).

@endnode
@Node "TimeSerial.c" "TimeSerial.c"
@{fg shine}TimeSerial.c@{fg text}

@{b}NAME@{ub}
@{b}    TimedSerial.c

@{ub}

@{b}COPYRIGHT@{ub}
    TimedSerial.c @{b}(C)@{ub} 2000-2001 by Jim Steichen

    You may use the code as you see fit, but @{b}DO NOT@{ub} modify it without
    informing me of your changes!  I don't expect to get rich from 
    this code, but if you feel like paying for, feel free to contact
    me at: @{B}jimbot\@rconnect.com@{UB} for instructions on how to do so.
    
@{b}DESCRIPTION@{ub}
    This file contains the code to issue serial commands
    that will time-out if there is no response from the
    PC at the other end of the serial link.


@{b}HISTORY@{ub}
    28-Sep-2000 - Added the serName parameter to the OpenSerial()
                  function. 
    30-Dec-1998 - Added GetErrNum() & GetSerialStatus();
    06-Nov-1996 - Created.


@{b}NOTES@{ub}
@{b}@{fg shine}    The following functions are available to the User:

    VISIBLE int   GetErrNum( void );
    VISIBLE int   GetSerialStatus( void );
    VISIBLE void  TimerDelay( int delayseconds );
    VISIBLE int   TestTimer( void );
    VISIBLE char *TranslateErrorNumber( int errnum );

    VISIBLE int   OpenSerial( char *serName,
                              int   unit, 
                              int   HowLong, 
                              int   buffersize,
                              int   flags
                            ); 

    VISIBLE void  CloseSerial( void );

    VISIBLE char  *ReadString( int timeout, int strsize );
    VISIBLE UBYTE  ReadChar(   int timeout              );

    VISIBLE int WriteString( int timeout, char *string, int strsize );
    VISIBLE int WriteChar(   int timeout, int   ch                  );

    VISIBLE int ResetSerial( int timeout );
    VISIBLE int ClearSerial( int timeout );
    VISIBLE int FlushSerial( int timeout );
    VISIBLE int StopSerial(  int timeout );
    VISIBLE int StartSerial( int timeout );
    VISIBLE int QuerySerial( int timeout );

    VISIBLE int BreakSerial( int timeout, int duration );
    VISIBLE int SetSerialParams( int timeout, int which, int params );

 $VER: TimedSerial.c 1.1 (28-Sep-2000) by J.T. Steichen
 
 My e-mail address: jimbot\@rconnect.com

@{fg text}@{ub}
@endnode

@Node "TimerDelay()" "TimerDelay()"
@{fg shine}TimerDelay()@{fg text}

@{b}NAME@{ub}
@{b}    TimerDelay()

@{ub}
@{b}DESCRIPTION@{ub}
    Start the Serial timeout timer & wait for it to time-out.

@endnode
@Node "TranslateErrorNumber()" "TranslateErrorNumber()"
@{fg shine}TranslateErrorNumber()@{fg text}

@{b}NAME@{ub}
@{b}    TranslateErrorNumber()

@{ub}
@{b}DESCRIPTION@{ub}
    Return a string corresponding to the given error number.

@endnode
@Node "WriteChar()" "WriteChar()"
@{fg shine}WriteChar()@{fg text}

@{b}NAME@{ub}
@{b}    WriteChar()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = WriteChar( int timeout, int ch );


@{b}DESCRIPTION@{ub}
    Write a single character to the Serial Port 
    (zero means success).

@endnode
@Node "WriteString()" "WriteString()"
@{fg shine}WriteString()@{fg text}

@{b}NAME@{ub}
@{b}    WriteString()

@{ub}
@{b}SYNOPSIS@{ub}
    int success = WriteString( int   timeout, 
                               char *string,
                               int   strsize
                             );


@{b}DESCRIPTION@{ub}
    Write a string to the Serial Port (zero means success). 

@endnode

