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

LOW_deviceID Class Reference

Class for immutable 1-Wire ROM IDs. More...

#include <LOW_deviceID.h>

Inheritance diagram for LOW_deviceID:

Inheritance graph
[legend]
Collaboration diagram for LOW_deviceID:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::vector< LOW_deviceIDdeviceIDVec_t
 Vector type of class LOW_deviceID.

typedef std::vector< LOW_deviceIDRawdeviceIDRawVec_t
 Vector type of class LOW_deviceIDRaw.

typedef uint8_t devRomID_t [8]
 Type of the whole 64 bit ID.

typedef uint8_t devCRC_t
 Type of 8 bit CRC checksum of the whole ID.

typedef uint8_t devSerNum_t [6]
 Type of device individual serial number.

typedef uint8_t devFamCode_t
 Type of device's family code.


Public Member Functions

 LOW_deviceID ()
 Default constructor.

 LOW_deviceID (const LOW_deviceID &inDeviceID)
 Copy constructor.

 LOW_deviceID (const devRomID_t &inRomID)
 Constructor from ROM ID as our own data type.

 LOW_deviceID (uint32_t inHighInt, uint32_t inLowInt)
 Constructor from two 32 bit values.

 LOW_deviceID (const byteVec_t &inRomID)
 Constructor from byte vector.

 LOW_deviceID (const LOW_deviceIDRaw &inDevIDRaw)
 Constructor from LOW_deviceIDRaw.

virtual ~LOW_deviceID ()
 Destructor.

virtual bool operator== (const LOW_deviceIDRaw &inDID) const
 Comparison on the whole 64 bits of ID.

virtual bool operator!= (const LOW_deviceIDRaw &inDID) const
 Comparison on the whole 64 bits of ID.

virtual bool operator< (const LOW_deviceIDRaw &inDID) const
 Comparison on the whole 64 bits of ID.

virtual void getRomID (devRomID_t &outID) const
 Get 64 bit ROM ID as our data type.

virtual byteVec_t getRomIDVec () const
 Get 64 bit ROM ID as byte vector.

virtual std::string getRomIDString () const
 Get 64 bit ROM ID as hex C++ string.

virtual devCRC_t getCRC () const
 Get 8 bit CRC.

virtual void getSerialNum (devSerNum_t &outSerNum) const
 Get 48 bit serial number.

virtual devFamCode_t getFamilyCode () const
 Get 8 bit family code.

virtual bool getBit (uint8_t inBitNum) const
 Get 1 bit from the ID.


Protected Attributes

devRomID_t romID
 The lasered ROM ID.


Private Member Functions

virtual void checkCRC ()
 Validate CRC checksum of the current ROM ID.

virtual void setBit (const uint8_t inBitNum, const bool inValue)
 Hidden method inherited from LOW_deviceIDRaw.

virtual void setFamilyCode (const devFamCode_t inFamCode)
 Hidden method inherited from LOW_deviceIDRaw.


Detailed Description

Class for immutable 1-Wire ROM IDs.

In contrast to LOW_deviceIDRaw this class prevents manipulation of the ID and a CRC validation is done on creation.

This class is thread-safe.

Author:
Harald Roelle

Definition at line 35 of file LOW_deviceID.h.


Member Typedef Documentation

typedef uint8_t LOW_deviceIDRaw::devCRC_t [inherited]
 

Type of 8 bit CRC checksum of the whole ID.

Definition at line 67 of file LOW_deviceIDRaw.h.

Referenced by LOW_deviceIDRaw::getCRC().

typedef uint8_t LOW_deviceIDRaw::devFamCode_t [inherited]
 

Type of device's family code.

Definition at line 69 of file LOW_deviceIDRaw.h.

Referenced by LOW_devUnknown::getFamilyCode(), LOW_deviceIDRaw::getFamilyCode(), LOW_device::getFamilyCode(), LOW_devDS2890::getFamilyCode(), LOW_devDS2406::getFamilyCode(), LOW_devDS2405::getFamilyCode(), LOW_devDS2401::getFamilyCode(), and LOW_devDS1820::getFamilyCode().

