Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

LOW_device Class Reference

Abstract base class for all 1-Wire devices. More...

#include <LOW_device.h>

Inheritance diagram for LOW_device:

Inheritance graph
[legend]
Collaboration diagram for LOW_device:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< LOW_device *> devPtrVec_t
 Vector type of class device pointers. More...

typedef std::map< LOW_deviceID,
LOW_device *> 
deviceMap_t
 Map type of devices with LOW_deviceID as key. More...


Public Methods

virtual ~LOW_device ()
 Destructor. More...

virtual LOW_deviceID getID () const
 Get the device's ROM ID. More...

virtual LOW_netSegmentgetNetSegment () const
 Get the network segment the device is on. More...

virtual std::string getFamilyName () const
 Get the device's family name. More...

virtual bool verifyDevice (const bool inOnlyAlarm=false, const bool inDoReset=true) const
 Shortcut method to verify the presence of the device on it's network segment. More...


Static Public Attributes

const LOW_deviceIDRaw::devFamCode_t anyDev_famCode = 0xff
 Family code for selecting any/all device types. More...

const LOW_deviceIDRaw::devFamCode_t familyCode = anyDev_famCode
 Family code of this base class equals the one for any device type. More...

const std::string familyName = "any"
 Family name of this base class. More...

const owCommand_t MatchROM_COMMAND = 0x55
 1-Wire command byte constant. More...

const owCommand_t ReadROM_COMMAND = 0x33
 1-Wire command byte constant. More...

const owCommand_t SkipROM_COMMAND = 0xcc
 1-Wire command byte constant. More...

const owCommand_t SearchROM_COMMAND = 0xf0
 1-Wire command byte constant. More...

const owCommand_t SearchAlarmROM_COMMAND = 0xec
 1-Wire command byte constant. More...


Protected Methods

 LOW_device (LOW_netSegment &inSegment, const LOW_deviceID &inDevID, const LOW_deviceIDRaw::devFamCode_t inFamCode)
 Base constructor for devices. More...

virtual LOW_linkgetLink () const
 Get the link the device is on. More...

virtual void cmd_MatchROM () const
 Shortcut for issuing a matchROM command for a device. More...


Static Protected Methods

LOW_device * new_Instance (LOW_netSegment &inNetSegment, const LOW_deviceID &inDevID)
 Static method for creating new concrete device objects. More...


Protected Attributes

const LOW_deviceID ID
 1-Wire ROM ID of the device. More...

LOW_netSegmentnetSegment
 Network segment where the device is located. More...


Friends

class linkLock
 Needed to grant access to the protected getLink() method. More...


Detailed Description

Abstract base class for all 1-Wire devices.

Any device class representing a concrete 1-Wire device must inherit from this class.

This class is thread-safe.

Author:
Harald Roelle

Definition at line 40 of file LOW_device.h.


Member Typedef Documentation

typedef std::map<LOW_deviceID,LOW_device*> LOW_device::deviceMap_t
 

Map type of devices with LOW_deviceID as key.

Definition at line 98 of file LOW_device.h.

typedef std::vector<LOW_device*> LOW_device::devPtrVec_t
 

Vector type of class device pointers.

Definition at line 97 of file LOW_device.h.

Referenced by LOW_netSegment::searchDevices().


Constructor & Destructor Documentation

LOW_device::~LOW_device   [virtual]
 

Destructor.

Deregisters the device from its LOW_netSegment.

Definition at line 62 of file LOW_device.cpp.

References netSegment, and LOW_netSegment::unregisterDevice().

LOW_device::LOW_device LOW_netSegment   inSegment,
const LOW_deviceID   inDevID,
const LOW_deviceIDRaw::devFamCode_t    inFamCode
[protected]
 

Base constructor for devices.

Note: In asymmetry to the destructor no action regarding the network segment's device maps is done here. This is already performed by LOW_netSegment.

Parameters:
inSegment  Reference to the network segment the device is on.
inDevID  Reference to device's ID.
inFamCode  Expected familiy code for the device.
Exceptions:
familyMismatch_error  Thrown when inFamCode and familiy code of inDevID don't match.

Definition at line 52 of file LOW_device.cpp.

References LOW_deviceIDRaw::devFamCode_t, LOW_deviceIDRaw::getFamilyCode(), ID, and netSegment.


Member Function Documentation

void LOW_device::cmd_MatchROM   const [protected, virtual]
 

Shortcut for issuing a matchROM command for a device.

Calls the corresponding method in LOW_netSegment.

Definition at line 102 of file LOW_device.cpp.

References LOW_netSegment::cmd_MatchROM(), and netSegment.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), LOW_devDS2405::cmd_Match(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal().

virtual std::string LOW_device::getFamilyName   const [inline, virtual]
 

Get the device's family name.

Note: Subclasses must implement this method to return a clear test name of their family.

Returns:
Family name of the device.

Reimplemented in LOW_devDS1820, LOW_devDS2405, and LOW_devDS2406.

Definition at line 158 of file LOW_device.h.

References familyName.

LOW_deviceID LOW_device::getID   const [virtual]
 

Get the device's ROM ID.

Returns:
ROM ID of the device.

Definition at line 73 of file LOW_device.cpp.

References ID.

Referenced by LOW_netSegment::buryDevice(), LOW_netSegment::cmd_MatchROM(), LOW_compJalousieController::LOW_compJalousieController(), LOW_netSegment::removeDevice(), and LOW_netSegment::revitalizeDevice().

LOW_link & LOW_device::getLink   const [protected, virtual]
 

Get the link the device is on.

Returns:
Link the device is on.

Definition at line 96 of file LOW_device.cpp.

References LOW_netSegment::getLink(), and netSegment.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), LOW_devDS2405::cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2405::cmd_SearchRead(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), LOW_devDS2406::cmd_ChannelAccess::readData(), LOW_devDS2406::cmd_ChannelAccess::readDataBit(), LOW_devDS2406::cmd_ChannelAccess::readDataByte(), LOW_devDS2406::readMemUniversal(), LOW_devDS2406::cmd_ChannelAccess::writeData(), and LOW_devDS2406::cmd_ChannelAccess::~cmd_ChannelAccess().

