#include <LOW_device.h>
Inheritance diagram for LOW_device:
Public Types | |
typedef std::vector< LOW_device * > | devPtrVec_t |
Vector type of class device pointers. | |
typedef std::map< LOW_deviceID, LOW_device * > | deviceMap_t |
Map type of devices with LOW_deviceID as key. | |
Public Member Functions | |
virtual | ~LOW_device () |
Destructor. | |
virtual const LOW_deviceIDRaw::devFamCode_t | getFamilyCode () const |
Get the device's family code. | |
virtual const std::string | getFamilyName () const |
Get the device's family name. | |
virtual LOW_deviceID | getID () const |
Get the device's ROM ID. | |
virtual LOW_netSegment & | getNetSegment () const |
Get the network segment the device is on. | |
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. | |
Static Public Attributes | |
const LOW_deviceIDRaw::devFamCode_t | anyDev_famCode = 0x00 |
Pseudo family code for selecting any/all device types. | |
const LOW_deviceIDRaw::devFamCode_t | unknownDev_famCode = 0xff |
Pseudo family code for unknown device types. | |
const LOW_deviceIDRaw::devFamCode_t | familyCode = anyDev_famCode |
Family code of this base class equals the one for any device type. | |
const std::string | familyName = "any" |
Family name of this base class. | |
const owCommand_t | MatchROM_COMMAND = 0x55 |
1-Wire command byte constant | |
const owCommand_t | ReadROM_COMMAND = 0x33 |
1-Wire command byte constant | |
const owCommand_t | SkipROM_COMMAND = 0xcc |
1-Wire command byte constant | |
const owCommand_t | SearchROM_COMMAND = 0xf0 |
1-Wire command byte constant | |
const owCommand_t | SearchAlarmROM_COMMAND = 0xec |
1-Wire command byte constant | |
Protected Member Functions | |
LOW_device (LOW_netSegment &inSegment, const LOW_deviceID &inDevID, const LOW_deviceIDRaw::devFamCode_t inFamCode) | |
Base constructor for devices. | |
virtual LOW_link & | getLink () const |
Get the link the device is on. | |
virtual void | cmd_MatchROM () const |
Shortcut for issuing a matchROM command for a device. | |
Static Protected Member Functions | |
LOW_device * | new_Instance (LOW_netSegment &inNetSegment, const LOW_deviceID &inDevID) |
Static method for creating new concrete device objects. | |
Protected Attributes | |
const LOW_deviceID | ID |
1-Wire ROM ID of the device | |
LOW_netSegment & | netSegment |
Network segment where the device is located. | |
Friends | |
class | linkLock |
Needed to grant access to the protected getLink() method. |
Any device class representing a concrete 1-Wire device must inherit from this class.
This class is thread-safe.
Definition at line 40 of file LOW_device.h.
|
Map type of devices with LOW_deviceID as key.
Definition at line 101 of file LOW_device.h. |
|
Vector type of class device pointers.
Definition at line 100 of file LOW_device.h. Referenced by LOW_netSegment::searchDevices(). |
|
Destructor. Deregisters the device from its LOW_netSegment. Definition at line 62 of file LOW_device.cpp. References netSegment, and LOW_netSegment::unregisterDevice(). |
|
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.
Definition at line 52 of file LOW_device.cpp. References LOW_deviceIDRaw::getFamilyCode(), ID, and netSegment. |
|
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_devDS2890::cmd_Decrement(), LOW_devDS2890::cmd_Increment(), LOW_devDS2405::cmd_Match(), LOW_devDS2890::cmd_ReadControlRegister(), LOW_devDS2890::cmd_ReadPosition(), LOW_devDS1820::cmd_ReadPowerSupply(), LOW_devDS1820::cmd_ReadScratchpad(), LOW_devDS1820::cmd_RecallE2(), LOW_devDS2890::cmd_WriteControlRegister(), LOW_devDS2890::cmd_WritePosition(), LOW_devDS1820::cmd_WriteScratchpad(), LOW_devDS2406::cmd_WriteStatus(), and LOW_devDS2406::readMemUniversal(). |
|
Get the device's family code. Note: Subclasses must implement this method to return their specific family code.
Reimplemented in LOW_devDS1820, LOW_devDS2401, LOW_devDS2405, LOW_devDS2406, LOW_devDS2890, and LOW_devUnknown. Definition at line 150 of file LOW_device.h. References LOW_deviceIDRaw::devFamCode_t, and familyCode. |
|
Get the device's family name. Note: Subclasses must implement this method to return a clear text name of their family.
Reimplemented in LOW_devDS1820, LOW_devDS2401, LOW_devDS2405, LOW_devDS2406, LOW_devDS2890, and LOW_devUnknown. Definition at line 157 of file LOW_device.h. References familyName. |
|
Get the device's ROM ID.
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(). |
|
|
Get the network 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(). |
|
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).
Reimplemented in LOW_devDS1820, LOW_devDS2401, LOW_devDS2405, LOW_devDS2406, LOW_devDS2890, and LOW_devUnknown. |
|
Shortcut method to verify the presence of the device on it's network segment.
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(). |
|
|
Pseudo 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(). |
|
Family code of this base class equals the one for any device type. Note: Subclasses must override this constant to return their specific family code. Reimplemented in LOW_devDS1820, LOW_devDS2401, LOW_devDS2405, LOW_devDS2406, LOW_devDS2890, and LOW_devUnknown. Definition at line 81 of file LOW_device.h. Referenced by getFamilyCode(). |
|
Family name of this base class. Note: Subclasses must override this constant to return their specific family name. Reimplemented in LOW_devDS1820, LOW_devDS2401, LOW_devDS2405, LOW_devDS2406, LOW_devDS2890, and LOW_devUnknown. Definition at line 27 of file LOW_device.cpp. Referenced by getFamilyName(). |
|
1-Wire ROM ID of the device
Definition at line 192 of file LOW_device.h. Referenced by getID(), LOW_device(), and verifyDevice(). |
|
1-Wire command byte constant
Definition at line 88 of file LOW_device.h. Referenced by LOW_netSegment::cmd_MatchROM(). |
|
Network segment where the device is located.
Definition at line 193 of file LOW_device.h. Referenced by cmd_MatchROM(), getLink(), getNetSegment(), LOW_device(), verifyDevice(), and ~LOW_device(). |
|
1-Wire command byte constant
Definition at line 89 of file LOW_device.h. Referenced by LOW_netSegment::cmd_ReadROM(). |
|
1-Wire command byte constant
Definition at line 92 of file LOW_device.h. Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices(). |
|
1-Wire command byte constant
Definition at line 91 of file LOW_device.h. Referenced by LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices(). |
|
1-Wire command byte constant
Definition at line 90 of file LOW_device.h. Referenced by LOW_netSegment::cmd_SkipROM(). |
|
Pseudo family code for unknown device types.
Definition at line 76 of file LOW_device.h. Referenced by LOW_netSegment::getDevice(), LOW_netSegment::getDevices(), and LOW_deviceFactory::registerSpecificCtor(). |