typedef std::vector<LOW_deviceIDRaw> LOW_deviceIDRaw::deviceIDRawVec_t [inherited]
 

Vector type of class LOW_deviceIDRaw.

Definition at line 64 of file LOW_deviceIDRaw.h.

typedef std::vector<LOW_deviceID> LOW_deviceID::deviceIDVec_t
 

Vector type of class LOW_deviceID.

Definition at line 45 of file LOW_deviceID.h.

Referenced by LOW_netSegment::cmd_SearchROM(), LOW_netSegment::cmd_SearchROMVerify(), LOW_netSegment::searchDevices(), LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices().

typedef uint8_t LOW_deviceIDRaw::devRomID_t[8] [inherited]
 

Type of the whole 64 bit ID.

Definition at line 66 of file LOW_deviceIDRaw.h.

Referenced by LOW_netSegment::cmd_ReadROM(), and LOW_linkDS2490::searchDevices().

typedef uint8_t LOW_deviceIDRaw::devSerNum_t[6] [inherited]
 

Type of device individual serial number.

Definition at line 68 of file LOW_deviceIDRaw.h.


Constructor & Destructor Documentation

LOW_deviceID::LOW_deviceID  ) 
 

Default constructor.

Definition at line 27 of file LOW_deviceID.cpp.

LOW_deviceID::LOW_deviceID const LOW_deviceID inDeviceID  ) 
 

Copy constructor.

Definition at line 32 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::LOW_deviceID const devRomID_t inRomID  ) 
 

Constructor from ROM ID as our own data type.

Parameters:
inRomID Reference to ROM ID.
Exceptions:
LOW_helper_CRC::crc_error Thrown when CRC validation fails.

Definition at line 38 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::LOW_deviceID uint32_t  inHighInt,
uint32_t  inLowInt
 

Constructor from two 32 bit values.

Parameters:
inHighInt Upper 32 bits of ROM ID.
inLowInt Lower 32 bits of ROM ID.
Exceptions:
LOW_helper_CRC::crc_error Thrown when CRC validation fails.

Definition at line 44 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::LOW_deviceID const byteVec_t inRomID  ) 
 

Constructor from byte vector.

Parameters:
inRomID Reference to byte vector of exactly 8 bytes.
Exceptions:
sizeMismatch_error Thrown when inRomID has other size than 8.
LOW_helper_CRC::crc_error Thrown when CRC validation fails.

Definition at line 50 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::LOW_deviceID const LOW_deviceIDRaw inDevIDRaw  ) 
 

Constructor from LOW_deviceIDRaw.

Parameters:
inDevIDRaw Reference to a raw ROM ID.
Exceptions:
LOW_helper_CRC::crc_error Thrown when CRC validation fails.

Definition at line 56 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::~LOW_deviceID  )  [virtual]
 

Destructor.

Definition at line 63 of file LOW_deviceID.cpp.


Member Function Documentation

void LOW_deviceID::checkCRC  )  [private, virtual]
 

Validate CRC checksum of the current ROM ID.

Returns silently when CRC is OK, else an exception is thrown.

Exceptions:
LOW_helper_CRC::crc_error Thrown when CRC validation fails.

Definition at line 73 of file LOW_deviceID.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, LOW_helper_CRC::calcCRC8(), and LOW_deviceIDRaw::romID.

Referenced by LOW_deviceID().

bool LOW_deviceIDRaw::getBit uint8_t  inBitNum  )  const [virtual, inherited]
 

Get 1 bit from the ID.

Parameters:
inBitNum Number of the bit to get (0-63).
Returns:
Value of requested bit.
Exceptions:
range_error Thrown when inBitNum is out of range.

Definition at line 190 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

Referenced by LOW_linkDS2480B::doSearchSequence(), LOW_link::doSearchSequence(), and LOW_link::searchDevices().

LOW_deviceIDRaw::devCRC_t LOW_deviceIDRaw::getCRC  )  const [virtual, inherited]
 

