Fawkes API  Fawkes Development Version
fawkes::LedInterface Class Reference

LedInterface Fawkes BlackBoard Interface. More...

#include <>>

Inheritance diagram for fawkes::LedInterface:

List of all members.

Classes

struct  LedInterface_data_t
 Internal data storage, do NOT modify! More...
class  SetIntensityMessage
 SetIntensityMessage Fawkes BlackBoard Interface Message. More...
class  TurnOffMessage
 TurnOffMessage Fawkes BlackBoard Interface Message. More...
class  TurnOnMessage
 TurnOnMessage Fawkes BlackBoard Interface Message. More...

Public Member Functions

virtual bool message_valid (const Message *message) const
 Check if message is valid and can be enqueued.
float intensity () const
 Get intensity value.
void set_intensity (const float new_intensity)
 Set intensity value.
size_t maxlenof_intensity () const
 Get maximum length of intensity value.
virtual Messagecreate_message (const char *type) const
 Create message based on type name.
virtual void copy_values (const Interface *other)
 Copy values from other interface.
virtual const char * enum_tostring (const char *enumtype, int val) const
 Convert arbitrary enum value to string.

Static Public Attributes

static const float ON = 1.0
 ON constant.
static const float OFF = 0.0
 OFF constant.

Detailed Description

LedInterface Fawkes BlackBoard Interface.

This interface provides access to LEDs. The interface controls an intensity value between 0.0 (off) and 1.0 (on, max intensity). LEDs that do not support intensity setting can only be set to on and off.


Member Function Documentation

void fawkes::LedInterface::copy_values ( const Interface other) [virtual]

Copy values from other interface.

Parameters:
otherother interface to copy values from

Implements fawkes::Interface.

Definition at line 123 of file LedInterface.cpp.

References fawkes::Interface::type().

Message * fawkes::LedInterface::create_message ( const char *  type) const [virtual]

Create message based on type name.

This will create a new message of the given type. The type must be given without the InterfaceName:: prefix but just the plain class name of the message.

Parameters:
typemessage type
Returns:
message of the given type, empty
Exceptions:
UnknownTypeExceptionthrown if this interface cannot create a message of the given type.

Implements fawkes::Interface.

Definition at line 104 of file LedInterface.cpp.

const char * fawkes::LedInterface::enum_tostring ( const char *  enumtype,
int  val 
) const [virtual]

Convert arbitrary enum value to string.

Given the string representation of the enum type and the value this method returns the string representation of the specific value, or the string UNKNOWN if the value is not defined. An exception is thrown if the enum type is invalid.

Parameters:
enumtypeenum type as string
valvalue to convert
Returns:
string representation of value
Exceptions:
UnknownTypeExceptionthrown if enumtype is not specified for interface.

Implements fawkes::Interface.

Definition at line 134 of file LedInterface.cpp.

float fawkes::LedInterface::intensity ( ) const

Get intensity value.

Intensity value.

Returns:
intensity value

Definition at line 76 of file LedInterface.cpp.

Referenced by Roomba500Thread::loop().

size_t fawkes::LedInterface::maxlenof_intensity ( ) const

Get maximum length of intensity value.

Returns:
length of intensity value, can be length of the array or number of maximum number of characters for a string

Definition at line 86 of file LedInterface.cpp.

bool fawkes::LedInterface::message_valid ( const Message message) const [virtual]

Check if message is valid and can be enqueued.

Parameters:
messageMessage to check
Returns:
true if the message is valid, false otherwise.

Implements fawkes::Interface.

Definition at line 365 of file LedInterface.cpp.

void fawkes::LedInterface::set_intensity ( const float  new_intensity)

Set intensity value.

Intensity value.

Parameters:
new_intensitynew intensity value

Definition at line 96 of file LedInterface.cpp.

References fawkes::Interface::data_changed.

Referenced by PanTiltRX28Thread::loop(), and Roomba500Thread::loop().


Member Data Documentation

const float fawkes::LedInterface::OFF = 0.0 [static]

OFF constant.

Definition at line 41 of file LedInterface.h.

const float fawkes::LedInterface::ON = 1.0 [static]

ON constant.

Definition at line 40 of file LedInterface.h.


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