Serial Port Emulation

Serial ports are emulated using the SerialIface.

Console

The serial console is a simple endpoint for serial traffic. It echos received data to stdout, and optionally logs the data in an unbounded log.

Loading the Plugin

import Console

Configuration

Creation

The Console class is defined in libTEMUConsole.so. The constructor takes no parameters.

Options

config.caretControl can be used to eliminate some VT100 characters that are printed to the console otherwise.

config.recordTraffic can be set to enable data recording in the console model, this data can then be extracted with the API.

@Console Reference

Properties

Name Type Description

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

Commands

Name Description

delete

Dispose instance of @Console

new

Create new instance of Console

Command new Arguments

Name Type Required Description

name

string

yes

Name of object to create

Console Reference

Properties

Name Type Description

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

config.caretControl

uint8_t

config.outFile

*char

File name to write TTY log to.

config.recordTraffic

uint8_t

config.reformatNonPrintable

uint8_t

lastByte

uint8_t

outByte

uint8_t

serial

temu_IfaceRef/ <unknown>

Serial connection.

Interfaces

Name Type Description

LineDataLoggerIface

LineDataLoggerIface

SerialIface

SerialIface

Ports

Prop Iface Description

serial

SerialIface

serial port

Commands

Name Description

delete

Dispose instance of Console

Limitations

  • The record buffer cannot be cleaned without deleting the console object.

  • Caret control only omits caret sequences from being put on stdout (especially nice when booting Linux). It doesn’t act on the sequences in any way at the moment e.g. a delete character will be ignored and not actually delete anything.

  • The record buffer will not be snapshotted.

Console Graphical User Interface

The serial console ui is a simple graphical endpoint for serial traffic. It forks of a separate process which display a new window with the serial port output. This window also handles interactive input, meaning that you can for example type commands to a command line interface provided by the software running in the emulated environment.

The console window supports limited VT100 emulation.

Loading the Plugin

import ConsoleUI

Configuration

No specific configuration needed.

Creation

The ConsoleUI class is defined in libTEMUConsoleUI.so. The constructor takes no parameters.

@ConsoleUI Reference

Properties

Name Type Description

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

Commands

Name Description

delete

Dispose instance of @ConsoleUI

new

Create new instance of ConsoleUI

Command new Arguments

Name Type Required Description

name

string

yes

Name of object to create

ConsoleUI Reference

Properties

Name Type Description

Class

*void

Class object

Component

*void

Pointer to component object if part of component

LoggingFlags

uint64_t

Flags for logging info

Name

*char

Object name

TimeSource

*void

Time source object

config.appendOutFile

uint8_t

config.outFile

*char

File name to write TTY log to.

serial

temu_IfaceRef/ <unknown>

Serial connection.

Interfaces

Name Type Description

ObjectIface

ObjectIface

SerialIface

SerialIface

Ports

Prop Iface Description

serial

SerialIface

serial port

Commands

Name Description

delete

Dispose instance of ConsoleUI

Limitations

As with all other models, problems not listed here should be reported to Terma as they may indicate bugs in the software.

  • The Console UI requires QT 4 to be installed (e.g. with your package manager) and any needed support libraries for QT. Thus the console in particular has a lot of extra dependencies over the rest of the emulator. If you are running this on specific systems and the console does not work, please report this to Terma.

  • The console always do VT100 emulation, the emulation cannot be disabled.

  • Only partial VT100 support exists. The supported CSIs include colors and cursor movements. Some CSIs may be missing.

  • The console does not echo input back automatically, this is typically done by the remote serial end. Consequently, you will not see any characters if you type them in the console and the remote does not echo back.