Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

Sensor Class Reference

Inheritance diagram for Sensor:
[legend]
Collaboration diagram for Sensor:
[legend]
List of all members.

Detailed Description

abstract class for a Sensor

Definition at line 10 of file Sensor.h.

Public Types

enum  Status {
  OPEN = 1,
  CLOSED = 0,
  ERROR = -1
}
 enumeration for the status of a sensor More...

enum  Type {
  VOLT = 'V',
  AMPS = 'A',
  TEMP = 'T',
  BATT = 'B',
  POW = 'P'
}
 enumeration for the type of a sensor More...


Public Member Functions

 Sensor (char *senName, Type senType, int senID)
 constructor for a sensor

 ~Sensor ()=0
 Destructor for a sensor.

Status getStatus ()=0
 get the status of the sensor

char * getName ()=0
 get the name of the sensor

int getID ()=0
 the id of the sensor

int getValue ()=0
 the current value of the sensor

void setValue (int newVal)=0
 set the value of the sensor

virtual void sendInfo ()
 setup and send the sensor information over the network


Protected Attributes

int ID
 ID of the sensor.

char * name
 name of the sensor

Status status
 status of the sensor

int value
 value of the sensor

sema senSem
 semaphore for the sensor

SensrPacket packet
 packet to send info over


Member Enumeration Documentation

enum Sensor::Status
 

enumeration for the status of a sensor

Enumeration values:
OPEN  the sensor is open
CLOSED  the sensor is closed
ERROR  error in the sensor

Definition at line 15 of file Sensor.h.

enum Sensor::Type
 

enumeration for the type of a sensor

Enumeration values:
VOLT  Voltage sensor.
AMPS  Amp reader.
TEMP  temperature sensor
BATT  battery sensor
POW  power of the motor sensor

Definition at line 27 of file Sensor.h.


Constructor & Destructor Documentation

Sensor::Sensor char *  senName,
Type  senType,
int  senID
 

constructor for a sensor

Parameters:
senName name for the new sensor
senType type of the sensor
senID id of the sensor


Member Function Documentation

int Sensor::getID  )  [pure virtual]
 

the id of the sensor

Return values:
the ID of the sensor

Implemented in AmpsSensor, BattSensor, PowSensor, TempSensor, and VoltSensor.

char* Sensor::getName  )  [pure virtual]
 

get the name of the sensor

Return values:
the name of the sensor

Implemented in AmpsSensor, BattSensor, PowSensor, TempSensor, and VoltSensor.

Status Sensor::getStatus  )  [pure virtual]
 

get the status of the sensor

Return values:
current status of the sensor

Implemented in AmpsSensor, BattSensor, PowSensor, TempSensor, and VoltSensor.

int Sensor::getValue  )  [pure virtual]
 

the current value of the sensor

Return values:
the current value of the sensor

Implemented in AmpsSensor, BattSensor, PowSensor, TempSensor, and VoltSensor.

void Sensor::setValue int  newVal  )  [pure virtual]
 

set the value of the sensor

Parameters:
newVal to set the sensor to

Implemented in AmpsSensor, BattSensor, PowSensor, TempSensor, and VoltSensor.


The documentation for this class was generated from the following file:
Generated on Fri Mar 25 23:48:46 2005 for CS498EmbeddedSystemsProgramming by doxygen 1.3.6