-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from Sensirion/add-support-for-sen66
Add support for sen66
- Loading branch information
Showing
22 changed files
with
460 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
#include "MeasurementList.h" | ||
|
||
void MeasurementList::init(const size_t& length) { | ||
_length = length; | ||
delete[] _measurements; | ||
_measurements = new Measurement[_length]; | ||
mLength = length; | ||
delete[] mMeasurements; | ||
mMeasurements = new Measurement[mLength]; | ||
} | ||
|
||
size_t MeasurementList::getLength() const { | ||
return _length; | ||
return mLength; | ||
} | ||
|
||
MeasurementList::~MeasurementList() { | ||
delete[] _measurements; | ||
delete[] mMeasurements; | ||
} | ||
|
||
MeasurementList::MeasurementList(const MeasurementList& other) | ||
: _length(other._length) { | ||
_measurements = new Measurement[_length]; | ||
for (size_t i = 0; i < _length; i++) { | ||
_measurements[i] = other._measurements[i]; | ||
: mLength(other.mLength) { | ||
mMeasurements = new Measurement[mLength]; | ||
for (size_t i = 0; i < mLength; i++) { | ||
mMeasurements[i] = other.mMeasurements[i]; | ||
} | ||
} | ||
|
||
MeasurementList& MeasurementList::operator=(const MeasurementList& other) { | ||
if (&other != this) { | ||
delete[] _measurements; | ||
delete[] mMeasurements; | ||
|
||
_length = other._length; | ||
_measurements = new Measurement[_length]; | ||
for (size_t i = 0; i < _length; i++) { | ||
_measurements[i] = other._measurements[i]; | ||
mLength = other.mLength; | ||
mMeasurements = new Measurement[mLength]; | ||
for (size_t i = 0; i < mLength; i++) { | ||
mMeasurements[i] = other.mMeasurements[i]; | ||
} | ||
_writeHead = other._writeHead; | ||
mWriteHead = other.mWriteHead; | ||
} | ||
return *this; | ||
} | ||
|
||
void MeasurementList::addMeasurement(const Measurement& m) { | ||
if (_writeHead < _length) { | ||
_measurements[_writeHead] = m; | ||
_writeHead++; | ||
if (mWriteHead < mLength) { | ||
mMeasurements[mWriteHead] = m; | ||
mWriteHead++; | ||
} | ||
} | ||
|
||
Measurement MeasurementList::getMeasurement(size_t i) const { | ||
return _measurements[i]; | ||
return mMeasurements[i]; | ||
} | ||
|
||
void MeasurementList::resetWriteHead() { | ||
_writeHead = 0; | ||
mWriteHead = 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#ifndef _SENSIRION_UPT_I2C_AUTO_DETECTION_H_ | ||
#define _SENSIRION_UPT_I2C_AUTO_DETECTION_H_ | ||
#ifndef SENSIRION_UPT_I2C_AUTO_DETECTION_H | ||
#define SENSIRION_UPT_I2C_AUTO_DETECTION_H | ||
|
||
#include "I2CAutoDetector.h" | ||
#include "Sensirion_UPT_Core.h" | ||
#include "SensorManager.h" | ||
#include <Arduino.h> | ||
|
||
#endif /* _SENSIRION_UPT_I2C_AUTO_DETECTION_H_ */ | ||
#endif /* SENSIRION_UPT_I2C_AUTO_DETECTION_H */ |
Oops, something went wrong.