Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Käppler
ampel-firmware
Commits
ee56f086
Commit
ee56f086
authored
Dec 26, 2020
by
Eric Duminil
Browse files
Pass by reference
parent
2e99fa40
Changes
3
Hide whitespace changes
Inline
Side-by-side
lorawan.h
View file @
ee56f086
...
...
@@ -40,7 +40,7 @@ namespace lorawan {
extern
String
last_transmission
;
void
initialize
();
void
process
();
void
preparePayloadIfTimeHasCome
(
int16_t
co2
,
float
temp
,
float
hum
);
void
preparePayloadIfTimeHasCome
(
const
int16_t
&
co2
,
const
float
&
temp
,
const
float
&
hum
);
}
#endif
...
...
mqtt.cpp
View file @
ee56f086
...
...
@@ -207,7 +207,7 @@ namespace mqtt {
}
}
void
publishIfTimeHasCome
(
const
String
&
timeStamp
,
int16_t
co2
,
float
temp
,
float
hum
)
{
void
publishIfTimeHasCome
(
const
String
&
timeStamp
,
const
int16_t
&
co2
,
const
float
&
temp
,
const
float
&
hum
)
{
// Send message via MQTT according to sending interval
unsigned
long
now
=
seconds
();
//TODO: Send average since last MQTT message?
...
...
mqtt.h
View file @
ee56f086
...
...
@@ -9,12 +9,12 @@
#include
"src/lib/PubSubClient/src/PubSubClient.h"
#include
"wifi_util.h"
namespace
config
{
extern
uint16_t
sending_interval
;
// [s]
extern
uint16_t
sending_interval
;
// [s]
}
namespace
mqtt
{
extern
String
last_successful_publish
;
void
initialize
(
String
&
topic
);
void
keepConnection
();
void
publishIfTimeHasCome
(
const
String
&
timeStamp
,
int16_t
co2
,
float
temp
,
float
hum
);
void
publishIfTimeHasCome
(
const
String
&
timeStamp
,
const
int16_t
&
co2
,
const
float
&
temp
,
const
float
&
hum
);
}
#endif
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment