Hauptseite | Klassenhierarchie | Alphabetische Liste | Auflistung der Klassen | Auflistung der Dateien | Klassen-Elemente

# CStatemaschine Klassenreferenz

implements a statemaschine ( used the handle incoming command blocks ) Mehr...

`#include <statemaschine.hpp>`

Aufstellung aller Elemente

## Öffentliche Typen
enum | STATE { IDLE, WAIT_COMMAND, WAIT_ADDRESS, WAIT_LENGTH, WAIT_DATA, WAIT_ETX, WAIT_CRC }
| all possible states Mehr...
## Öffentliche Methoden
| CStatemaschine ()
| constructor
virtual | ~CStatemaschine ()
| destructor
bool | Input (const unsigned char ucInput)
| the implementation of the statemaschine overgive the next byte for run throught the statemaschine
STATE | GetCurrentState (void) const
| delivers the current state of the statemaschine
void | SetCurrentState (const STATE)
| Sets the current state of the statemaschine.
bool | IsCompleted (void) const
| returns true in case of a complete run through the statemaschine
## Private Methoden
bool | StateIdle (unsigned char ucInput)
| handle state IDLE
bool | StateWaitCommand (unsigned char ucInput)
| handle state WAIT_COMMAND
bool | StateWaitAddress (unsigned char ucInput)
| handle state WAIT_ADDRESS
bool | StateWaitLength (unsigned char ucInput)
| handle state WAIT_LENGTH
bool | StateWaitData (unsigned char ucInput)
| handle state WAIT_DATA
bool | StateWaitEtx (unsigned char ucInput)
| handle state WAIT_ETX
bool | StateWaitCrc (unsigned char ucInput)
| handle state WAIT_CRC
## Private Attribute
STATE | m_CurrentState
bool | m_bFinished
| the current state we're in
bool | m_bDatasegmentUsed
| have we finished a complete run through the statemaschine

## Ausführliche Beschreibung

implements a statemaschine ( used the handle incoming command blocks )

Version:
  1.0

Autor:
  Ingo Fröhlich

## Dokumentation der Aufzählungstypen

enum CStatemaschine::STATE

  | all possible states Aufzählungswerte:
  WAIT_COMMAND | just entered the statemaschine
  WAIT_ADDRESS | we expect a command ( 1 byte )
  WAIT_LENGTH | waiting for the addresse ( 2 bytes )
  WAIT_DATA | waiting for data block length ( 1 byte )
  WAIT_ETX | waiting for data ( n byte )
  WAIT_CRC | wait for checksum ( 2 bytes )

## Beschreibung der Konstruktoren und Destruktoren

CStatemaschine::CStatemaschine | ( |  | ) |

| constructor Format frame : STX, Command, Address, Length, [Data], ETX, crc STX : stating byte Command : Command send or received ( see commandstring for details ) Address : Address in the fps data send to or received from Length : Length of the data Data : the pure data ETX : byt, signals the end of the frame crc : checksum of the hole frame

## Dokumentation der Elementfunktionen

CStatemaschine::STATE CStatemaschine::GetCurrentState | ( | void |  | ) | const`[inline]`

  | delivers the current state of the statemaschine Parameter:
  | --- |
Rückgabe: current state

bool CStatemaschine::Input | ( | const unsigned char | ucInput | ) |

  | the implementation of the statemaschine overgive the next byte for run throught the statemaschine Parameter:
  | the | next read byte
Rückgabe: true ok false an error occured

bool CStatemaschine::IsCompleted | ( | void |  | ) | const

  | returns true in case of a complete run through the statemaschine Parameter:
  | --- |
Rückgabe: true run completed

void CStatemaschine::SetCurrentState | ( | const | STATE | ) |

  | Sets the current state of the statemaschine. Parameter:
  | the | new state
Rückgabe: ---

bool CStatemaschine::StateIdle | ( | unsigned char | ucInput | ) | `[private]`

  | handle state IDLE Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitAddress | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_ADDRESS Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitCommand | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_COMMAND Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitCrc | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_CRC Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitData | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_DATA Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitEtx | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_ETX Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

bool CStatemaschine::StateWaitLength | ( | unsigned char | ucInput | ) | `[private]`

  | handle state WAIT_LENGTH Parameter:
  | current | input of the statemaschine
Rückgabe: true error occured false else

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien:

- statemaschine.hpp
- statemaschine.cpp