serialportprofile.h
// Copyright (c) 1999-2018 David Muse
// See the COPYING file for more information.
#ifndef RUDIMENTS_SERIALPORTPROFILE_H
#define RUDIMENTS_SERIALPORTPROFILE_H
#include <rudiments/private/serialportprofileincludes.h>
// cfmakeraw, cfsetspeed???
// wraps struct termios
class RUDIMENTS_DLLSPEC serialportprofile {
public:
enum inputmode_t {
cannonical=0,
raw
};
enum flowcontrol_t {
fc_none=0,
fc_software,
fc_hardware
};
enum baudrate_t {
baud_0=0,
baud_50,
baud_75,
baud_110,
baud_134,
baud_150,
baud_200,
baud_300,
baud_600,
baud_1200,
baud_1800,
baud_2400,
baud_4800,
baud_9600,
baud_19200,
exta,
baud_38400,
extb,
baud_57600,
baud_76800,
baud_115200,
baud_230400,
baud_460800,
baud_500000,
baud_576000,
baud_921600,
baud_1000000,
baud_1152000,
baud_1500000,
baud_2000000,
baud_2500000,
baud_3000000,
baud_3500000,
baud_4000000
};
enum charsize_t {
cs_5=0,
cs_6,
cs_7,
cs_8
};
enum newlinedelay_t {
nl_none=0,
nl_100
};
enum carriagereturndelay_t {
cr_none=0,
cr_depends,
cr_100,
cr_150
};
enum tabdelay_t {
td_0=0,
td_1,
td_2,
td_xtabs
};
enum backspacedelay_t {
bs_none=0,
bs_50
};
enum verticaltabdelay_t {
vt_none=0,
vt_2
};
enum formfeeddelay_t {
ff_none=0,
ff_2
};
serialportprofile();
~serialportprofile();
void defaultControlOptions();
void defaultLocalOptions();
void defaultInputOptions();
void defaultOutputOptions();
void defaultControlCharacters();
void defaultOptions();
void setControlCharacters(const unsigned char *c_cc);
void evalOptionsString(const char *string);
void inputMode(inputmode_t inputmode);
inputmode_t inputMode();
void flowControl(flowcontrol_t flowcontrol);
flowcontrol_t flowControl();
void baud(const char *baudrate);
void baud(baudrate_t baudrate);
bool inputBaud(const char *baudrate);
bool inputBaud(baudrate_t baudrate);
bool outputBaud(const char *baudrate);
bool outputBaud(baudrate_t baudrate);
void characterSize(charsize_t size);
void twoStopBits(bool truefalse);
void receiverOn(bool truefalse);
void parityCheck(bool truefalse);
void oddParity(bool truefalse);
void hangupOnClose(bool truefalse);
void ignoreModemControlLines(bool truefalse);
void blockJobControlOutput(bool truefalse);
void hardwareFlowControl(bool truefalse);
baudrate_t baud();
baudrate_t inputBaud();
baudrate_t outputBaud();
charsize_t characterSize();
bool twoStopBits();
bool receiverOn();
bool parityCheck();
bool oddParity();
bool hangupOnClose();
bool ignoreModemControlLines();
bool blockJobControlOutput();
bool hardwareFlowControl();
void generateSignals(bool truefalse);
void canonicalInput(bool truefalse);
void escapedUpperCase(bool truefalse);
void echoInput(bool truefalse);
void eraseCharactersOn(bool truefalse);
void killCharacterOn(bool truefalse);
void echoNewLine(bool truefalse);
void extendedFunctions(bool truefalse);
void echoControlCharacters(bool truefalse);
void echoErasedCharacter(bool truefalse);
void emulateKill(bool truefalse);
void noFlushAfterInterruptOrQuit(bool truefalse);
void retypePendingCharacters(bool truefalse);
void sendSignalForBackgroundOutput(bool truefalse);
bool generateSignals();
bool canonicalInput();
bool escapedUpperCase();
bool echoInput();
bool eraseCharactersOn();
bool killCharacterOn();
bool echoNewLine();
bool extendedFunctions();
bool echoControlCharacters();
bool echoErasedCharacter();
bool emulateKill();
bool noFlushAfterInterruptOrQuit();
bool retypePendingCharacters();
bool sendSignalForBackgroundOutput();
void inputParityCheck(bool truefalse);
void ignoreParityErrors(bool truefalse);
void markParityErrors(bool truefalse);
void stripParityBits(bool truefalse);
void softwareFlowControlOnOutput(bool truefalse);
void softwareFlowControlOnInput(bool truefalse);
void anyCharacterStartsFlow(bool truefalse);
void ignoreBreak(bool truefalse);
void sendSignalOnBreak(bool truefalse);
void mapNewLineToCarriageReturnOnInput(bool truefalse);
void discardEndOfTransmission(bool truefalse);
void ignoreCarriageReturn(bool truefalse);
void mapCarriageReturnToNewLineOnInput(bool truefalse);
void lowerCase(bool truefalse);
void bellIfLineTooLong(bool truefalse);
bool inputParityCheck();
bool ignoreParityErrors();
bool markParityErrors();
bool stripParityBits();
bool softwareFlowControlOnOutput();
bool softwareFlowControlOnInput();
bool anyCharacterStartsFlow();
bool ignoreBreak();
bool sendSignalOnBreak();
bool mapNewLineToCarriageReturnOnInput();
bool discardEndOfTransmission();
bool ignoreCarriageReturn();
bool mapCarriageReturnToNewLineOnInput();
bool lowerCase();
bool bellIfLineTooLong();
void postProcessOutput(bool truefalse);
void outputUpperCase(bool truefalse);
void mapNewLineToCarriageReturnNewLineOnOutput(
bool truefalse);
void mapCarriageReturnToNewLineOnOutput(bool truefalse);
void dontOutputCarriageReturnAtColumnZero(bool truefalse);
void mapNewLineToCarriageReturnOnOutput(bool truefalse);
void useFillCharactersForDelay(bool truefalse);
void useDelForFill(bool truefalse);
void expandTabToSpaces(bool truefalse);
void delayAfterNewLine(newlinedelay_t nldelay);
void delayAfterCarriageReturn(carriagereturndelay_t crdelay);
void delayAfterTab(tabdelay_t tabdelay);
void delayAfterBackSpace(backspacedelay_t bsdelay);
void delayAfterVerticalTab(verticaltabdelay_t vtdelay);
void delayAfterFormFeed(formfeeddelay_t ffdelay);
bool postProcessOutput();
bool outputUpperCase();
bool mapNewLineToCarriageReturnNewLineOnOutput();
bool mapCarriageReturnToNewLineOnOutput();
bool dontOutputCarriageReturnAtColumnZero();
bool mapNewLineToCarriageReturnOnOutput();
bool useFillCharactersForDelay();
bool useDelForFill();
bool expandTabToSpaces();
newlinedelay_t delayAfterNewLine();
carriagereturndelay_t delayAfterCarriageReturn();
tabdelay_t delayAfterTab();
backspacedelay_t delayAfterBackSpace();
verticaltabdelay_t delayAfterVerticalTab();
formfeeddelay_t delayAfterFormFeed();
void interruptCharacter(unsigned char character);
void quitCharacter(unsigned char character);
void eraseCharacter(unsigned char character);
void killCharacter(unsigned char character);
void endOfFileCharacter(unsigned char character);
void endOfLineCharacter(unsigned char character);
void secondEndOfLineCharacter(unsigned char character);
void switchCharacer(unsigned char character);
void startCharacter(unsigned char character);
void stopCharacter(unsigned char character);
void suspendCharacter(unsigned char character);
void delayedSuspendCharacter(unsigned char character);
void literalNextCharcter(unsigned char character);
void wordEraseCharcter(unsigned char character);
void reprintCharacter(unsigned char character);
void discardPendingOutputCharacter(unsigned char character);
void statusRequestCharacter(unsigned char character);
void readThreshold(unsigned char count);
void readTimeout(unsigned char deciseconds);
unsigned char interruptCharacter();
unsigned char quitCharacter();
unsigned char eraseCharacter();
unsigned char killCharacter();
unsigned char endOfFileCharacter();
unsigned char endOfLineCharacter();
unsigned char secondEndOfLineCharacter();
unsigned char switchCharacer();
unsigned char startCharacter();
unsigned char stopCharacter();
unsigned char suspendCharacter();
unsigned char delayedSuspendCharacter();
unsigned char literalNextCharcter();
unsigned char wordEraseCharcter();
unsigned char reprintCharacter();
unsigned char discardPendingOutputCharacter();
unsigned char statusRequestCharacter();
unsigned char readThreshold();
unsigned char readTimeout();
#include <rudiments/private/serialportprofile.h>
};
#endif
character
Definition: character.h:11
serialportprofile
Definition: serialportprofile.h:21
serialportprofile::ignoreParityErrors
bool ignoreParityErrors()
serialportprofile::mapNewLineToCarriageReturnNewLineOnOutput
bool mapNewLineToCarriageReturnNewLineOnOutput()
serialportprofile::lowerCase
bool lowerCase()
serialportprofile::delayAfterCarriageReturn
carriagereturndelay_t delayAfterCarriageReturn()
serialportprofile::echoControlCharacters
bool echoControlCharacters()
serialportprofile::inputMode
void inputMode(inputmode_t inputmode)
serialportprofile::outputBaud
bool outputBaud(const char *baudrate)
serialportprofile::secondEndOfLineCharacter
void secondEndOfLineCharacter(unsigned char character)
serialportprofile::killCharacterOn
void killCharacterOn(bool truefalse)
serialportprofile::noFlushAfterInterruptOrQuit
bool noFlushAfterInterruptOrQuit()
serialportprofile::defaultControlCharacters
void defaultControlCharacters()
serialportprofile::inputBaud
bool inputBaud(baudrate_t baudrate)
serialportprofile::sendSignalForBackgroundOutput
bool sendSignalForBackgroundOutput()
serialportprofile::sendSignalForBackgroundOutput
void sendSignalForBackgroundOutput(bool truefalse)
serialportprofile::flowControl
void flowControl(flowcontrol_t flowcontrol)
serialportprofile::expandTabToSpaces
void expandTabToSpaces(bool truefalse)
serialportprofile::echoNewLine
bool echoNewLine()
serialportprofile::bellIfLineTooLong
void bellIfLineTooLong(bool truefalse)
serialportprofile::baud
void baud(baudrate_t baudrate)
serialportprofile::hardwareFlowControl
bool hardwareFlowControl()
serialportprofile::flowControl
flowcontrol_t flowControl()
serialportprofile::twoStopBits
bool twoStopBits()
serialportprofile::~serialportprofile
~serialportprofile()
serialportprofile::endOfLineCharacter
void endOfLineCharacter(unsigned char character)
serialportprofile::ignoreCarriageReturn
void ignoreCarriageReturn(bool truefalse)
serialportprofile::mapCarriageReturnToNewLineOnInput
void mapCarriageReturnToNewLineOnInput(bool truefalse)
serialportprofile::eraseCharactersOn
bool eraseCharactersOn()
serialportprofile::interruptCharacter
void interruptCharacter(unsigned char character)
serialportprofile::hangupOnClose
bool hangupOnClose()
serialportprofile::dontOutputCarriageReturnAtColumnZero
void dontOutputCarriageReturnAtColumnZero(bool truefalse)
serialportprofile::switchCharacer
unsigned char switchCharacer()
serialportprofile::readThreshold
unsigned char readThreshold()
serialportprofile::hardwareFlowControl
void hardwareFlowControl(bool truefalse)
serialportprofile::defaultOptions
void defaultOptions()
serialportprofile::discardEndOfTransmission
bool discardEndOfTransmission()
serialportprofile::defaultLocalOptions
void defaultLocalOptions()
serialportprofile::delayedSuspendCharacter
void delayedSuspendCharacter(unsigned char character)
serialportprofile::delayAfterFormFeed
void delayAfterFormFeed(formfeeddelay_t ffdelay)
serialportprofile::suspendCharacter
unsigned char suspendCharacter()
serialportprofile::interruptCharacter
unsigned char interruptCharacter()
serialportprofile::oddParity
bool oddParity()
serialportprofile::mapCarriageReturnToNewLineOnOutput
void mapCarriageReturnToNewLineOnOutput(bool truefalse)
serialportprofile::inputBaud
bool inputBaud(const char *baudrate)
serialportprofile::mapCarriageReturnToNewLineOnOutput
bool mapCarriageReturnToNewLineOnOutput()
serialportprofile::bellIfLineTooLong
bool bellIfLineTooLong()
serialportprofile::outputUpperCase
void outputUpperCase(bool truefalse)
serialportprofile::generateSignals
bool generateSignals()
serialportprofile::suspendCharacter
void suspendCharacter(unsigned char character)
serialportprofile::delayAfterNewLine
newlinedelay_t delayAfterNewLine()
serialportprofile::characterSize
void characterSize(charsize_t size)
serialportprofile::startCharacter
unsigned char startCharacter()
serialportprofile::endOfFileCharacter
void endOfFileCharacter(unsigned char character)
serialportprofile::twoStopBits
void twoStopBits(bool truefalse)
serialportprofile::softwareFlowControlOnOutput
void softwareFlowControlOnOutput(bool truefalse)
serialportprofile::characterSize
charsize_t characterSize()
serialportprofile::softwareFlowControlOnOutput
bool softwareFlowControlOnOutput()
serialportprofile::delayAfterCarriageReturn
void delayAfterCarriageReturn(carriagereturndelay_t crdelay)
serialportprofile::canonicalInput
bool canonicalInput()
serialportprofile::parityCheck
bool parityCheck()
serialportprofile::literalNextCharcter
void literalNextCharcter(unsigned char character)
serialportprofile::inputBaud
baudrate_t inputBaud()
serialportprofile::delayAfterTab
void delayAfterTab(tabdelay_t tabdelay)
serialportprofile::reprintCharacter
unsigned char reprintCharacter()
serialportprofile::outputBaud
baudrate_t outputBaud()
serialportprofile::ignoreModemControlLines
void ignoreModemControlLines(bool truefalse)
serialportprofile::receiverOn
void receiverOn(bool truefalse)
serialportprofile::eraseCharacter
unsigned char eraseCharacter()
serialportprofile::defaultInputOptions
void defaultInputOptions()
serialportprofile::eraseCharacter
void eraseCharacter(unsigned char character)
serialportprofile::baud
void baud(const char *baudrate)
serialportprofile::secondEndOfLineCharacter
unsigned char secondEndOfLineCharacter()
serialportprofile::inputParityCheck
void inputParityCheck(bool truefalse)
serialportprofile::useDelForFill
bool useDelForFill()
serialportprofile::reprintCharacter
void reprintCharacter(unsigned char character)
serialportprofile::markParityErrors
bool markParityErrors()
serialportprofile::postProcessOutput
bool postProcessOutput()
serialportprofile::stripParityBits
void stripParityBits(bool truefalse)
serialportprofile::discardPendingOutputCharacter
void discardPendingOutputCharacter(unsigned char character)
serialportprofile::evalOptionsString
void evalOptionsString(const char *string)
serialportprofile::statusRequestCharacter
void statusRequestCharacter(unsigned char character)
serialportprofile::echoInput
void echoInput(bool truefalse)
serialportprofile::mapNewLineToCarriageReturnNewLineOnOutput
void mapNewLineToCarriageReturnNewLineOnOutput(bool truefalse)
serialportprofile::ignoreModemControlLines
bool ignoreModemControlLines()
serialportprofile::echoErasedCharacter
void echoErasedCharacter(bool truefalse)
serialportprofile::defaultControlOptions
void defaultControlOptions()
serialportprofile::stopCharacter
unsigned char stopCharacter()
serialportprofile::mapNewLineToCarriageReturnOnInput
bool mapNewLineToCarriageReturnOnInput()
serialportprofile::endOfFileCharacter
unsigned char endOfFileCharacter()
serialportprofile::softwareFlowControlOnInput
void softwareFlowControlOnInput(bool truefalse)
serialportprofile::ignoreParityErrors
void ignoreParityErrors(bool truefalse)
serialportprofile::extendedFunctions
void extendedFunctions(bool truefalse)
serialportprofile::killCharacter
unsigned char killCharacter()
serialportprofile::wordEraseCharcter
unsigned char wordEraseCharcter()
serialportprofile::retypePendingCharacters
void retypePendingCharacters(bool truefalse)
serialportprofile::useDelForFill
void useDelForFill(bool truefalse)
serialportprofile::delayAfterNewLine
void delayAfterNewLine(newlinedelay_t nldelay)
serialportprofile::stopCharacter
void stopCharacter(unsigned char character)
serialportprofile::inputParityCheck
bool inputParityCheck()
serialportprofile::echoInput
bool echoInput()
serialportprofile::mapCarriageReturnToNewLineOnInput
bool mapCarriageReturnToNewLineOnInput()
serialportprofile::quitCharacter
unsigned char quitCharacter()
serialportprofile::eraseCharactersOn
void eraseCharactersOn(bool truefalse)
serialportprofile::noFlushAfterInterruptOrQuit
void noFlushAfterInterruptOrQuit(bool truefalse)
serialportprofile::markParityErrors
void markParityErrors(bool truefalse)
serialportprofile::setControlCharacters
void setControlCharacters(const unsigned char *c_cc)
serialportprofile::oddParity
void oddParity(bool truefalse)
serialportprofile::killCharacter
void killCharacter(unsigned char character)
serialportprofile::delayAfterVerticalTab
verticaltabdelay_t delayAfterVerticalTab()
serialportprofile::switchCharacer
void switchCharacer(unsigned char character)
serialportprofile::quitCharacter
void quitCharacter(unsigned char character)
serialportprofile::dontOutputCarriageReturnAtColumnZero
bool dontOutputCarriageReturnAtColumnZero()
serialportprofile::readThreshold
void readThreshold(unsigned char count)
serialportprofile::stripParityBits
bool stripParityBits()
serialportprofile::delayAfterBackSpace
backspacedelay_t delayAfterBackSpace()
serialportprofile::ignoreCarriageReturn
bool ignoreCarriageReturn()
serialportprofile::statusRequestCharacter
unsigned char statusRequestCharacter()
serialportprofile::mapNewLineToCarriageReturnOnOutput
void mapNewLineToCarriageReturnOnOutput(bool truefalse)
serialportprofile::escapedUpperCase
bool escapedUpperCase()
serialportprofile::hangupOnClose
void hangupOnClose(bool truefalse)
serialportprofile::defaultOutputOptions
void defaultOutputOptions()
serialportprofile::inputMode
inputmode_t inputMode()
serialportprofile::readTimeout
void readTimeout(unsigned char deciseconds)
serialportprofile::lowerCase
void lowerCase(bool truefalse)
serialportprofile::killCharacterOn
bool killCharacterOn()
serialportprofile::canonicalInput
void canonicalInput(bool truefalse)
serialportprofile::mapNewLineToCarriageReturnOnInput
void mapNewLineToCarriageReturnOnInput(bool truefalse)
serialportprofile::literalNextCharcter
unsigned char literalNextCharcter()
serialportprofile::emulateKill
bool emulateKill()
serialportprofile::parityCheck
void parityCheck(bool truefalse)
serialportprofile::discardEndOfTransmission
void discardEndOfTransmission(bool truefalse)
serialportprofile::readTimeout
unsigned char readTimeout()
serialportprofile::echoErasedCharacter
bool echoErasedCharacter()
serialportprofile::sendSignalOnBreak
bool sendSignalOnBreak()
serialportprofile::anyCharacterStartsFlow
void anyCharacterStartsFlow(bool truefalse)
serialportprofile::delayedSuspendCharacter
unsigned char delayedSuspendCharacter()
serialportprofile::retypePendingCharacters
bool retypePendingCharacters()
serialportprofile::expandTabToSpaces
bool expandTabToSpaces()
serialportprofile::delayAfterVerticalTab
void delayAfterVerticalTab(verticaltabdelay_t vtdelay)
serialportprofile::delayAfterFormFeed
formfeeddelay_t delayAfterFormFeed()
serialportprofile::generateSignals
void generateSignals(bool truefalse)
serialportprofile::emulateKill
void emulateKill(bool truefalse)
serialportprofile::discardPendingOutputCharacter
unsigned char discardPendingOutputCharacter()
serialportprofile::baud
baudrate_t baud()
serialportprofile::endOfLineCharacter
unsigned char endOfLineCharacter()
serialportprofile::echoNewLine
void echoNewLine(bool truefalse)
serialportprofile::extendedFunctions
bool extendedFunctions()
serialportprofile::sendSignalOnBreak
void sendSignalOnBreak(bool truefalse)
serialportprofile::blockJobControlOutput
void blockJobControlOutput(bool truefalse)
serialportprofile::delayAfterBackSpace
void delayAfterBackSpace(backspacedelay_t bsdelay)
serialportprofile::useFillCharactersForDelay
void useFillCharactersForDelay(bool truefalse)
serialportprofile::softwareFlowControlOnInput
bool softwareFlowControlOnInput()
serialportprofile::useFillCharactersForDelay
bool useFillCharactersForDelay()
serialportprofile::escapedUpperCase
void escapedUpperCase(bool truefalse)
serialportprofile::blockJobControlOutput
bool blockJobControlOutput()
serialportprofile::startCharacter
void startCharacter(unsigned char character)
serialportprofile::receiverOn
bool receiverOn()
serialportprofile::ignoreBreak
bool ignoreBreak()
serialportprofile::delayAfterTab
tabdelay_t delayAfterTab()
serialportprofile::anyCharacterStartsFlow
bool anyCharacterStartsFlow()
serialportprofile::serialportprofile
serialportprofile()
serialportprofile::wordEraseCharcter
void wordEraseCharcter(unsigned char character)
serialportprofile::postProcessOutput
void postProcessOutput(bool truefalse)
serialportprofile::ignoreBreak
void ignoreBreak(bool truefalse)
serialportprofile::outputBaud
bool outputBaud(baudrate_t baudrate)
serialportprofile::outputUpperCase
bool outputUpperCase()
serialportprofile::mapNewLineToCarriageReturnOnOutput
bool mapNewLineToCarriageReturnOnOutput()
serialportprofile::echoControlCharacters
void echoControlCharacters(bool truefalse)