Embedded System Design 2 - Project
lora_wrappers.h
Go to the documentation of this file.
1 /***************************************************************************//**
2  * @file lora_wrappers.h
3  * @brief LoRa wrapper methods
4  * @version 2.4
5  * @author Brecht Van Eeckhoudt
6  *
7  * ******************************************************************************
8  *
9  * @section License
10  *
11  * **Copyright (C) 2019 - Brecht Van Eeckhoudt**
12  *
13  * This program is free software: you can redistribute it and/or modify
14  * it under the terms of the **GNU General Public License** as published by
15  * the Free Software Foundation, either **version 3** of the License, or
16  * (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * *A copy of the GNU General Public License can be found in the `LICENSE`
24  * file along with this source code.*
25  *
26  * @n
27  *
28  * Some methods use code obtained from examples from [Silicon Labs' GitHub](https://github.com/SiliconLabs/peripheral_examples).
29  * These sections are licensed under the Silabs License Agreement. See the file
30  * "Silabs_License_Agreement.txt" for details. Before using this software for
31  * any purpose, you must agree to the terms of that agreement.
32  *
33  ******************************************************************************/
34 
35 
36 /* Include guards prevent multiple inclusions of the same header */
37 #ifndef _LORA_WAPPERS_H_
38 #define _LORA_WAPPERS_H_
39 
40 
41 /* Include necessary for this header file */
42 #include <stdint.h> /* (u)intXX_t */
43 #include <stdbool.h> /* "bool", "true", "false" */
44 #include "datatypes.h" /* Definitions of the custom data-types */
45 
46 
47 /* Public prototypes */
48 void initLoRaWAN (void);
49 void disableLoRaWAN (void);
50 
51 void sleepLoRaWAN (uint32_t sSleep);
52 void wakeLoRaWAN (void);
53 
55 void sendStormDetected (bool stormDetected);
56 void sendCableBroken (bool cableBroken);
57 void sendStatus (uint8_t status);
58 
60 
61 
62 #endif /* _LORA_WAPPERS_H_ */
void wakeLoRaWAN(void)
Wake up the LoRaWAN module early after putting it to sleep using sleepLoRaWAN.
Definitions of the custom data-types used.
MeasurementData_t data
Definition: main.c:189
void sendStormDetected(bool stormDetected)
Send a packet to the cloud using LoRaWAN to indicate that a storm has been detected.
void sendMeasurements(MeasurementData_t data)
Send measured battery voltages and internal and external temperatures to the cloud using LoRaWAN...
void sendCableBroken(bool cableBroken)
Send a packet to the cloud using LoRaWAN to indicate that the cable is broken.
void sendTest(MeasurementData_t data)
Send ONE measured battery voltage, internal and external temperature, stormDetected, cableBroken and status value to the cloud using LoRaWAN. This method uses the deprecated methods to test if the data gets send correctly.
void disableLoRaWAN(void)
Disable LoRaWAN functionality.
void initLoRaWAN(void)
Initialize LoRaWAN functionality.
Definition: lora_wrappers.c:92
void sendStatus(uint8_t status)
Send a packet to indicate a status.
void sleepLoRaWAN(uint32_t sSleep)
Let the LoRaWAN module sleep for a specified amount of time.