diff --git a/NodeManager.cpp b/NodeManager.cpp index 3a2fe8bffdf7ed90fdfcfc928555fdbedf1965e0..1cc6182d95134812e51de50f34c8542210cba3a7 100644 --- a/NodeManager.cpp +++ b/NodeManager.cpp @@ -123,6 +123,9 @@ void Sensor::setType(int value) { int Sensor::getType() { return _type; } +void Sensor::setDescription(char* value) { + _description = value; +} void Sensor::setRetries(int value) { _retries = value; } @@ -170,7 +173,7 @@ void Sensor::presentation() { Serial.print(F(" T=")); Serial.println(_presentation); #endif - present(_child_id, _presentation); + present(_child_id, _presentation,_description); } // call the sensor-specific implementation of before diff --git a/NodeManager.h b/NodeManager.h index 5a60a877f0fd27f8c74e3ea527546ee4263d19df..c457c4b521ca7f650c5a09dc188cacd912ed5b67 100644 --- a/NodeManager.h +++ b/NodeManager.h @@ -276,6 +276,8 @@ class Sensor { // type of this sensor (default: V_CUSTOM) void setType(int value); int getType(); + // description of the sensor (default: '') + void setDescription(char *value); // when queried, send the message multiple times (default: 1) void setRetries(int value); // For some sensors, the measurement can be queried multiple times and an average is returned (default: 1) @@ -320,6 +322,7 @@ class Sensor { int _child_id; int _presentation = S_CUSTOM; int _type = V_CUSTOM; + char* _description = ""; int _retries = 1; int _samples = 1; int _samples_interval = 0; diff --git a/README.md b/README.md index 9daace70a22d6f25401bada452eb452cc7a98f46..04dfae1025eb6f2f9b23c637883618f606d0cdcd 100644 --- a/README.md +++ b/README.md @@ -258,6 +258,8 @@ The following methods are available for all the sensors: void setPresentation(int value); // type of this sensor (default: V_CUSTOM) void setType(int value); + // description of the sensor (default: '') + void setDescription(char *value); // when queried, send the message multiple times (default: 1) void setRetries(int value); // For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)