lorawan.h 885 Bytes
Newer Older
1
2
#ifndef AMPEL_LORAWAN_H_
#define AMPEL_LORAWAN_H_
3
#if defined(ESP32)
4
#include <Arduino.h>
Eric Duminil's avatar
Notes    
Eric Duminil committed
5
6
// Requires "MCCI LoRaWAN LMIC library", which will be automatically used with PlatformIO but should be added in "Arduino IDE".
// Tested successfully with v3.2.0 and connected to a thethingsnetwork.org app.
7
8
#include <lmic.h>
#include <hal/hal.h>
Eric Duminil's avatar
Eric Duminil committed
9
#include <arduino_lmic_hal_boards.h>
10
11
#include <SPI.h>
typedef uint8_t u1_t;
Eric Duminil's avatar
Note    
Eric Duminil committed
12
13

//TODO: Should lmic_project_config.h be defined somewhere?
14
15
16
17
18
19
20
21
//#include <lmic_project_config.h>

#include "co2_sensor.h"
#include "led_effects.h"
#include "config.h"

#include "util.h"

Eric Duminil's avatar
Eric Duminil committed
22
23
24
25
namespace config {
  extern uint16_t lorawan_sending_interval; // [s]
}

26
27
namespace lorawan {
  extern bool waiting_for_confirmation;
Eric Duminil's avatar
Eric Duminil committed
28
29
  extern bool connected;
  extern String last_transmission;
30
31
32
33
34
35
  void initialize();
  void process();
  void preparePayloadIfTimehasCome();
}

#endif
36
#endif