Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter TwelveInternet Functions (continued)

SerialGetLinkStatus Function

Overview

The SerialGetLinkStatus function tests the condition of the serial link, returns a status code as well as certain channel states.

Syntax/Parameters

Syntax

int = SerialGetLinkStatus ( handle hSerial );

Parameters

hSerial

A handle to a Serial Port Object.

Return Value

Returns an int as a status code or a formatted error code on failure. Link off line is considered an error.

Remarks

If the configuration does have the DCD detect enabled, this function will always return SP_LINK_UNKNOWN (assuming the provided handle is valid). When DCD detect is enabled, the function will return certain sense status such as Ring or CTS.

  Definition   Bitwise   Description
  Masks        
    SP_ERROR_STATE_MASK   0xF0000000   An Error Condition Exists
    SP_CONDITION_MASK   0x000F0000   Condition Mask
    SP_CHANNEL_MASK   0x000000FF   Channel Codes (from Windows SK)
  Windows SDK Codes        
    SP_CTS_FLAG   0x00000010   Clear to Send (CTS, MS_CTS_ON)
    SP_DSR_FLAG   0x00000020   Data Set Ready (DSR, MS_DSR_ON)
    SP_RING_FLAG   0x00000040   Ring Signal (MS_RING_ON)
    SP_DCD_ON   0x00000080   Data Carrier (DCD, MS_RLSD_ON)
  General Errors        
    SP_CANCEL   0x80010000   User Cancel/Abort
    SP_LINK_OFFLINE   0x80030000   Link Offline (no DCD/RSLD)
    SP_TX_ERROR   0x80040000   Transmit Error
  Conditions        
    SP_LINK_UNKNOWN   0x00050000   Link Status Was Not Tested
    SP_LINK_ONLINE   0x00060000   Link Online (has DCD/RSLD)

 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic