Classes |
Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
List of all members
ev3_control::H4REv3Port Class Reference
Inheritance diagram for ev3_control::H4REv3Port:
Collaboration diagram for ev3_control::H4REv3Port:
Classes | |
class | OpenFile |
Public Types | |
enum | H4Ev3IoPortType { H4REV3PORT_OUT, H4REV3PORT_IN } |
Public Member Functions | |
H4REv3Port (const std::string &port_name, H4Ev3IoPortType port_type) | |
bool | isConnected () |
bool | readInt (const char *filename, int &value, OpenFile &openFile, bool device_dir=true) |
bool | writeInt (const char *filename, int value, OpenFile &openFile, bool device_dir=true) |
const std::string & | getPortName () const |
H4Ev3IoPortType | getPortType () const |
bool | getDriverName (Ev3Strings::Ev3DriverName &drvname) |
template<typename T > | |
bool | writeKey (const char *filename, const StringEnum< T > &strmap, T key, OpenFile &openFile, bool device_dir=true) |
template<typename T > | |
bool | readKey (const char *filename, const StringEnum< T > &strmap, T &key, OpenFile &openFile, bool device_dir=true) |
Protected Member Functions | |
FILE * | get_fileptr_ (const char *filename, OpenFile::FileMode mode, OpenFile &file, bool device_dir=true) |
bool | getDeviceDirectory () |
bool | getPortDirectory () |
Protected Attributes | |
OpenFile | f_driver_name |
Ev3Strings::Ev3DriverName | last_driver_ |
int | last_driver_check_connected_id_ |
const std::string | port_name_ |
bool | connected_ |
int | connect_id_ |
H4Ev3IoPortType | port_type_ |
FileNameBuffer | sys_port_directory_ |
FileNameBuffer | sys_device_directory_ |
Constructor & Destructor Documentation
ev3_control::H4REv3Port::H4REv3Port | ( | const std::string & | port_name, |
H4Ev3IoPortType | port_type | ||
) |
The constructor
- Parameters
-
port_name port_name port_type input or output port
Member Function Documentation
|
inline |
get driver name from current device
- Parameters
-
[out] drvname Driver name enum type
- Returns
- True if successful, false otherwise (false normally means, nothing is connected)
Here is the call graph for this function:
|
inline |
- Returns
- The name of the port
|
inline |
- Returns
- The ports type
bool ev3_control::H4REv3Port::isConnected | ( | ) |
Check if a device is connected to the port
- Returns
- True if connected
Here is the call graph for this function:
Here is the caller graph for this function:
bool ev3_control::H4REv3Port::readInt | ( | const char * | filename, |
int & | value, | ||
OpenFile & | openFile, | ||
bool | device_dir = true |
||
) |
Reads a integer string from a sys file
- Parameters
-
filename The sys file to be read from (only filename without directory) [out] value output variable for the value only valid on return true device_dir True if it should open the file in the device_directory, false it will search the port directory for the file openFile Storage for file pointer
- Returns
- True if read successful, false otherwise
Here is the caller graph for this function:
template<typename T >
|
inline |
Reads a /sys string file and compares the read string with a given map of strings and gets it's number from the map
- Parameters
-
filename The sys file to be read strmap The string map key The key of the string (if return TRUE!) device_dir True if it should search in the device_directory, false it will search the port directory for the file openFile Storage for file pointer
- Returns
- True if read successful, false otherwise
Here is the caller graph for this function:
bool ev3_control::H4REv3Port::writeInt | ( | const char * | filename, |
int | value, | ||
OpenFile & | openFile, | ||
bool | device_dir = true |
||
) |
Writes a integer string from a sys file
- Parameters
-
filename The sys file to be read from (only filename without directory) value The value to be written to the file device_dir True if it should open the file in the device_directory, false it will search the port directory for the file openFile Storage for file pointer
- Returns
- True if read successful, false otherwise
Here is the caller graph for this function:
template<typename T >
|
inline |
Writes a string file from a map into a /sys file according to the given key.
- Parameters
-
filename The sys file to be written to (only filename without directory) strmap The string map key The key of the string (if return TRUE!) device_dir True if it should open the file in the device_directory, false it will search the port directory for the file openFile Storage for file pointer
- Returns
- True if read successful, false otherwise
Here is the caller graph for this function:
The documentation for this class was generated from the following files:
- /data/Daten/Entwicklung/ros_workspaces/h4r_ev3_ws/src/h4r_ev3/h4r_ev3_control/include/h4r_ev3_control/H4REv3Port.h
- /data/Daten/Entwicklung/ros_workspaces/h4r_ev3_ws/src/h4r_ev3/h4r_ev3_control/src/h4r_ev3_control/H4REv3Port.cpp