WindRose 1.0
Custom Hardware , Firmware and Software for Robotic Cellular Automata Experiments
SSMachine Class Reference

The class to control the Serial State Machine. More...

#include <SSMachine.h>

Public Member Functions

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

Public Attributes

boolean trustpack = false
 
uint32_t lostpack = 0
 

Detailed Description

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

Member Function Documentation

◆ checksum()

void SSMachine::checksum ( byte  dt)
inline
Parameters
dtA byte of grabbed data to be used for the CRC checksum calculation

◆ getData()

void SSMachine::getData ( Being nb)
inline
Parameters
*nbA 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
*mepointer to itself Being object.

◆ setSerial()

void SSMachine::setSerial ( Stream *  stmObject)
inline
Parameters
*stmObjectA pointer to the Serial Hardware instance.

The documentation for this class was generated from the following file: