Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
BlackCore Class Referenceabstract

Base class of the other classes. More...

#include <BlackLib.h>

Inheritance diagram for BlackCore:
BlackCoreADC BlackCoreGPIO BlackCorePWM BlackADC BlackGPIO BlackPWM

Public Member Functions

 BlackCore ()
 Constructor of BlackCore class. More...
 
virtual ~BlackCore ()
 Destructor of BlackCore class. More...
 

Protected Types

enum  ocpSearch {
  ADC_helper = 0, PWM_P8_13 = 1,
  PWM_P8_19 = 2, PWM_P9_14 = 3,
  PWM_P9_16 = 4, PWM_P9_21 = 5,
  PWM_P9_22 = 6, PWM_P9_42 = 7
}
 

Protected Member Functions

std::string searchDirectoryOcp (BlackCore::ocpSearch searchThis)
 Searches ocp directory to find specified file/directory. More...
 
errorCoregetErrorsFromCore ()
 Exports errorCore struct to derived class. More...
 
std::string getCapeMgrName ()
 Exports capemgr name to derived class. More...
 
std::string getOcpName ()
 Exports ocp name to derived class. More...
 
std::string getSlotsFilePath ()
 Exports slots file path to derived class. More...
 

Private Member Functions

bool findCapeMgrName ()
 Finds full name of capemgr name. More...
 
bool findOcpName ()
 Finds full name of ocp name. More...
 
void setSlotsFilePath ()
 Generates full path of slots file. More...
 
std::string executeCommand (std::string command)
 Executes system call. More...
 
std::string searchDirectory (std::string searchIn, std::string searchThis)
 Searches specified directory to find specified file/directory. More...
 
virtual bool loadDeviceTree ()=0
 First declaration of this function. More...
 

Private Attributes

errorCorecoreErrors
 is used to hold the errors of BlackCore class More...
 
std::string capeMgrName
 is used to hold the capemgr name More...
 
std::string ocpName
 is used to hold the ocp name More...
 
std::string slotsFilePath
 is used to hold the slots file path More...
 

Detailed Description

Base class of the other classes.

This class is core of the BlackLib Library. It includes private functions like communicating with operating system and their limited versions to use from derived class.

Member Enumeration Documentation

enum BlackCore::ocpSearch
protected

This enum is used for defining ADC and PWM device driver names.

Enumerator
ADC_helper 

enumeration for helper name at BlackCore::searchDirectoryOcp() function parameter

PWM_P8_13 

enumeration for P8_13 pwm test name

PWM_P8_19 

enumeration for P8_19 pwm_test name

PWM_P9_14 

enumeration for P9_14 pwm_test name

PWM_P9_16 

enumeration for P9_16 pwm_test name

PWM_P9_21 

enumeration for P9_21 pwm_test name

PWM_P9_22 

enumeration for P9_22 pwm_test name

PWM_P9_42 

enumeration for P9_42 pwm_test name

Constructor & Destructor Documentation

BlackCore::BlackCore ( )

Constructor of BlackCore class.

This function initializes errorCore struct and runs these functions:

BlackCore::~BlackCore ( )
virtual

Destructor of BlackCore class.

Member Function Documentation

std::string BlackCore::executeCommand ( std::string  command)
private

Executes system call.

This function executes system commands with using popen() function. This example executes "ls" command with argument "la" and saves output to returnValue variable.

string returnValue = executeCommand("ls -la");

bool BlackCore::findCapeMgrName ( )
private

Finds full name of capemgr name.

This function searches "/sys/devices/" directory, to find file/directory which starts with "bone_capemgr."

Returns
True if successful, else false.
See Also
BlackCore::searchDirectory()
bool BlackCore::findOcpName ( )
private

Finds full name of ocp name.

This function searches "/sys/devices/" directory, to find file/directory which starts with "ocp."

Returns
True if successful, else false.
See Also
BlackCore::searchDirectory()
std::string BlackCore::getCapeMgrName ( )
protected

Exports capemgr name to derived class.

Returns
BlackCore::capeMgrName variable.
errorCore * BlackCore::getErrorsFromCore ( )
protected

Exports errorCore struct to derived class.

Returns
errorCore struct pointer.
std::string BlackCore::getOcpName ( )
protected

Exports ocp name to derived class.

Returns
BlackCore::ocpName variable.
std::string BlackCore::getSlotsFilePath ( )
protected

Exports slots file path to derived class.

Returns
BlackCore::slotsFilePath variable.
virtual bool BlackCore::loadDeviceTree ( )
privatepure virtual

First declaration of this function.

Implemented in BlackCoreGPIO, BlackCorePWM, and BlackCoreADC.

std::string BlackCore::searchDirectory ( std::string  searchIn,
std::string  searchThis 
)
private

Searches specified directory to find specified file/directory.

Parameters
[in]searchInsearching directory
[in]searchThissearch file/directory
Returns
Full name of searching file/directory.
std::string BlackCore::searchDirectoryOcp ( BlackCore::ocpSearch  searchThis)
protected

Searches ocp directory to find specified file/directory.

This function searches ocp directory only. It can be used from derived class.

Parameters
[in]searchThistakes BlackCore::ocpSearch type variable(enum)
Returns
Full name of searching file/directory.
void BlackCore::setSlotsFilePath ( )
private

Generates full path of slots file.

This function generates full slots file path with using capemgr name. And sets this path to BlackCore::slotsFilePath variable.

Member Data Documentation

std::string BlackCore::capeMgrName
private

is used to hold the capemgr name

errorCore* BlackCore::coreErrors
private

is used to hold the errors of BlackCore class

std::string BlackCore::ocpName
private

is used to hold the ocp name

std::string BlackCore::slotsFilePath
private

is used to hold the slots file path


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