Maxim Integrated / Mbed 2 deprecated DeepCover Embedded Security in IoT

Dependencies:   MaximInterface mbed

Files at this revision

API Documentation at this revision

Comitter:
IanBenzMaxim
Date:
Tue Apr 19 10:08:27 2016 -0500
Parent:
1:e1c7c1c636af
Child:
3:ac723be395d9
Commit message:
Updated following improvements to DS28E15/22/25 in OneWire library.

Changed in this revision

Factory.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Factory.cpp	Thu Apr 14 19:48:01 2016 +0000
+++ b/Factory.cpp	Tue Apr 19 10:08:27 2016 -0500
@@ -139,13 +139,13 @@
   {
     DS28E15_22_25::Segment blankSegment;
     std::memset(blankSegment, SensorNode::defaultPaddingByte, blankSegment.length);
-    for (std::size_t i = 0; i < (DS28E15_22_25::Page::length / DS28E15_22_25::Segment::length); i++)
+    for (std::size_t i = 0; i < DS28E15_22_25::segmentsPerPage; i++)
     {
       result = (sensorNode.ds2465.OWSkipROM() == OneWireMaster::Success);
       if (result)
         result = (sensorNode.ds28e15_22_25.writeAuthSegment(sensorNode.ds2465, sensorNode.authData.pageNum, i,
                                                             ((i == sensorNode.authData.segmentNum) ? sensorNode.authData.segment : blankSegment),
-                                                            reinterpret_cast<const DS28E15_22_25::Segment::Buffer &>(static_cast<const DS28E15_22_25::Page::Buffer &>(pageData)[i * sizeof(DS28E15_22_25::Segment::Buffer)]), false) == OneWireSlave::Success);
+                                                            pageData.toSegment(i), false) == OneWireSlave::Success);
       
       if (!result)
         break;