Roomba App  1.0
Communication Class Reference

The Communication class. More...

#include <communication.hh>

Collaboration diagram for Communication:

Public Member Functions

 Communication ()
 Construct new Communication object. More...
 
 ~Communication ()
 Destruct Communication object. More...
 
void setDeviceName (const std::string &name)
 Set serial device name. More...
 
void setDevice (QSerialPort *device)
 Set serial device. More...
 
bool openSerialPort (const char *serialPort)
 Open serial port. More...
 
bool openSerialPort ()
 Wraper function for opening serial port. More...
 
bool closeSerialPort ()
 Close serial port. More...
 
bool isOpen ()
 Check wether serial poet is open. More...
 
void setStatus (QLabel *statusBar)
 Set status of port openning on status bar. More...
 
FrameBufferuseFrameBuffer ()
 Get modifiable frame buffer. More...
 
const FrameBuffergetFrameBuffer () const
 Get unmodifiable frame buffer. More...
 
bool toContinue () const
 Check wether to continue communication with serial device. More...
 
void endCommunication ()
 End communicaiton with serial device. More...
 
void receiveData ()
 Receive line one by one in loop until end of communication. More...
 

Private Attributes

QSerialPort * _device = nullptr
 Serial device handle. More...
 
FrameBuffer _frame
 Frames buffer. More...
 
bool _continue = true
 Identifier whether to continue communicating with the serial. More...
 
std::string _deviceName
 Serial device name. More...
 
bool _opened = false
 Identifier whether serial device is open. More...
 

Detailed Description

Definition at line 23 of file communication.hh.

Constructor & Destructor Documentation

◆ Communication()

Communication::Communication ( )

Definition at line 18 of file communication.cpp.

◆ ~Communication()

Communication::~Communication ( )

Definition at line 20 of file communication.cpp.

Member Function Documentation

◆ closeSerialPort()

bool Communication::closeSerialPort ( )
Returns
bool Identifier wether serial port was closed succesfully
Return values
trueSerial port closed successfully
falseSerial port closed incoreccty

Definition at line 44 of file communication.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endCommunication()

void Communication::endCommunication ( )
inline

Definition at line 135 of file communication.hh.

Here is the caller graph for this function:

◆ getFrameBuffer()

const FrameBuffer& Communication::getFrameBuffer ( ) const
inline
Returns
const FrameBuffer& Immutable reference to frame buffer

Definition at line 122 of file communication.hh.

Here is the caller graph for this function:

◆ isOpen()

bool Communication::isOpen ( )
inline
Returns
bool Port openning identifier
Return values
truePort is open
falsePort is closed

Definition at line 104 of file communication.hh.

Here is the caller graph for this function:

◆ openSerialPort() [1/2]

bool Communication::openSerialPort ( )
inline
Returns
bool Identifier wether serial port was opened succesfully
Return values
trueSerial port opened successfully
falseSerial port opened incoreccty

Definition at line 88 of file communication.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ openSerialPort() [2/2]

bool Communication::openSerialPort ( const char *  serialPort)
Parameters
[in]serialPortSerial port name
Returns
bool Identifier wether serial port was opened succesfully
Return values
trueSerial port opened succesfully
falseSerial port opened incoreccty

Definition at line 22 of file communication.cpp.

Here is the caller graph for this function:

◆ receiveData()

void Communication::receiveData ( )

Definition at line 71 of file communication.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDevice()

void Communication::setDevice ( QSerialPort *  device)
inline
Parameters
[in]deviceSerial device handle

Definition at line 71 of file communication.hh.

Here is the caller graph for this function:

◆ setDeviceName()

void Communication::setDeviceName ( const std::string &  name)
inline
Parameters
[in]nameName of the serial device

Definition at line 65 of file communication.hh.

Here is the caller graph for this function:

◆ setStatus()

void Communication::setStatus ( QLabel *  statusBar)
Parameters
[in]statusBarHandle to QLabel on status bar

Definition at line 59 of file communication.cpp.

Here is the caller graph for this function:

◆ toContinue()

bool Communication::toContinue ( ) const
inline
Returns
bool Identifier wether to continue communication
Return values
trueContinue communication
falseEnd communicaton

Definition at line 130 of file communication.hh.

◆ useFrameBuffer()

FrameBuffer& Communication::useFrameBuffer ( )
inline
Returns
FrameBuffer& Mutable reference to frame buffer

Definition at line 116 of file communication.hh.

Here is the caller graph for this function:

Member Data Documentation

◆ _continue

bool Communication::_continue = true
private

Definition at line 38 of file communication.hh.

◆ _device

QSerialPort* Communication::_device = nullptr
private

Definition at line 28 of file communication.hh.

◆ _deviceName

std::string Communication::_deviceName
private

Definition at line 43 of file communication.hh.

◆ _frame

FrameBuffer Communication::_frame
private

Definition at line 33 of file communication.hh.

◆ _opened

bool Communication::_opened = false
private

Definition at line 48 of file communication.hh.


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