Introduction

The serial console is a simple endpoint for serial traffic that you can connect a device’s UART to. It echos received data to stdout and optionally logs the data in an unbounded log.

Dedicated API

There is a dedicated API for accessing the console log. Note that the functions are defined in libTEMUConsole.so.

// Include the Console API
#include "temu-c/Models/Console.h"

// These functions are defined in libTEMUConsole.so
uint64_t temu_consoleGetLineCount(void *Con);
const char* temu_consoleGetLine(void *Con, uint64_t Line);

Creation

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

Configuration

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.

Attributes

Properties

Name Type Description

config.caretControl

uint8_t

config.recordTraffic

uint8_t

lastByte

uint8_t

object.timeSource

object

Time source object (a cpu or machine object)

outByte

uint8_t

serial

iref

Interfaces

Name Type Description

SerialIface

SerialIface

Ports

Prop Iface Description

serial

SerialIface

serial port

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 checkpointed.