-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathWeatherComunication.h
40 lines (29 loc) · 1.28 KB
/
WeatherComunication.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef WEATHER_COMUNICATION
#define WEATHER_COMUNICATION
#include <Arduino.h>
#include <avr/dtostrf.h> // Uncomment to use in Feather M0
#include "WeatherRecord.h"
#include "RH_RF95.h"
class WeatherComunication
{
public:
//Public Functions
WeatherComunication(int lora_cs, int lora_rst, int lora_int, float lora_freq); // Receive the LoRa module configurations
WeatherComunication(int lora_cs, int lora_rst, int lora_int, float lora_freq, const char* channel); // Receive the LoRa module configurations
int configLoRa(); // Begin & Config the LoRa module (return 0 if ok, return 1 if erro)
//void sendMessageSerial(WeatherRecord wr, HardwareSerial* DefaultSerial); // Receive the Weather Record & send message via Serial Monitor
void sendMessageSerial(WeatherRecord wr); // Receive the Weather Record & send message via Serial Monitor
void sendMessageLoRa(WeatherRecord wr); // Receive the Weather Record & send message via LoRa
//Public Variables
private:
RH_RF95 rf95;
//Private Functions
//Private Variables
int lora_cs; // LoRa module chip select pin
int lora_rst; // LoRa module reset pin
int lora_int; // LoRa imodule nterrup pin
float lora_freq; // LoRa module frequency
const char* ts_channel;
unsigned long int cont;
};
#endif