Base class of the other classes. More...
#include <BlackLib.h>
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... | |
errorCore * | getErrorsFromCore () |
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 | |
errorCore * | coreErrors |
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... | |
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.
|
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 |
BlackCore::BlackCore | ( | ) |
|
virtual |
Destructor of BlackCore class.
|
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");
|
private |
Finds full name of capemgr name.
This function searches "/sys/devices/" directory, to find file/directory which starts with "bone_capemgr."
|
private |
Finds full name of ocp name.
This function searches "/sys/devices/" directory, to find file/directory which starts with "ocp."
|
protected |
Exports capemgr name to derived class.
|
protected |
|
protected |
Exports ocp name to derived class.
|
protected |
Exports slots file path to derived class.
|
privatepure virtual |
First declaration of this function.
Implemented in BlackCoreGPIO, BlackCorePWM, and BlackCoreADC.
|
private |
Searches specified directory to find specified file/directory.
[in] | searchIn | searching directory |
[in] | searchThis | search file/directory |
|
protected |
Searches ocp directory to find specified file/directory.
This function searches ocp directory only. It can be used from derived class.
[in] | searchThis | takes BlackCore::ocpSearch type variable(enum) |
|
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.
|
private |
is used to hold the capemgr name
|
private |
is used to hold the ocp name
|
private |
is used to hold the slots file path