rec::robotino::api2 C++ interface
Public Member Functions | Static Public Member Functions | Friends | List of all members
rec::robotino::api2::Charger Class Reference

Represents a single Charger. More...

#include <Charger.h>

Inheritance diagram for rec::robotino::api2::Charger:
rec::robotino::api2::ComObject

Public Member Functions

void setComId (const ComId &id)
 
void setChargerNumber (int number)
 
int chargerNumber () const
 
void clearError ()
 
unsigned int time () const
 
float batteryVoltage () const
 
float chargingCurrent () const
 
float bat1temp () const
 
float bat2temp () const
 
int state_number () const
 
const char * state () const
 
void version (int *major, int *minor, int *patch) const
 
virtual void chargerInfoChanged (unsigned int time, float batteryVoltage, float chargingCurrent, float bat1temp, float bat2temp, int state_number, const char *state)
 
virtual void chargerErrorChanged (unsigned int time, const char *message)
 
virtual void chargerVersionChanged (int major, int minor, int patch)
 
- Public Member Functions inherited from rec::robotino::api2::ComObject
 ComObject ()
 
virtual ~ComObject ()
 
ComId comId () const
 

Static Public Member Functions

static unsigned int numChargers ()
 

Friends

class ChargerImpl
 

Additional Inherited Members

- Protected Attributes inherited from rec::robotino::api2::ComObject
ComId _comID
 

Detailed Description

Represents a single Charger.

Member Function Documentation

float rec::robotino::api2::Charger::bat1temp ( ) const

Temperature of battery 1.

Returns
Temperature in °C.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
float rec::robotino::api2::Charger::bat2temp ( ) const

Temperature of battery 2.

Returns
Temperature in °C.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
float rec::robotino::api2::Charger::batteryVoltage ( ) const

Battery voltage measured by the charger.

Returns
Battery voltage in Volts.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
virtual void rec::robotino::api2::Charger::chargerInfoChanged ( unsigned int  time,
float  batteryVoltage,
float  chargingCurrent,
float  bat1temp,
float  bat2temp,
int  state_number,
const char *  state 
)
virtual

Called when new info are available.

Parameters
timeCharger time in seconds
batteryVoltageVoltage of the battery attached to the charger in V.
chargingCurrentCharging current in A.
bat1tempTemperature of battery 1 in °C.
bat2tempTemperature of battery 2 in °C.
state_numberCharger state
stateCharger state string representation
Remarks
This function is called from the thread in which Com::processEvents() is called.
See also
Com::processEvents
int rec::robotino::api2::Charger::chargerNumber ( ) const

Get the current charger number

Returns
Charger number
Exceptions
nothing
Remarks
This function is thread save
float rec::robotino::api2::Charger::chargingCurrent ( ) const

Charging current.

Returns
Charging current in A.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
void rec::robotino::api2::Charger::clearError ( )

Clear error.

Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
static unsigned int rec::robotino::api2::Charger::numChargers ( )
static
Returns
Returns the maximum number of chargers on Robotino
Exceptions
nothing
Remarks
This function is thread save
void rec::robotino::api2::Charger::setChargerNumber ( int  number)

Sets the number of this Charger.

Parameters
numbernumber of this Charger
Exceptions
nothing
Remarks
This function is thread save
void rec::robotino::api2::Charger::setComId ( const ComId id)

Sets the associated communication object.

Parameters
idThe id of the associated communication object.
Exceptions
RobotinoExceptionif given id is invalid.
Remarks
This function is thread save
const char* rec::robotino::api2::Charger::state ( ) const

The current charger state as human readable string.

Returns
State in string representation.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
int rec::robotino::api2::Charger::state_number ( ) const

The current charger state as a number.

Returns
The state.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save
unsigned int rec::robotino::api2::Charger::time ( ) const

Retrieves the actual speed of this Charger.

Returns
Internal time of charger modulo 0xFFFF in seconds.
Exceptions
RobotinoExceptionif the current communication object is invalid.
Remarks
This function is thread save

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