Rock Monitoring  V 1.0
SensorStab Class Reference

#include <SensorStab.h>

Collaboration diagram for SensorStab:
Collaboration graph

Public Member Functions

 SensorStab ()
 
int8_t init (void)
 
uint8_t sendDataToGateway (void)
 
uint8_t makeMeasurment (void)
 
void convertTime (uint32_t time)
 
uint8_t deepSleepCommand (void)
 
void deepSleep (void)
 
int8_t wakeUp (void)
 
uint8_t measureBattery (void)
 
void run (void)
 

Private Attributes

Sensors::structSensors mySensorStruct
 
char timeString [12]
 
uint8_t notSleepCnt =0
 
Lora myLora
 
Connection3G my3G
 
Sensors mySensors
 
Leds myLeds
 

Detailed Description

Definition at line 10 of file SensorStab.h.

Constructor & Destructor Documentation

SensorStab::SensorStab ( )

creates an object from Lora, Sensors and Connection3G

Definition at line 17 of file SensorStab.cpp.

Member Function Documentation

void SensorStab::convertTime ( uint32_t  time)

This method converts a time into a uint8_t array

Parameters
timeto be converted

Definition at line 153 of file SensorStab.cpp.

void SensorStab::deepSleep ( void  )

Turns off all the sensors and modules used in order to safe energy

Parameters
timeis the number of seconds the sensornode should rest in deepSleep

Definition at line 107 of file SensorStab.cpp.

uint8_t SensorStab::deepSleepCommand ( void  )

Waits for the deepSleepCommand from the gateway

Returns
0 received a deepSleepCommand
1 not received a deepSleepCommand

Definition at line 120 of file SensorStab.cpp.

int8_t SensorStab::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 25 of file SensorStab.cpp.

uint8_t SensorStab::makeMeasurment ( void  )

Gets the values from all accelerometer and saves them in the struct

Returns
0 measurement successful
1 error with accelerometer
2 error with tempSensors

Definition at line 40 of file SensorStab.cpp.

uint8_t SensorStab::measureBattery ( void  )

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

Returns
returns the battery level

Definition at line 178 of file SensorStab.cpp.

void SensorStab::run ( void  )

structures the procedure of the sensor-node

Definition at line 191 of file SensorStab.cpp.

uint8_t SensorStab::sendDataToGateway ( void  )

This method waits for the DataRequest of the gateway and sends the requested data via LoRa back to the gateway

Returns
0 Data has been sent and gateway has acknowledged
1 Data has not been sent

Definition at line 54 of file SensorStab.cpp.

int8_t SensorStab::wakeUp ( void  )

Turns ON all the modules and reconfigures them if necessary

Returns
0 all modules have woken up successfully
1 not all modules have woken up successfully

Definition at line 145 of file SensorStab.cpp.

Member Data Documentation

Connection3G SensorStab::my3G
private

Definition at line 30 of file SensorStab.h.

Leds SensorStab::myLeds
private

Definition at line 32 of file SensorStab.h.

Lora SensorStab::myLora
private

Definition at line 29 of file SensorStab.h.

Sensors SensorStab::mySensors
private

Definition at line 31 of file SensorStab.h.

Sensors::structSensors SensorStab::mySensorStruct
private

Definition at line 25 of file SensorStab.h.

uint8_t SensorStab::notSleepCnt =0
private

Definition at line 27 of file SensorStab.h.

char SensorStab::timeString[12]
private

Definition at line 26 of file SensorStab.h.


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