Public Member Functions | Public Attributes | List of all members
rokubimini::serial::RokubiminiSerialBusManager Class Reference

Inherits from RokubiminiBusManager. It's used for managing the serial bus. More...

#include <RokubiminiSerialBusManager.hpp>

Inheritance diagram for rokubimini::serial::RokubiminiSerialBusManager:
Inheritance graph
[legend]

Public Member Functions

bool addRokubiminiToBus (RokubiminiSerial *rokubimini, const std::shared_ptr< setup::RokubiminiSerial > &rokubiminiSerialSetup) const
 Creates a RokubiminiSerial Implementation object for the. More...
 
bool loadSetup (std::vector< std::shared_ptr< rokubimini::Rokubimini >> &rokubiminis) override
 Checks for non-empty serial port names and calls the addRokubiminiToBus() method. More...
 
 RokubiminiSerialBusManager ()=default
 Default constructor of RokubiminiSerialBusManager. More...
 
void setConfigMode () override
 Sets all the serial devices in config mode. More...
 
void setRunMode () override
 Sets all the serial devices in run mode. More...
 
bool startupCommunication () override
 Initializes the communication with the serial devices. More...
 
 ~RokubiminiSerialBusManager () override=default
 
- Public Member Functions inherited from rokubimini::RokubiminiBusManager
virtual void addRokubiminiSetupToList (const std::shared_ptr< setup::Rokubimini > &rokubiminiSetup)
 
virtual bool addRokubiminiToBus (Rokubimini *rokubimini, const std::shared_ptr< setup::Rokubimini > &rokubiminiSetup) const
 
std::vector< std::shared_ptr< setup::Rokubimini > > getRokubiminiSetups ()
 
virtual void readAllBuses ()
 
 RokubiminiBusManager ()
 
virtual void shutdownAllBuses ()
 
virtual void writeToAllBuses ()
 
virtual ~RokubiminiBusManager ()=default
 

Public Attributes

std::vector< std::shared_ptr< RokubiminiSerial > > attachedRokubiminiSerials_
 

Additional Inherited Members

- Protected Attributes inherited from rokubimini::RokubiminiBusManager
std::vector< std::shared_ptr< setup::Rokubimini > > attachedRokubiminiSetups_
 

Detailed Description

Inherits from RokubiminiBusManager. It's used for managing the serial bus.

Although there isn't such a thing called "serial bus", it's used for compliance with the inheritance scheme. The bus-specifics don't exist here and the only things implemented are the way to have a list of RokubiminiSerial Setups and the way for creating RokubiminiSerialImpl objects.

Definition at line 30 of file RokubiminiSerialBusManager.hpp.

Constructor & Destructor Documentation

rokubimini::serial::RokubiminiSerialBusManager::RokubiminiSerialBusManager ( )
default

Default constructor of RokubiminiSerialBusManager.

rokubimini::serial::RokubiminiSerialBusManager::~RokubiminiSerialBusManager ( )
overridedefault

Member Function Documentation

bool rokubimini::serial::RokubiminiSerialBusManager::addRokubiminiToBus ( RokubiminiSerial rokubimini,
const std::shared_ptr< setup::RokubiminiSerial > &  rokubiminiSerialSetup 
) const

Creates a RokubiminiSerial Implementation object for the.

Parameters
rokubiminigiven.
rokubiminiThe Rokubimini Serial instance for which an implementation will be created.
rokubiminiSerialSetupThe Rokubimini Serial Setup instance from which the serial-specifics (port, baud rate) will be drawn.
Returns
True if the creation of the RokubiminiSerialImpl object is successful.

Definition at line 42 of file RokubiminiSerialBusManager.cpp.

bool rokubimini::serial::RokubiminiSerialBusManager::loadSetup ( std::vector< std::shared_ptr< rokubimini::Rokubimini >> &  rokubiminis)
overridevirtual

Checks for non-empty serial port names and calls the addRokubiminiToBus() method.

Parameters
rokubiminisThe Rokubimini instances. Only the Serial ones will be chosen for creating RokubiminiSerialImpl objects.
Returns
True if the checks and the creation of the RokubiminiSerialImpl objects are successful.
Todo:
Find a better way to implement this: Right now we loop through every Rokubimini instance and check if it matches with the RokubiminiSetup instance which the BusManager has in its attachedRokubiminiSetups_. After the match has been done, the Rokubimini instance is passed to addRokubiminiToBus().

Implements rokubimini::RokubiminiBusManager.

Definition at line 8 of file RokubiminiSerialBusManager.cpp.

void rokubimini::serial::RokubiminiSerialBusManager::setConfigMode ( )
overridevirtual

Sets all the serial devices in config mode.

Reimplemented from rokubimini::RokubiminiBusManager.

Definition at line 65 of file RokubiminiSerialBusManager.cpp.

void rokubimini::serial::RokubiminiSerialBusManager::setRunMode ( )
overridevirtual

Sets all the serial devices in run mode.

Reimplemented from rokubimini::RokubiminiBusManager.

Definition at line 75 of file RokubiminiSerialBusManager.cpp.

bool rokubimini::serial::RokubiminiSerialBusManager::startupCommunication ( )
overridevirtual

Initializes the communication with the serial devices.

Returns
True if the operation was successful.

Reimplemented from rokubimini::RokubiminiBusManager.

Definition at line 52 of file RokubiminiSerialBusManager.cpp.

Member Data Documentation

std::vector<std::shared_ptr<RokubiminiSerial> > rokubimini::serial::RokubiminiSerialBusManager::attachedRokubiminiSerials_

Definition at line 109 of file RokubiminiSerialBusManager.hpp.


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


rokubimini_serial
Author(s):
autogenerated on Wed Mar 3 2021 03:09:18