Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MaximInterface mbed
Diff: SensorNode.hpp
- Revision:
- 6:b6bafd0a7013
- Parent:
- 1:e1c7c1c636af
- Child:
- 8:594529956266
diff -r 63232ef22abe -r b6bafd0a7013 SensorNode.hpp
--- a/SensorNode.hpp Wed Apr 20 20:13:33 2016 +0000
+++ b/SensorNode.hpp Thu May 12 14:40:14 2016 -0500
@@ -34,16 +34,19 @@
#ifndef _SENSORNODE_HPP
#define _SENSORNODE_HPP
-#include <cstdint>
+#include <stdint.h>
#include <cstring>
#include "DS7505.hpp"
#include "MAX44009.hpp"
-#include "OneWire_Memory/Authenticators/DS28E15_22_25/DS28E15_22_25.hpp"
+#include "Authenticators/DS28E15_22_25/DS28E15_22_25.h"
-class DS2465;
-class RomId;
class SensorData;
+namespace OneWire
+{
+ class RomId;
+ namespace Masters { class DS2465; }
+}
namespace mbed { class I2C; }
/// Interface to the Authenticated Sensor Node peripheral board.
@@ -62,7 +65,7 @@
/// @param ds7505_i2c_addr I2C bus address of the DS7505 in mbed format.
/// @param max44009_i2c_addr I2C bus address of the MAX44009 in mbed format.
/// @param ds2465 Interface to DS2465 on the Controller.
- SensorNode(mbed::I2C & i2c, std::uint8_t ds7505_i2c_addr, std::uint8_t max44009_i2c_addr, DS2465 & ds2465);
+ SensorNode(mbed::I2C & i2c, uint8_t ds7505_i2c_addr, uint8_t max44009_i2c_addr, OneWire::Masters::DS2465 & ds2465);
/// Detect if an authentic Sensor Node is connected.
/// @param userEntropy Additional entropy to supply to the RNG.
@@ -81,7 +84,7 @@
bool readSensorData(SensorData & sensorData);
/// Get the ROM ID for this sensor node.
- const RomId & romId() const { return ds28e15_22_25.romId; }
+ const OneWire::RomId & romId() const { return ds28e15_22_25.romId; }
/// Get the initial lux measurement for this sensor node.
double initialLux() const { return m_initialLux; }
@@ -93,9 +96,9 @@
/// Authenticated data stored in DS28E15.
struct AuthData
{
- static const std::uint8_t initialFilterLife = 100;
- DS28E15_22_25::Segment segment;
- std::uint8_t & filterLife;
+ static const uint8_t initialFilterLife = 100;
+ OneWire::Authenticators::DS28E15_22_25::Segment segment;
+ uint8_t & filterLife;
unsigned int pageNum, segmentNum;
AuthData() : filterLife(segment[0]), pageNum(0), segmentNum(0) { reset(); }
@@ -108,7 +111,7 @@
};
/// Padding value used in creation of the Slave Secret.
- static const std::uint8_t defaultPaddingByte = 0x00;
+ static const uint8_t defaultPaddingByte = 0x00;
/// Indicates hardware RNG is initialized.
static bool rngInitialized;
@@ -123,10 +126,10 @@
AuthData authData;
// Hardware interfaces
- DS28E15_22_25 ds28e15_22_25; ///< DS28E15 for authentication.
+ OneWire::Authenticators::DS28E15_22_25 ds28e15_22_25; ///< DS28E15 for authentication.
DS7505 ds7505; ///< DS7505 temperature sensor.
MAX44009 max44009; ///< MAX44009 optical light sensor.
- DS2465 & ds2465; ///< Interface to DS2465 on Controller.
+ OneWire::Masters::DS2465 & ds2465; ///< Interface to DS2465 on Controller.
/// Initialize sensors for measurement.
/// @returns True on success.
MAXREFDES143#: DeepCover Embedded Security in IoT Authenticated Sensing & Notification