Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel
ampel-firmware
Commits
97ed7877
Commit
97ed7877
authored
Dec 27, 2020
by
Eric Duminil
Browse files
LoRa: Dont try to send until connected
parent
b511a1ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
lorawan.cpp
View file @
97ed7877
...
...
@@ -184,7 +184,7 @@ namespace lorawan {
void
preparePayloadIfTimeHasCome
(
const
int16_t
&
co2
,
const
float
&
temperature
,
const
float
&
humidity
)
{
static
unsigned
long
last_sent_at
=
0
;
unsigned
long
now
=
seconds
();
if
(
now
-
last_sent_at
>
config
::
lorawan_sending_interval
)
{
if
(
connected
&&
(
now
>
last_sent_at
+
config
::
lorawan_sending_interval
)
)
{
last_sent_at
=
now
;
preparePayload
(
co2
,
temperature
,
humidity
);
}
...
...
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