Skip to content
GitLab
Explore
Projects
Groups
Snippets
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
4 years ago
by
Eric Duminil
Browse files
Options
Download
Email Patches
Plain Diff
Pass by reference
parent
2e99fa40
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lorawan.h
+1
-1
lorawan.h
mqtt.cpp
+1
-1
mqtt.cpp
mqtt.h
+2
-2
mqtt.h
with
4 additions
and
4 deletions
+4
-4
lorawan.h
+
1
-
1
View file @
ee56f086
...
@@ -40,7 +40,7 @@ namespace lorawan {
...
@@ -40,7 +40,7 @@ namespace lorawan {
extern
String
last_transmission
;
extern
String
last_transmission
;
void
initialize
();
void
initialize
();
void
process
();
void
process
();
void
preparePayloadIfTimeHasCome
(
int16_t
co2
,
float
temp
,
float
hum
);
void
preparePayloadIfTimeHasCome
(
const
int16_t
&
co2
,
const
float
&
temp
,
const
float
&
hum
);
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
mqtt.cpp
+
1
-
1
View file @
ee56f086
...
@@ -207,7 +207,7 @@ namespace mqtt {
...
@@ -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
// Send message via MQTT according to sending interval
unsigned
long
now
=
seconds
();
unsigned
long
now
=
seconds
();
//TODO: Send average since last MQTT message?
//TODO: Send average since last MQTT message?
...
...
This diff is collapsed.
Click to expand it.
mqtt.h
+
2
-
2
View file @
ee56f086
...
@@ -9,12 +9,12 @@
...
@@ -9,12 +9,12 @@
#include
"src/lib/PubSubClient/src/PubSubClient.h"
#include
"src/lib/PubSubClient/src/PubSubClient.h"
#include
"wifi_util.h"
#include
"wifi_util.h"
namespace
config
{
namespace
config
{
extern
uint16_t
sending_interval
;
// [s]
extern
uint16_t
sending_interval
;
// [s]
}
}
namespace
mqtt
{
namespace
mqtt
{
extern
String
last_successful_publish
;
extern
String
last_successful_publish
;
void
initialize
(
String
&
topic
);
void
initialize
(
String
&
topic
);
void
keepConnection
();
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
#endif
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets