Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- GetIt Reference Guide - syntax: n_oncom1([<procedurec>]) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Syntax: N_ONCOM1([<procedureC>])

Calls a procedure when carrier on, carrier off or ring detected on COM1.

N_ONCOM1() with no parameter returns state of COM1.

Example

N_ONCOM1("PROC1")        && call PROC1 when status changed om COM1
N_ONCOM1("")             && disable N_ONCOM1 traps

Notes

N_ONCOM1 is active at all times, even if no wait-state is active.

Changes in the following signals will be trapped: Carrier Detected, Carrier
lost, Ring Indicator.

N_ONCOM1() with no parameter returns the current state of COM1 as a
character string.  The string may contain one or more of the following
characters (note difference between upper and lower case):

  "C" = Carrier Detected   "c" = Carrier Lost   "R" = Ring Detected

N_ONCOM1("") with a null string disables N_ONCOM1 interrupts.  It should be
disabled while, or as soon as it is no longer needed.

Hayes and Compatible Modems

Most Hayes/compatible modems come with Carrier Detect always on.  You must
disable this feature in order trap true carrier loss:  (SW6 ON in most 300-
1200 modems; command "AT &C1" in most 2400-9600 modems).

Sometimes loss of carrier will produce a spurious Ring detect.  Thus, after
loss of carrier, it is a good idea to loop and reissue N_ONCOM1() until
there is no ring status.  E.g.,

     IF "c"$N_OMCOM1()
       DO WHILE "R"$N_ONCOM1()
       ENDDO
     ENDIF

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson