The class to control the Serial State Machine.
More...
#include <SSMachine.h>
|
void | setSerial (Stream *stmObject) |
| Initializes the Serial State Machine by setting its internal Stream object to a pointer to the Serial Hardware instance. More...
|
|
void | printLostPack () |
| Prints the Lost Packets counter to the Serial port.
|
|
void | clearBuffer () |
| Clears the Serial Buffer.
|
|
void | sendData (Being *me) |
| Sends the data of the itself Sensing data to the Serial port. More...
|
|
void | checksum (byte dt) |
| This function is used to calculate the CRC checksum for the data. More...
|
|
byte | readsum () |
| This function reads the data from the input stream, calculates the CRC checksum and returns the data. More...
|
|
void | getData (Being *nb) |
| This function grabs the data from the input stream and feeds the local neigbour sensing data holder. More...
|
|
|
boolean | trustpack = false |
|
uint32_t | lostpack = 0 |
|
The SSMachine class holds the functions related to the Serial State Machine.
It grabs the data of the Neighbors Sensing, and sends itself data through the Serial port.
We dont call it directly, instead we call it from the class WRBoard as <ssm>.
◆ checksum()
void SSMachine::checksum |
( |
byte |
dt | ) |
|
|
inline |
- Parameters
-
dt | A byte of grabbed data to be used for the CRC checksum calculation |
◆ getData()
void SSMachine::getData |
( |
Being * |
nb | ) |
|
|
inline |
- Parameters
-
*nb | A pointer to the targetted local neighbor sensing data holder |
◆ readsum()
byte SSMachine::readsum |
( |
| ) |
|
|
inline |
- Returns
- Returns the data after the CRC checksum is calculated
◆ sendData()
void SSMachine::sendData |
( |
Being * |
me | ) |
|
|
inline |
- Parameters
-
*me | pointer to itself Being object. |
◆ setSerial()
void SSMachine::setSerial |
( |
Stream * |
stmObject | ) |
|
|
inline |
- Parameters
-
*stmObject | A pointer to the Serial Hardware instance. |
The documentation for this class was generated from the following file: