Implementation of 1-Wire with added Alarm Search Functionality
Dependents: Max32630_One_Wire_Interface
Diff: Authenticators/DS28E15_22_25/DS28E15_22_25.cpp
- Revision:
- 82:c11090a32471
- Parent:
- 79:7f22823a5a2d
--- a/Authenticators/DS28E15_22_25/DS28E15_22_25.cpp Fri Jun 03 22:15:59 2016 +0000 +++ b/Authenticators/DS28E15_22_25/DS28E15_22_25.cpp Mon Jun 06 09:55:33 2016 -0500 @@ -140,16 +140,16 @@ } DS28E15_22_25::DS28E15_22_25(RandomAccessRomIterator & selector, bool lowVoltage) - : OneWireSlave(selector), lowVoltage(lowVoltage) + : OneWireSlave(selector), m_lowVoltage(lowVoltage) { - std::memset(manId, 0x00, manId.length); + std::memset(m_manId, 0x00, m_manId.length); } DS28E15_22_25::MemoryPages DS28E15_22_25::memoryPages() { MemoryPages pages; - switch (romId.familyCode()) + switch (romId().familyCode()) { case DS28E25_Family: pages = DS28E25_Pages; @@ -175,7 +175,7 @@ { ProtectionBlocks blocks; - switch (romId.familyCode()) + switch (romId().familyCode()) { case DS28E25_Family: blocks = DS28E25_Blocks; @@ -233,7 +233,7 @@ } ISha256MacCoproc::CmdResult result; - result = computeProtectionWriteMac(MacCoproc, newProtection, oldProtection, romId, manId, mac); + result = computeProtectionWriteMac(MacCoproc, newProtection, oldProtection, romId(), manId(), mac); if (result != ISha256MacCoproc::Success) { return OperationFailure; @@ -394,7 +394,7 @@ { // Convert to page number for DS28E22 and DS28E25 buf[cnt] = blockNum; - if ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family)) + if ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family)) { buf[cnt] *= ds28e22_25_pagesPerBlock; } @@ -416,7 +416,7 @@ { rdnum = 1; } - else if ((romId.familyCode() == DS28E22_Family) || (romId.familyCode() == DS28E25_Family)) + else if ((romId().familyCode() == DS28E22_Family) || (romId().familyCode() == DS28E25_Family)) { rdnum = DS28E25_Pages; // Need to read extra data on DS28E22 to get CRC16. } @@ -447,9 +447,9 @@ // copy the data to the read buffer rdnum -= crcLen; - if (allpages && ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family))) + if (allpages && ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family))) { - if (romId.familyCode() == DS28E22_Family) + if (romId().familyCode() == DS28E22_Family) { rdnum -= (DS28E25_Pages - DS28E22_Pages); } @@ -605,7 +605,7 @@ } buf[cnt++] = ReadWriteScratchpad; - if ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family)) + if ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family)) { buf[cnt++] = 0x20; } @@ -660,7 +660,7 @@ } buf[cnt++] = ReadWriteScratchpad; - if ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family)) + if ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family)) { buf[cnt++] = 0x2F; } @@ -867,7 +867,7 @@ uint16_t CRC16 = 0; // DS28E25/DS28E22, crc gets calculagted with CS byte - if ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family)) + if ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family)) { if (continuing) { @@ -1039,7 +1039,7 @@ uint16_t CRC16 = 0; // DS28E25/DS28E22, crc gets calculagted with CS byte - if ((romId.familyCode() == DS28E25_Family) || (romId.familyCode() == DS28E22_Family)) + if ((romId().familyCode() == DS28E25_Family) || (romId().familyCode() == DS28E22_Family)) { if (continuing) CRC16 = calculateCrc16(CRC16, 0xAA); @@ -1055,7 +1055,7 @@ // compute the mac ISha256MacCoproc::CmdResult result; Mac mac; - result = computeSegmentWriteMac(MacCoproc, pageNum, segmentNum, newData, oldData, romId, manId, mac); + result = computeSegmentWriteMac(MacCoproc, pageNum, segmentNum, newData, oldData, romId(), manId(), mac); if (result != ISha256MacCoproc::Success) { return OperationFailure;