Expand description

Modes.

The ECMA-48 standard is intended to be applicable to a very large range of devices, in which there are variations. Some of these variations have been formalized in the form of modes. They deal with the way in which a device transmits, receives, processes, or images data. Each mode has two states. The reset state, and the set state.

The states of the modes may be established explicitly in the data stream by the control functions SET MODE (SM) and RESET MODE (RM) or may be established by agreement between sender and recipient. In an implementation, some or all of the modes have one state only.

To ensure data compatibility and ease of interchange with a variety of equipment the use of modes is deprecated. If modes have to be implemented for backward compatibility it is recommended that the reset state of the modes be the initial state. Otherwise, explicit agreements will have to be negotiated between sender and recipient, to the detriment of “blind” interchange.

Usage

Two possibilities exist to use modes.

Directly invoking SM or RM Control Functions

You can pass modes to the arguments of the control functions SET MODE (SM) and RESET MODE (RM).

use ansi_control_codes::control_sequences;
use ansi_control_codes::modes;

// set the device component select mode to PRESENTATION.
print!("{}", control_sequences::SM(vec![modes::DCSM]));
// set the device component select mode to DATA.
print!("{}", control_sequences::RM(vec![modes::Mode::DeviceComponentSelectMode]));

Setting or Resetting Modes

You can invoke the set and reset functions of a mode instead.

use ansi_control_codes::modes;

// set the device component select mode to PRESENTATION.
print!("{}", modes::DCSM.set());
// set the device component select mode to DATA.
print!("{}", modes::Mode::DeviceComponentSelectMode.reset());

Enums

Constants

  • Bi-directional support mode BDSM.
  • Control Presentation Mode CRM.
  • Device Component Select Mode DCSM.
  • Erasure Mode ERM.
  • Format Effector Action Mode FEAM.
  • Format Effector Transfer Mode FETM.
  • Guarded Area Transfer Mode GATM.
  • Graphic Rendition Combination Mode GRCM.
  • Character Editing Mode HEM.
  • Insertion Replacement Mode IRM.
  • Keyboard Action Mode KAM.
  • Multiple Area Transfer Mode MATM.
  • Positioning Unit Mode PUM.
  • Selected Area Transfer Mode SATM.
  • Send/Receive Mode SRM.
  • Status Report Transfer Mode SRTM.
  • Tabulation Stop Mode TSM.
  • Transfer Termination Mode TTM.
  • Line Editing Mode VEM.
  • Zero Default Mode ZDM.