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

LOW_device.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           LOW_device.cpp  -  description
00003                              -------------------
00004     begin                : Sat Jul 6 2002
00005     copyright            : (C) 2002 by Harald Roelle
00006     email                : roelle@informatik.uni-muenchen.de
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  
00019 #include "LOW_device.h"
00020 #include "LOW_netSegment.h"
00021 
00022 //=====================================================================================
00023 //
00024 // static constant init
00025 //
00026 
00027 const std::string LOW_device::familyName = "any";
00028 
00029 
00030 
00031 //=====================================================================================
00032 //
00033 // classes
00034 //
00035   
00036 LOW_device::linkLock::linkLock( const LOW_device &inDev) : LOW_link::commLock( inDev.getLink())
00037 {
00038 }
00039 
00040 
00041 LOW_device::linkLock::~linkLock()
00042 {
00043 }
00044 
00045     
00046   
00047 //=====================================================================================
00048 //
00049 // constructors
00050 //
00051 
00052 LOW_device::LOW_device( LOW_netSegment &inSegment, const LOW_deviceID &inDevID,
00053                         const LOW_deviceIDRaw::devFamCode_t inFamCode) :
00054   ID( inDevID),
00055   netSegment( inSegment)
00056 {
00057   if ( ID.getFamilyCode() != inFamCode)
00058     throw familyMismatch_error( "Family code mismatch", __FILE__, __LINE__);
00059 }
00060 
00061 
00062 LOW_device::~LOW_device()
00063 {
00064   netSegment.unregisterDevice( this);
00065 }
00066 
00067 
00068 //=====================================================================================
00069 //
00070 // public methods
00071 //
00072 
00073 LOW_deviceID LOW_device::getID() const
00074 {
00075   return ID;
00076 }
00077 
00078 
00079 LOW_netSegment& LOW_device::getNetSegment() const
00080 {
00081   return netSegment;
00082 }
00083 
00084 
00085 bool LOW_device::verifyDevice( const bool inOnlyAlarm, const bool inDoReset) const
00086 {
00087   return netSegment.verifyDevice( ID, inOnlyAlarm, inDoReset);
00088 }
00089 
00090 
00091 //=====================================================================================
00092 //
00093 // protected methods
00094 //
00095 
00096 LOW_link& LOW_device::getLink() const
00097 {
00098   return netSegment.getLink();
00099 }
00100 
00101 
00102 void LOW_device::cmd_MatchROM() const
00103 {
00104   netSegment.cmd_MatchROM( this);
00105 }

Generated on Tue Feb 3 11:30:25 2004 for OneWireLibrary++ by doxygen 1.3.2