Rock Monitoring  V 1.0
Gateway Class Reference

#include <Gateway.h>

Collaboration diagram for Gateway:
Collaboration graph

Public Member Functions

 Gateway ()
 
uint8_t init (void)
 
void showStructContent (uint8_t node)
 
uint8_t sendToServer (Sensors::structSensors *dataToSend)
 
uint8_t sendSleep (uint8_t ID)
 
uint8_t requestData (uint8_t ID)
 
uint8_t receiveNodeData (void)
 
void deepSleep (void)
 
int8_t wakeUp (void)
 
uint8_t measureBattery (void)
 
void run (void)
 

Private Attributes

Sensors::structSensors mySensorStruct
 
Sensors::structSensors mySensorStructArray [numberOfNodes]
 
uint32_t sleepTime =60
 
char timeString [12]
 
uint8_t sensorID [numberOfNodes] ={3,4,5}
 
uint8_t notReceived =0
 
uint8_t notReceivedCnt =0
 
uint8_t notSleepCnt =0
 
uint8_t nothingReceived =0
 
uint8_t currentNode =0
 
Lora myLora
 
Connection3G my3G
 
Leds myLeds
 

Detailed Description

Definition at line 9 of file Gateway.h.

Constructor & Destructor Documentation

Gateway::Gateway ( )

This method creats object of Lora and Connection3G

Definition at line 6 of file Gateway.cpp.

Member Function Documentation

void Gateway::deepSleep ( void  )

Sets gateway into deepSleep mode

Definition at line 98 of file Gateway.cpp.

uint8_t Gateway::init ( void  )

This method initializes all the components of the sensornode

Returns
0 all settings are done correctly
1 error during settings

Definition at line 11 of file Gateway.cpp.

uint8_t Gateway::measureBattery ( void  )

This method shuts down the battery charger and measures the battery level

Returns
returns the battery level

Definition at line 27 of file Gateway.cpp.

uint8_t Gateway::receiveNodeData ( void  )

Receives data from a sensor-node

Returns
0 receiving was successful
1 receiving was unsuccessful

Definition at line 77 of file Gateway.cpp.

uint8_t Gateway::requestData ( uint8_t  ID)

Requests data from a sensor-node

Returns
0 request was successful
1 request was unsuccessful

Definition at line 70 of file Gateway.cpp.

void Gateway::run ( void  )

structures the procedure of the gateway

Definition at line 116 of file Gateway.cpp.

uint8_t Gateway::sendSleep ( uint8_t  ID)

Sends to all the sensor-nodes a sleep command

Returns
0 command was successful
1 command was unsuccessful

Definition at line 91 of file Gateway.cpp.

uint8_t Gateway::sendToServer ( Sensors::structSensors dataToSend)

Uploads all the received data to a web-server

Returns
0 uploading was successful
1 uploading was unsuccessful

Definition at line 84 of file Gateway.cpp.

void Gateway::showStructContent ( uint8_t  node)

Shows the content of a received packet from a sensor-node

Definition at line 40 of file Gateway.cpp.

int8_t Gateway::wakeUp ( void  )

After deepSleep reconfigures all the modules

Returns
0 reconfiguration was successful
1 reconfiguration was unsuccessful

Definition at line 108 of file Gateway.cpp.

Member Data Documentation

uint8_t Gateway::currentNode =0
private

Definition at line 35 of file Gateway.h.

Connection3G Gateway::my3G
private

Definition at line 39 of file Gateway.h.

Leds Gateway::myLeds
private

Definition at line 40 of file Gateway.h.

Lora Gateway::myLora
private

Definition at line 38 of file Gateway.h.

Sensors::structSensors Gateway::mySensorStruct
private

Definition at line 25 of file Gateway.h.

Sensors::structSensors Gateway::mySensorStructArray[numberOfNodes]
private

Definition at line 26 of file Gateway.h.

uint8_t Gateway::nothingReceived =0
private

Definition at line 34 of file Gateway.h.

uint8_t Gateway::notReceived =0
private

Definition at line 31 of file Gateway.h.

uint8_t Gateway::notReceivedCnt =0
private

Definition at line 32 of file Gateway.h.

uint8_t Gateway::notSleepCnt =0
private

Definition at line 33 of file Gateway.h.

uint8_t Gateway::sensorID[numberOfNodes] ={3,4,5}
private

Definition at line 29 of file Gateway.h.

uint32_t Gateway::sleepTime =60
private

Definition at line 27 of file Gateway.h.

char Gateway::timeString[12]
private

Definition at line 28 of file Gateway.h.


The documentation for this class was generated from the following files: