Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NodeManager_BMP280_Stamp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartHome
NodeManager_BMP280_Stamp
Commits
0772fc5f
Commit
0772fc5f
authored
8 years ago
by
user2684
Browse files
Options
Downloads
Patches
Plain Diff
Add option to unregister a sensor #52
parent
b6401a26
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NodeManager.cpp
+6
-0
6 additions, 0 deletions
NodeManager.cpp
NodeManager.h
+2
-0
2 additions, 0 deletions
NodeManager.h
README.md
+4
-2
4 additions, 2 deletions
README.md
with
12 additions
and
2 deletions
NodeManager.cpp
+
6
−
0
View file @
0772fc5f
...
@@ -1479,6 +1479,12 @@ int NodeManager::registerSensor(Sensor* sensor) {
...
@@ -1479,6 +1479,12 @@ int NodeManager::registerSensor(Sensor* sensor) {
return
sensor
->
getChildId
();
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
// return a sensor given its index
Sensor
*
NodeManager
::
get
(
int
child_id
)
{
Sensor
*
NodeManager
::
get
(
int
child_id
)
{
// return a pointer to the sensor from the given child_id
// return a pointer to the sensor from the given child_id
...
...
This diff is collapsed.
Click to expand it.
NodeManager.h
+
2
−
0
View file @
0772fc5f
...
@@ -750,6 +750,8 @@ class NodeManager {
...
@@ -750,6 +750,8 @@ class NodeManager {
int
registerSensor
(
int
sensor_type
,
int
pin
=
-
1
,
int
child_id
=
-
1
);
int
registerSensor
(
int
sensor_type
,
int
pin
=
-
1
,
int
child_id
=
-
1
);
// register a custom sensor
// register a custom sensor
int
registerSensor
(
Sensor
*
sensor
);
int
registerSensor
(
Sensor
*
sensor
);
// un-register a sensor
void
unRegisterSensor
(
int
sensor_index
);
// return a sensor by its index
// return a sensor by its index
Sensor
*
get
(
int
sensor_index
);
Sensor
*
get
(
int
sensor_index
);
Sensor
*
getSensor
(
int
sensor_index
);
Sensor
*
getSensor
(
int
sensor_index
);
...
...
This diff is collapsed.
Click to expand it.
README.md
+
4
−
2
View file @
0772fc5f
...
@@ -154,6 +154,8 @@ Node Manager comes with a reasonable default configuration. If you want/need to
...
@@ -154,6 +154,8 @@ Node Manager comes with a reasonable default configuration. If you want/need to
void
setSleepBetweenSend
(
int
value
);
void
setSleepBetweenSend
(
int
value
);
// register a built-in sensor
// register a built-in sensor
int
registerSensor
(
int
sensor_type
,
int
pin
=
-
1
,
int
child_id
=
-
1
);
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
// register a custom sensor
int
registerSensor
(
Sensor
*
sensor
);
int
registerSensor
(
Sensor
*
sensor
);
// return a sensor by its index
// return a sensor by its index
...
@@ -305,13 +307,13 @@ Each sensor class can expose additional methods.
...
@@ -305,13 +307,13 @@ Each sensor class can expose additional methods.
#### SensorThermistor
#### SensorThermistor
~~~
c
~~~
c
// resistance at 25 degrees C (default: 10000)
// resistance at 25 degrees C (default: 10000)
void
setNominalResistor
(
int
value
);
void
setNominalResistor
(
long
value
);
// temperature for nominal resistance (default: 25)
// temperature for nominal resistance (default: 25)
void
setNominalTemperature
(
int
value
);
void
setNominalTemperature
(
int
value
);
// The beta coefficient of the thermistor (default: 3950)
// The beta coefficient of the thermistor (default: 3950)
void
setBCoefficient
(
int
value
);
void
setBCoefficient
(
int
value
);
// the value of the resistor in series with the thermistor (default: 10000)
// the value of the resistor in series with the thermistor (default: 10000)
void
setSeriesResistor
(
int
value
);
void
setSeriesResistor
(
long
value
);
// set a temperature offset
// set a temperature offset
void
setOffset
(
float
value
);
void
setOffset
(
float
value
);
~~~
~~~
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment