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

LOW_devDS2405 Class Reference

Device class for DS2405 Addressable Switch. More...

#include <LOW_devDS2405.h>

Inheritance diagram for LOW_devDS2405:

Inheritance graph
[legend]
Collaboration diagram for LOW_devDS2405:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< LOW_devDS2405 *> devDS2405PtrVec_t
 Vector type of class device pointers. More...

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

 class_DERIVE_FROM_EXCEPTION (devDS2405_error, LOW_exception)
 Exception base class for all exceptions thrown by LOW_devDS2405. More...

 LOW_devDS2405 (LOW_netSegment &inSegment, const LOW_deviceID &inDevID)
 Real constructor corresponding to static pseudo constructor new_Instance(). More...

virtual ~LOW_devDS2405 ()
 Destructor. More...

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

virtual void cmd_Match () const
 Toggle the state of the PIO pin. More...

virtual bool cmd_MatchRead () const
 Toggle the state of the PIO pin and read its new state. More...

virtual bool cmd_SearchRead () const
 Read the logic state of the PIO pin (input). More...

virtual bool cmd_SearchActive () const
 Read if the output pulldown is turned on. 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 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 familyCode = 0x05
 Family code of this specific device. More...

const std::string familyName = "DS2405"
 Family name of this specific device. More...

const LOW_deviceIDRaw::devFamCode_t anyDev_famCode = 0xff
 Family code for selecting any/all device types. 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

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_devicenew_Instance (LOW_netSegment &inNetSegment, const LOW_deviceID &inDevID)
 Static pseudo constructor for registering with LOW_deviceFactory. 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...


Static Private Methods

int initialize ()
 Static inizializer to register the class with LOW_deviceFactory. More...


Static Private Attributes

int initHelper = initialize()
 Needed for dirty little C++ hack to force static initialization on application start. More...


Friends

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


Detailed Description

Device class for DS2405 Addressable Switch.

DS2405 features:

This class is thread-safe.

Author:
Harald Roelle , Parts of the documentation by Dallas Semiconductors / Maxim Integrated Products

Definition at line 54 of file LOW_devDS2405.h.


Member Typedef Documentation

typedef std::vector<LOW_devDS2405*> LOW_devDS2405::devDS2405PtrVec_t
 

Vector type of class device pointers.

Definition at line 86 of file LOW_devDS2405.h.

typedef std::map<LOW_deviceID,LOW_device*> LOW_device::deviceMap_t [inherited]
 

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 [inherited]
 

Vector type of class device pointers.

Definition at line 97 of file LOW_device.h.

Referenced by LOW_netSegment::searchDevices().


Constructor & Destructor Documentation

LOW_devDS2405::LOW_devDS2405 LOW_netSegment   inSegment,
const LOW_deviceID   inDevID
 

Real constructor corresponding to static pseudo constructor new_Instance().

Parameters:
inSegment  Reference to network segment the device is on.
inDevID  Reference to device's ID.

Definition at line 60 of file LOW_devDS2405.cpp.

Referenced by new_Instance().

LOW_devDS2405::~LOW_devDS2405   [virtual]
 

Destructor.

Definition at line 66 of file LOW_devDS2405.cpp.


Member Function Documentation

LOW_devDS2405::class_DERIVE_FROM_EXCEPTION devDS2405_error   ,
LOW_exception   
 

Exception base class for all exceptions thrown by LOW_devDS2405.

void LOW_devDS2405::cmd_Match   const [virtual]
 

Toggle the state of the PIO pin.

Definition at line 76 of file LOW_devDS2405.cpp.

References LOW_device::cmd_MatchROM(), and LOW_device::linkLock.

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

bool LOW_devDS2405::cmd_MatchRead   const [virtual]
 

Toggle the state of the PIO pin and read its new state.

Note: The return value is inverted compared to cmd_SearchActive().

Returns:
false, if the device IS driving the PIO pin low. true, if the device is NOT driving the PIO pin low.

Definition at line 84 of file LOW_devDS2405.cpp.

References cmd_Match(), LOW_device::getLink(), LOW_device::linkLock, and LOW_link::readDataBit().

Referenced by LOW_compJalousieController::setDirectionDown(), LOW_compJalousieController::setDirectionUp(), LOW_compJalousieController::setPowerOff(), and LOW_compJalousieController::setPowerOn().

void LOW_device::cmd_MatchROM   const [protected, virtual, inherited]
 

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 LOW_device::netSegment.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), 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().

bool LOW_devDS2405::cmd_SearchActive   const [virtual]
 

Read if the output pulldown is turned on.

The device will not toggle the state of its PIO pin.

Note: The return value is inverted compared to cmd_MatchActive().

Returns:
false, if the device is NOT driving the PIO pin low. true, if the device IS driving the PIO pin low.

Definition at line 102 of file LOW_devDS2405.cpp.

References LOW_device::linkLock, and LOW_device::verifyDevice().

Referenced by LOW_compJalousieController::LOW_compJalousieController().

bool LOW_devDS2405::cmd_SearchRead   const [virtual]
 

Read the logic state of the PIO pin (input).

The device will not toggle the state of its PIO pin. The combination of Match ROM and Search ROM allows the user to change the state of the PIO pin and report the current state (Match ROM) or simply report the current state of the PIO pin without changing it (Search ROM).

Returns:
false, if the pulldown is on, or the pulldown is off and the PIO pin is a logical 0.
true, if the pulldown is off and the PIO pin is a logical 1 (i.e. external pullup).

Definition at line 93 of file LOW_devDS2405.cpp.

References LOW_device::getLink(), LOW_device::linkLock, LOW_link::readDataBit(), and LOW_device::verifyDevice().

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

Get the device's family name.

Returns:
Family name of the device.

Reimplemented from LOW_device.

Definition at line 113 of file LOW_devDS2405.h.

References familyName, and initHelper.

LOW_deviceID LOW_device::getID   const [virtual, inherited]
 

Get the device's ROM ID.

Returns:
ROM ID of the device.

Definition at line 73 of file LOW_device.cpp.

References LOW_device::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, inherited]
 

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 LOW_device::netSegment.

Referenced by LOW_devDS2406::cmd_ChannelAccess::cmd_ChannelAccess(), LOW_devDS1820::cmd_ConvertT(), LOW_devDS1820::cmd_CopyScratchpad(), cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), 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, inherited]
 

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 LOW_device::netSegment.

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

int LOW_devDS2405::initialize   [static, private]
 

Static inizializer to register the class with LOW_deviceFactory.

See also:
initHelper

Definition at line 35 of file LOW_devDS2405.cpp.

References familyCode, new_Instance(), and LOW_deviceFactory::registerSpecificCtor().

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

Static pseudo constructor for registering with LOW_deviceFactory.

Parameters:
inSegment  Reference to network segment the device is on.
inDevID  Reference to device's ID.
Returns:
New dynamic instance of specific device class.

Reimplemented from LOW_device.

Definition at line 48 of file LOW_devDS2405.cpp.

References LOW_devDS2405().

Referenced by initialize().

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

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 LOW_device::ID, LOW_device::netSegment, and LOW_netSegment::verifyDevice().

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


Friends And Related Function Documentation

friend class linkLock [friend, inherited]
 

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(), cmd_Match(), cmd_MatchRead(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), cmd_SearchActive(), 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, inherited]
 

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_devDS2405::familyCode = 0x05 [static]
 

Family code of this specific device.

Reimplemented from LOW_device.

Definition at line 75 of file LOW_devDS2405.h.

Referenced by initialize().

const std::string LOW_devDS2405::familyName = "DS2405" [static]
 

Family name of this specific device.

Reimplemented from LOW_device.

Definition at line 32 of file LOW_devDS2405.cpp.

Referenced by getFamilyName().

const LOW_deviceID LOW_device::ID [protected, inherited]
 

1-Wire ROM ID of the device.

Definition at line 182 of file LOW_device.h.

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

int LOW_devDS2405::initHelper = initialize() [static, private]
 

Needed for dirty little C++ hack to force static initialization on application start.

See also:
initialize()

Definition at line 34 of file LOW_devDS2405.cpp.

Referenced by getFamilyName().

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

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, inherited]
 

Network segment where the device is located.

Definition at line 183 of file LOW_device.h.

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

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

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, inherited]
 

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, inherited]
 

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, inherited]
 

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:27 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001