Commit ee56f086 authored by Eric Duminil's avatar Eric Duminil
Browse files

Pass by reference

parent 2e99fa40
......@@ -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
......
......@@ -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?
......
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment