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_oncom2([<procedurec>]) http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Syntax: N_ONCOM2([<procedureC>])

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

N_ONCOM2() with no parameter returns state of COM2.

Example

N_ONCOM2("PROC2")        && call PROC2 when status changed om COM2
N_ONCOM2("")             && disable N_ONCOM2 traps

Notes

N_ONCOM2 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_ONCOM2() with no parameter returns the current state of COM2 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_ONCOM2("") with a null string disables N_ONCOM2 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_ONCOM2() until
there is no ring status.  E.g.,

     IF "c"$N_OMCOM2()
       DO WHILE "R"$N_ONCOM2()
       ENDDO
     ENDIF

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