Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #define LIBSMBIOS_SOURCE
00021 #include "smbios/compat.h"
00022
00023 #include <sstream>
00024 #include <iomanip>
00025 #include <string.h>
00026
00027 #include "TokenImpl.h"
00028
00029 using namespace std;
00030
00031 namespace smbios
00032 {
00033 CmosTokenD6::CmosTokenD6( const smbios::ISmbiosItem &initItem, std::vector< CmosRWChecksumObserver > &initChecksumList)
00034 : CmosTokenD5(initItem, initChecksumList)
00035 {
00036 size_t size;
00037 const u8 *ptr = item->getBufferCopy(size) ;
00038 size = size < sizeof(structure)? size : sizeof(structure);
00039 memcpy( const_cast<dell_protected_value_2_structure*>(&structure), ptr, size );
00040
00041
00042 size = size < sizeof(CmosTokenD5::structure)? size : sizeof(CmosTokenD5::structure);
00043 memcpy(
00044 const_cast<dell_protected_value_1_structure*>(&(CmosTokenD5::structure)),
00045 ptr,
00046 sizeof(CmosTokenD5::structure) );
00047
00048 delete [] const_cast<u8 *>(ptr);
00049 }
00050
00051 string CmosTokenD6::getTokenClass() const
00052 {
00053 return "TokenD6";
00054 }
00055
00056 void CmosTokenD6::addChecksumObserver() const
00057 {
00058
00059 CmosTokenD5::addChecksumObserver();
00060
00061
00062
00063 ostringstream ost;
00064 ost << *item;
00065
00066 CmosRWChecksumObserver chk(
00067 ost.str(),
00068 cmos,
00069 structure.rangeCheckType,
00070 structure.indexPort,
00071 structure.dataPort,
00072 structure.rangeCheckStart,
00073 structure.rangeCheckEnd,
00074 structure.rangeCheckIndex );
00075
00076 checksumList.push_back( chk );
00077 }
00078 }