BusBricks: CommInterfaceBase Class Reference
BusBricks  0.1
Customize bus-communication
Loading...
Searching...
No Matches
CommInterfaceBase Class Reference

Communcation-Interface-Base-Class of the CommInterface template specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface: More...

#include <CommInterface.h>

Inheritance diagram for CommInterfaceBase:
[legend]
Collaboration diagram for CommInterfaceBase:
[legend]

Public Member Functions

virtual void setup_interface ()
 Setup the Interface has to be called in Setup-function.
 
virtual void sendNewFrame (CharArray *sendFrame)
 Add a new Frame to the send-buffer.
 
virtual bool finishedSending ()
 Check, if the Frame was sent and the CommInterface is ready to send the next Frame.
 
virtual void getReceivedFrame (CharArray *destFrameBuffer)
 Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object.
 
virtual bool receivedNewFrame ()
 Check, if a new Frame was received.
 
 CommInterfaceBase ()
 Construct a new Comm Interface Base object.
 
 ~CommInterfaceBase ()
 Destroy the Comm-Interface Base object.
 
- Public Member Functions inherited from ErrorState
 ErrorState ()
 Default constructor for ErrorState.
 
 ~ErrorState ()
 Destroy the ErrorState object.
 
void raiseError (errorCodes code)
 raises a new error by setting the given error-code as errorState
 
errorCodes getErrorState ()
 Get the currently active error-code.
 
void clearErrorState ()
 sets the current error-state to "no Error"
 

Detailed Description

Communcation-Interface-Base-Class of the CommInterface template specifies a standardized interface to use for integrating any hardware-interface (e.g. SoftwareSerial, OneWire...) into a Service-Interface The template ensures the correct handling of send- and receive-buffers of the interface:

sendBuffer set to nullptr: the Interface is ready to send another frame sendBuffer not set to nullptr: the frame, sendBuffer is pointing to, has to be send next

recBuffer set to nullptr: the frame received last was written to the destination successfully, no new receive-Buffer was defined recBuffer not set to nullptr: the interface is waiting to receive a new frame to write it to the destination, recBuffer is pointing to

Stores errors occurred during internal processing by using the ErrorState class. The errors can be picked-up by calling the public ErrorState functions after calling the send or receive cycles

Member Function Documentation

◆ finishedSending()

virtual bool CommInterfaceBase::finishedSending ( )
inlinevirtual

Check, if the Frame was sent and the CommInterface is ready to send the next Frame.

Returns
true Frame, that was added by sendNewFrame-function was send
false Frame, that was added by sendNewFrame-function is not sent yet

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

Here is the caller graph for this function:

◆ getReceivedFrame()

virtual void CommInterfaceBase::getReceivedFrame ( CharArray * destFrameBuffer)
inlinevirtual

Define the destination, the next received Frame should be copied to ba a pointer to an empty String-Object.

Parameters
destFrameBufferpointer to an empty CharArray-Object, the next received frame should be stored in

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

Here is the caller graph for this function:

◆ receivedNewFrame()

virtual bool CommInterfaceBase::receivedNewFrame ( )
inlinevirtual

Check, if a new Frame was received.

Returns
true a new frame was received and stored on the with getReceivedFrame specified Frame-Object
false no new frame was received, getReceivedFrame specified Frame-Object still empty

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

Here is the caller graph for this function:

◆ sendNewFrame()

virtual void CommInterfaceBase::sendNewFrame ( CharArray * sendFrame)
inlinevirtual

Add a new Frame to the send-buffer.

Parameters
sendFramePointer to CharArray-Object with frame to be send next

Reimplemented in CommInterface< interface_type >, and CommInterface< SoftwareSerial >.

Here is the caller graph for this function:

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