lorawan.h 629 Bytes
Newer Older
1
2
#ifndef AMPEL_LORAWAN_H_
#define AMPEL_LORAWAN_H_
Eric Duminil's avatar
Eric Duminil committed
3
4
5

#include "config.h"

6
#  if defined(AMPEL_LORAWAN) && defined(ESP32)
Eric Duminil's avatar
Eric Duminil committed
7

8
#include <stdint.h> // For uint32_t & uint16_t
9

Eric Duminil's avatar
Eric Duminil committed
10
11
namespace config {
  extern uint16_t lorawan_sending_interval; // [s]
12
  extern const char *lorawan_frequency_plan; // e.g. "Europe 868"
Eric Duminil's avatar
Eric Duminil committed
13
14
}

15
16
namespace lorawan {
  extern bool waiting_for_confirmation;
Eric Duminil's avatar
Eric Duminil committed
17
  extern bool connected;
18
  extern char last_transmission[];
19
20
  void initialize();
  void process();
Eric Duminil's avatar
Eric Duminil committed
21
  void preparePayloadIfTimeHasCome(const int16_t &co2, const float &temp, const float &hum);
Eric Duminil's avatar
Eric Duminil committed
22
23

  void setLoRaInterval(int32_t sending_interval);
24
25
}

26
#  endif
27
#endif