Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SmartHome
NodeManager_BME280_EasyPCB
Commits
33eab368
Commit
33eab368
authored
Apr 12, 2017
by
user2684
Browse files
Possibility to set sensor name #59
parent
940914cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
NodeManager.cpp
View file @
33eab368
...
@@ -123,6 +123,9 @@ void Sensor::setType(int value) {
...
@@ -123,6 +123,9 @@ void Sensor::setType(int value) {
int
Sensor
::
getType
()
{
int
Sensor
::
getType
()
{
return
_type
;
return
_type
;
}
}
void
Sensor
::
setDescription
(
char
*
value
)
{
_description
=
value
;
}
void
Sensor
::
setRetries
(
int
value
)
{
void
Sensor
::
setRetries
(
int
value
)
{
_retries
=
value
;
_retries
=
value
;
}
}
...
@@ -170,7 +173,7 @@ void Sensor::presentation() {
...
@@ -170,7 +173,7 @@ void Sensor::presentation() {
Serial
.
print
(
F
(
" T="
));
Serial
.
print
(
F
(
" T="
));
Serial
.
println
(
_presentation
);
Serial
.
println
(
_presentation
);
#endif
#endif
present
(
_child_id
,
_presentation
);
present
(
_child_id
,
_presentation
,
_description
);
}
}
// call the sensor-specific implementation of before
// call the sensor-specific implementation of before
...
...
NodeManager.h
View file @
33eab368
...
@@ -276,6 +276,8 @@ class Sensor {
...
@@ -276,6 +276,8 @@ class Sensor {
// type of this sensor (default: V_CUSTOM)
// type of this sensor (default: V_CUSTOM)
void
setType
(
int
value
);
void
setType
(
int
value
);
int
getType
();
int
getType
();
// description of the sensor (default: '')
void
setDescription
(
char
*
value
);
// when queried, send the message multiple times (default: 1)
// when queried, send the message multiple times (default: 1)
void
setRetries
(
int
value
);
void
setRetries
(
int
value
);
// For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)
// For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)
...
@@ -320,6 +322,7 @@ class Sensor {
...
@@ -320,6 +322,7 @@ class Sensor {
int
_child_id
;
int
_child_id
;
int
_presentation
=
S_CUSTOM
;
int
_presentation
=
S_CUSTOM
;
int
_type
=
V_CUSTOM
;
int
_type
=
V_CUSTOM
;
char
*
_description
=
""
;
int
_retries
=
1
;
int
_retries
=
1
;
int
_samples
=
1
;
int
_samples
=
1
;
int
_samples_interval
=
0
;
int
_samples_interval
=
0
;
...
...
README.md
View file @
33eab368
...
@@ -258,6 +258,8 @@ The following methods are available for all the sensors:
...
@@ -258,6 +258,8 @@ The following methods are available for all the sensors:
void
setPresentation
(
int
value
);
void
setPresentation
(
int
value
);
// type of this sensor (default: V_CUSTOM)
// type of this sensor (default: V_CUSTOM)
void
setType
(
int
value
);
void
setType
(
int
value
);
// description of the sensor (default: '')
void
setDescription
(
char
*
value
);
// when queried, send the message multiple times (default: 1)
// when queried, send the message multiple times (default: 1)
void
setRetries
(
int
value
);
void
setRetries
(
int
value
);
// For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)
// For some sensors, the measurement can be queried multiple times and an average is returned (default: 1)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment