![]() |
Rock Monitoring
V 1.0
|
Class that is used to initialize and communicate between Gateway and Sensornode via LoRa. More...
#include <lora_class.h>

Classes | |
| struct | loraSettings |
Public Member Functions | |
| Lora (Sensors::structSensors *sensorstruct) | |
| int8_t | init (void) |
| uint8_t | getID (void) |
| uint8_t | activityDetection (void) |
| uint8_t | dataRequest (uint8_t ID) |
| uint8_t | waitForDataRequest (void) |
| void | collectData (void) |
| uint8_t | sendData (void) |
| uint8_t | receiveData (void) |
| uint8_t | sendDeepSleep (uint8_t ID) |
| uint8_t | waitForDeepSleep (void) |
| int8_t | wakeUp (void) |
| void | convertStruct (void) |
| void | convertStructBack (Sensors::structSensors *dest) |
Public Attributes | |
| struct Lora::loraSettings | mySettings |
Private Attributes | |
| uint8_t | stringData [19] |
| Sensors::structSensors * | localSensorStruct |
| uint8_t | sendDataCommand =1 |
| uint8_t | sendCommandToSleep =2 |
| uint8_t | gatewayID =2 |
Class that is used to initialize and communicate between Gateway and Sensornode via LoRa.
Definition at line 12 of file lora_class.h.
| Lora::Lora | ( | Sensors::structSensors * | sensorstruct | ) |
Constructor sets all LoRa-paramets to default
| TxPower | is set to high |
| Mode | is set to 3 |
| CRC | and Header are on |
| Channel | is set to Channel 17 void |
Definition at line 11 of file lora_class.cpp.
| uint8_t Lora::activityDetection | ( | void | ) |
Detects any activity on the channel
Definition at line 169 of file lora_class.cpp.
| void Lora::collectData | ( | void | ) |
| void Lora::convertStruct | ( | void | ) |
Converts the struct containing the information to send into a uin8t_t array
Definition at line 129 of file lora_class.cpp.
| void Lora::convertStructBack | ( | Sensors::structSensors * | dest | ) |
Converts the uin8t_t array back into a struct containing all the necessary information
| dest | is the destination of the conversion back into an struct |
Definition at line 152 of file lora_class.cpp.
| uint8_t Lora::dataRequest | ( | uint8_t | ID | ) |
Gateway sends a request for measurement data to the sensornode
| ID | says which sensornode should send the data |
Definition at line 182 of file lora_class.cpp.
| uint8_t Lora::getID | ( | void | ) |
Takes the Input from the terminal to set the ID of the sensornode
Definition at line 27 of file lora_class.cpp.
| int8_t Lora::init | ( | void | ) |
Sets the basic settings so that the sensor-node can communicate with the gateway when turned on Gets the SensorNodeID from the EEPROM and turns the RTC, the LoRa and the USB on
Definition at line 60 of file lora_class.cpp.
| uint8_t Lora::receiveData | ( | void | ) |
Gateway receives the data sent by the sensor-node via Lora
Definition at line 241 of file lora_class.cpp.
| uint8_t Lora::sendData | ( | void | ) |
Sensor-node sends the data requested by the gateway
Definition at line 224 of file lora_class.cpp.
| uint8_t Lora::sendDeepSleep | ( | uint8_t | ID | ) |
After the gateway has finished uploading the information to the webserver it sends to command to the sensor-node to go to sleep
| ID | which sensor-node should go to sleep |
Definition at line 311 of file lora_class.cpp.
| uint8_t Lora::waitForDataRequest | ( | void | ) |
Sensor-node waits for the data-request from the gateway
Definition at line 204 of file lora_class.cpp.
| uint8_t Lora::waitForDeepSleep | ( | void | ) |
After the sensor-node has send the requested data to the gateway, he waits for the deepSleep command
Definition at line 329 of file lora_class.cpp.
| int8_t Lora::wakeUp | ( | void | ) |
After the deepSleep the LoRa-module needs to be reconfigured, takes all the settings saved in mySettings and restores them
Definition at line 258 of file lora_class.cpp.
|
private |
Definition at line 19 of file lora_class.h.
|
private |
Definition at line 16 of file lora_class.h.
| struct Lora::loraSettings Lora::mySettings |
|
private |
Definition at line 18 of file lora_class.h.
|
private |
Definition at line 17 of file lora_class.h.
|
private |
Definition at line 15 of file lora_class.h.