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
0772fc5f
Commit
0772fc5f
authored
Apr 12, 2017
by
user2684
Browse files
Add option to unregister a sensor #52
parent
b6401a26
Changes
3
Hide whitespace changes
Inline
Side-by-side
NodeManager.cpp
View file @
0772fc5f
...
...
@@ -1479,6 +1479,12 @@ int NodeManager::registerSensor(Sensor* sensor) {
return
sensor
->
getChildId
();
}
// un-register a sensor to this manager
void
NodeManager
::
unRegisterSensor
(
int
sensor_index
)
{
// unlink the pointer to this sensor
_sensors
[
sensor_index
]
==
0
;
}
// return a sensor given its index
Sensor
*
NodeManager
::
get
(
int
child_id
)
{
// return a pointer to the sensor from the given child_id
...
...
NodeManager.h
View file @
0772fc5f
...
...
@@ -750,6 +750,8 @@ class NodeManager {
int
registerSensor
(
int
sensor_type
,
int
pin
=
-
1
,
int
child_id
=
-
1
);
// register a custom sensor
int
registerSensor
(
Sensor
*
sensor
);
// un-register a sensor
void
unRegisterSensor
(
int
sensor_index
);
// return a sensor by its index
Sensor
*
get
(
int
sensor_index
);
Sensor
*
getSensor
(
int
sensor_index
);
...
...
README.md
View file @
0772fc5f
...
...
@@ -154,6 +154,8 @@ Node Manager comes with a reasonable default configuration. If you want/need to
void
setSleepBetweenSend
(
int
value
);
// register a built-in sensor
int
registerSensor
(
int
sensor_type
,
int
pin
=
-
1
,
int
child_id
=
-
1
);
// un-register a sensor
void
unRegisterSensor
(
int
sensor_index
);
// register a custom sensor
int
registerSensor
(
Sensor
*
sensor
);
// return a sensor by its index
...
...
@@ -305,13 +307,13 @@ Each sensor class can expose additional methods.
#### SensorThermistor
~~~
c
// resistance at 25 degrees C (default: 10000)
void
setNominalResistor
(
int
value
);
void
setNominalResistor
(
long
value
);
// temperature for nominal resistance (default: 25)
void
setNominalTemperature
(
int
value
);
// The beta coefficient of the thermistor (default: 3950)
void
setBCoefficient
(
int
value
);
// the value of the resistor in series with the thermistor (default: 10000)
void
setSeriesResistor
(
int
value
);
void
setSeriesResistor
(
long
value
);
// set a temperature offset
void
setOffset
(
float
value
);
~~~
...
...
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