# getmodemstatus

Retrieves the modem control-register values.

    getmodemstatus <intvar>

## Remarks

Retrieves the modem control-register values from the serial port.

The <intvar> variable can be one or more of the following values.

    1  The CTS (clear-to-send) signal is on.
    2  The DSR (data-set-ready) signal is on.
    4  The ring indicator signal is on.
    8  The RLSD (receive-line-signal-detect) signal is on.

If the command succeeds, the system variable "result" is set to 0. If the command fails, the variable is set to 1.

## Example

    testlink
    if result=0 then
      connect '/C=1'
      pause 3
    endif

    getmodemstatus val

    if result=0 then
      sprintf2 str "val = %d(%x)" val val
      messagebox str "Result value"
      if val & 2 > 0 then
        ; DSR signal is enabled.
        messagebox "DSR on" "Message"
      endif
    else
      messagebox "failed" "ERROR"
    endif

## See also

- setdtr
- setrts
- setspeed