Get 8 bit CRC.

Returns:
The ID's CRC part.

Definition at line 157 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, LOW_deviceIDRaw::devCRC_t, and LOW_deviceIDRaw::romID.

LOW_deviceIDRaw::devFamCode_t LOW_deviceIDRaw::getFamilyCode  )  const [virtual, inherited]
 

Get 8 bit family code.

Returns:
The ID's family code part.

Definition at line 174 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, LOW_deviceIDRaw::devFamCode_t, and LOW_deviceIDRaw::romID.

Referenced by LOW_netSegment::getDevice(), LOW_device::LOW_device(), LOW_deviceFactory::new_SpecificDevice(), LOW_linkDS2490::searchDevices(), and LOW_link::searchDevices().

void LOW_deviceIDRaw::getRomID devRomID_t outID  )  const [virtual, inherited]
 

Get 64 bit ROM ID as our data type.

Parameters:
outID Reference where ID is written to.

Definition at line 118 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

std::string LOW_deviceIDRaw::getRomIDString  )  const [virtual, inherited]
 

Get 64 bit ROM ID as hex C++ string.

Returns:
The ROM ID as hex string.

Definition at line 140 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

byteVec_t LOW_deviceIDRaw::getRomIDVec  )  const [virtual, inherited]
 

Get 64 bit ROM ID as byte vector.

Returns:
The ROM ID as byte vector.

Definition at line 127 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, byteVec_t, and LOW_deviceIDRaw::romID.

Referenced by LOW_netSegment::cmd_MatchROM(), and LOW_linkDS2490::searchDevices().

void LOW_deviceIDRaw::getSerialNum devSerNum_t outSerNum  )  const [virtual, inherited]
 

Get 48 bit serial number.

Parameters:
outSerNum Reference where rhe ID's serial number part is written to.

Definition at line 165 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

bool LOW_deviceIDRaw::operator!= const LOW_deviceIDRaw inDID  )  const [virtual, inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 92 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

bool LOW_deviceIDRaw::operator< const LOW_deviceIDRaw inDID  )  const [virtual, inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 99 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

bool LOW_deviceIDRaw::operator== const LOW_deviceIDRaw inDID  )  const [virtual, inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 82 of file LOW_deviceIDRaw.cpp.

References __LOW_SYNCHRONIZE_METHOD_READ__, and LOW_deviceIDRaw::romID.

void LOW_deviceID::setBit const uint8_t  inBitNum,
const bool  inValue
[private, virtual]
 

Hidden method inherited from LOW_deviceIDRaw.

Declared as private to prevent changes to ROM ID.

Reimplemented from LOW_deviceIDRaw.

Definition at line 82 of file LOW_deviceID.cpp.

void LOW_deviceID::setFamilyCode const devFamCode_t  inFamCode  )  [private, virtual]
 

Hidden method inherited from LOW_deviceIDRaw.

Declared as private to prevent changes to ROM ID.

Reimplemented from LOW_deviceIDRaw.

Definition at line 87 of file LOW_deviceID.cpp.


Member Data Documentation

devRomID_t LOW_deviceIDRaw::romID [protected, inherited]
 

The lasered ROM ID.

Definition at line 180 of file LOW_deviceIDRaw.h.

Referenced by checkCRC(), LOW_deviceIDRaw::getBit(), LOW_deviceIDRaw::getCRC(), LOW_deviceIDRaw::getFamilyCode(), LOW_deviceIDRaw::getRomID(), LOW_deviceIDRaw::getRomIDString(), LOW_deviceIDRaw::getRomIDVec(), LOW_deviceIDRaw::getSerialNum(), LOW_deviceIDRaw::LOW_deviceIDRaw(), LOW_deviceIDRaw::operator!=(), LOW_deviceIDRaw::operator<(), LOW_deviceIDRaw::operator==(), LOW_deviceIDRaw::setBit(), and LOW_deviceIDRaw::setFamilyCode().


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 11:30:55 2004 for OneWireLibrary++ by doxygen 1.3.2