Home Contents | # gcx:linkState | Graphics | Core4 Lua Commands

## SYNOPSIS

1. gcx:linkState([mode])
2. list = gcx:linkState()

## DESCRIPTION

The first form allows the display signal to be turned on and off by software. Pass the value "on" to turn the display signal on, use "off" to turn it off.

The second form returns information about the state of the link between controller and display. The result is a table with the following entries:

Key | Value
--- | ---
connected | true when the DVI cable is connected between controller and the display.
dpms | Power management state of the display. Can be either "on" or "off". The states "standby" and "suspend" are not too useful anymore in the flat screen age and have been omitted.
powered | true when the display is turned on.
backplane_connected | true when a Teratronik backplane controller was detected and initialized. The backplane controller handles support for touch screen, remote serial ports and remote gpio.
active | true when the controller is transmitting a video signal to the display.
remapped | true when the display geometry has changed and a new memory buffer has been allocated. This flag resets to false after it has been read by the application.

## RETURN VALUE

On success, returns a table containing information about the display link. On failure, returns three values: nil, a string describing the error (The result of the C library call strerror() on the errno code) and the errno number from the standard C library.

## NOTES

Only DVI cables are allowed to be unplugged while the controller is powered on. Displays that are connected directly to the controller must never be attached or removed while under power.

When a display is plugged in, the system checks if it is of the same type than the display that was plugged in before (if any). In that case, the screen contents are not changed and the display will still show the same contents. When a different display is plugged in, however, the system will reinitialize for the new display and clear the screen contents to black. The remapped flag indicates that this has happened.

An application checking for hotplug events should only redraw the screen contents if it sees the remapped flag. This avoids flicker.

## SEE ALSO

Introduction to DVI support
gfx.open(), gcx:backplaneVersion(), gcx:edid(), gcx:linkState(), gcx:displayGeometry()