LOW_netSegment & LOW_device::getNetSegment   const [virtual]
 

Get the network segment the device is on.

Returns:
Nnetwork segment the device is on.

Definition at line 79 of file LOW_device.cpp.

References netSegment.

Referenced by LOW_compJalousieController::LOW_compJalousieController(), and LOW_compTwinSwitch::LOW_compTwinSwitch().

LOW_device* LOW_device::new_Instance LOW_netSegment   inNetSegment,
const LOW_deviceID   inDevID
[static, protected]
 

Static method for creating new concrete device objects.

This method is de-facto virtual as no implementation is given here and so it must be implemented individually by every subclass. The returned object must be dynamically allocated (i.e. it must be disposable by the delete operator).

Parameters:
inNetSegment  Reference to the network segment the device is on.
inDevID  Reference to the device's ID.
Returns:
The new dynamically created device instance.

Reimplemented in LOW_devDS1820, LOW_devDS2405, and LOW_devDS2406.

bool LOW_device::verifyDevice const bool    inOnlyAlarm = false,
const bool    inDoReset = true
const [virtual]
 

Shortcut method to verify the presence of the device on it's network segment.

See also:
LOW_netSegment::verifyDevice()

Definition at line 85 of file LOW_device.cpp.

References ID, netSegment, and LOW_netSegment::verifyDevice().

Referenced by LOW_compTwinSwitch::alarmPollLoop(), LOW_compTempSensor::checkAlarm(), LOW_devDS2405::cmd_SearchActive(), and LOW_devDS2405::cmd_SearchRead().


Friends And Related Function Documentation

friend class linkLock [friend]
 

Needed to grant access to the protected getLink() method.

Definition at line 174 of file LOW_device.h.

Referenced by LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), LOW_devDS2405::cmd_Match(), LOW_devDS2405::cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2405::cmd_SearchActive(), LOW_devDS2405::cmd_SearchRead(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal().


Member Data Documentation

const LOW_deviceIDRaw::devFamCode_t LOW_device::anyDev_famCode = 0xff [static]
 

Family code for selecting any/all device types.

Definition at line 73 of file LOW_device.h.

Referenced by LOW_netSegment::cmd_SearchROMVerify(), LOW_netSegment::getDevice(), LOW_netSegment::getDevices(), LOW_deviceFactory::registerSpecificCtor(), LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices().

const LOW_deviceIDRaw::devFamCode_t LOW_device::familyCode = anyDev_famCode [static]
 

Family code of this base class equals the one for any device type.

Note: Any subclass must override this constant.

Reimplemented in LOW_devDS1820, LOW_devDS2405, and LOW_devDS2406.

Definition at line 78 of file LOW_device.h.

const std::string LOW_device::familyName = "any" [static]
 

Family name of this base class.

Note: Any subclass must override this constant.

Reimplemented in LOW_devDS1820, LOW_devDS2405, and LOW_devDS2406.

Definition at line 27 of file LOW_device.cpp.

Referenced by getFamilyName().

const LOW_deviceID LOW_device::ID [protected]
 

1-Wire ROM ID of the device.

Definition at line 182 of file LOW_device.h.

Referenced by getID(), LOW_device(), and verifyDevice().

const owCommand_t LOW_device::MatchROM_COMMAND = 0x55 [static]
 

1-Wire command byte constant.

Definition at line 85 of file LOW_device.h.

Referenced by LOW_netSegment::cmd_MatchROM().

LOW_netSegment& LOW_device::netSegment [protected]
 

Network segment where the device is located.

Definition at line 183 of file LOW_device.h.

Referenced by cmd_MatchROM(), getLink(), getNetSegment(), LOW_device(), verifyDevice(), and ~LOW_device().

const owCommand_t LOW_device::ReadROM_COMMAND = 0x33 [static]
 

1-Wire command byte constant.

Definition at line 86 of file LOW_device.h.

Referenced by LOW_netSegment::cmd_ReadROM().

const owCommand_t LOW_device::SearchAlarmROM_COMMAND = 0xec [static]
 

1-Wire command byte constant.

Definition at line 89 of file LOW_device.h.

Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices().

const owCommand_t LOW_device::SearchROM_COMMAND = 0xf0 [static]
 

1-Wire command byte constant.

Definition at line 88 of file LOW_device.h.

Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices().

const owCommand_t LOW_device::SkipROM_COMMAND = 0xcc [static]
 

1-Wire command byte constant.

Definition at line 87 of file LOW_device.h.

Referenced by LOW_netSegment::cmd_SkipROM().


The documentation for this class was generated from the following files:
Generated on Mon Oct 27 22:56:28 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001