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_deviceID > deviceIDVec_t
 Vector type of class LOW_deviceID. More...

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

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

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

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

typedef uint8_t devFamCode_t
 Type of device's family code. More...


Public Methods

 LOW_deviceID ()
 Default constructor. More...

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

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

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

 LOW_deviceID (const LOW_deviceIDRaw &inDevIDRaw)
 Constructor from LOW_deviceIDRaw. More...

 ~LOW_deviceID ()
 Destructor. More...

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

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

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

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

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

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

devCRC_t getCRC () const
 Get 8 bit CRC. More...

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

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

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


Protected Attributes

devRomID_t romID
 The lasered ROM ID. More...


Private Methods

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

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

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


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.

Author:
Harald Roelle, Helmut Reiser

Definition at line 33 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 64 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 66 of file LOW_deviceIDRaw.h.

Referenced by LOW_netSegment::cmd_SearchROM(), LOW_deviceIDRaw::getFamilyCode(), LOW_device::LOW_device(), and LOW_deviceFactory::registerSpecificCtor().

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

Vector type of class LOW_deviceIDRaw.

Definition at line 61 of file LOW_deviceIDRaw.h.

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

Vector type of class LOW_deviceID.

Definition at line 43 of file LOW_deviceID.h.

Referenced by LOW_netSegment::cmd_SearchROM(), and LOW_netSegment::searchDevices().

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

Type of the whole 64 bit ID.

Definition at line 63 of file LOW_deviceIDRaw.h.

Referenced by LOW_netSegment::cmd_ReadROM().

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

Type of device individual serial number.

Definition at line 65 of file LOW_deviceIDRaw.h.

Referenced by LOW_IPCKeyGenerator_SysV::getSemSetKey().


Constructor & Destructor Documentation

LOW_deviceID::LOW_deviceID  
 

Default constructor.

Definition at line 27 of file LOW_deviceID.cpp.

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 32 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 38 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 44 of file LOW_deviceID.cpp.

References byteVec_t, and 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 50 of file LOW_deviceID.cpp.

References checkCRC().

LOW_deviceID::~LOW_deviceID  
 

Destructor.

Definition at line 57 of file LOW_deviceID.cpp.


Member Function Documentation

void LOW_deviceID::checkCRC   [private]
 

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 67 of file LOW_deviceID.cpp.

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

Referenced by LOW_deviceID().

bool LOW_deviceIDRaw::getBit uint8_t    inBitNum const [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 163 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

Referenced by LOW_netSegment::cmd_SearchROM(), LOW_linkPassiveSerial::doSearchSequence(), and LOW_linkDS2480B::doSearchSequence().

LOW_deviceIDRaw::devCRC_t LOW_deviceIDRaw::getCRC   const [inherited]
 

Get 8 bit CRC.

Returns:
The ID's CRC part.

Definition at line 138 of file LOW_deviceIDRaw.cpp.

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

LOW_deviceIDRaw::devFamCode_t LOW_deviceIDRaw::getFamilyCode   const [inherited]
 

Get 8 bit family code.

Returns:
The ID's family code part.

Definition at line 151 of file LOW_deviceIDRaw.cpp.

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

Referenced by LOW_netSegment::cmd_SearchROM(), LOW_netSegment::getDevice(), LOW_device::LOW_device(), and LOW_deviceFactory::new_SpecificDevice().

void LOW_deviceIDRaw::getRomID devRomID_t   outID const [inherited]
 

Get 64 bit ROM ID as our data type.

Parameters:
outID  Reference where ID is written to.

Definition at line 105 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

std::string LOW_deviceIDRaw::getRomIDString   const [inherited]
 

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

Returns:
The ROM ID as hex string.

Definition at line 123 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

byteVec_t LOW_deviceIDRaw::getRomIDVec   const [inherited]
 

Get 64 bit ROM ID as byte vector.

Returns:
The ROM ID as byte vector.

Definition at line 112 of file LOW_deviceIDRaw.cpp.

References byteVec_t, and LOW_deviceIDRaw::romID.

Referenced by LOW_netSegment::cmd_MatchROM().

void LOW_deviceIDRaw::getSerialNum devSerNum_t   outSerNum const [inherited]
 

Get 48 bit serial number.

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

Definition at line 144 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

Referenced by LOW_IPCKeyGenerator_SysV::getSemSetKey().

bool LOW_deviceIDRaw::operator!= const LOW_deviceIDRaw   inDID const [inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 83 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

bool LOW_deviceIDRaw::operator< const LOW_deviceIDRaw   inDID const [inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 88 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

bool LOW_deviceIDRaw::operator== const LOW_deviceIDRaw   inDID const [inherited]
 

Comparison on the whole 64 bits of ID.

Definition at line 75 of file LOW_deviceIDRaw.cpp.

References LOW_deviceIDRaw::romID.

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

Hidden method inherited from LOW_deviceIDRaw.

Declared as private to prevent changes to ROM ID.

Reimplemented from LOW_deviceIDRaw.

void LOW_deviceID::setFamilyCode const devFamCode_t    inFamCode [private]
 

Hidden method inherited from LOW_deviceIDRaw.

Declared as private to prevent changes to ROM ID.

Reimplemented from LOW_deviceIDRaw.


Member Data Documentation

devRomID_t LOW_deviceIDRaw::romID [protected, inherited]
 

The lasered ROM ID.

Definition at line 174 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 Sun Jan 12 21:07:55 2003 by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001