#include <statemaschine.hpp>
Ö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 | |
|
|
all possible states
|
|
|
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 |
|
|
delivers the current state of the statemaschine
|
|
|
the implementation of the statemaschine overgive the next byte for run throught the statemaschine
|
|
|
returns true in case of a complete run through the statemaschine
|
|
|
Sets the current state of the statemaschine.
|
|
|
handle state IDLE
|
|
|
handle state WAIT_ADDRESS
|
|
|
handle state WAIT_COMMAND
|
|
|
handle state WAIT_CRC
|
|
|
handle state WAIT_DATA
|
|
|
handle state WAIT_ETX
|
|
|
handle state WAIT_LENGTH
|
1.3.7