ASCEND Flight Software
Loading...
Searching...
No Matches
Public Member Functions | List of all members
AnalogTemp Class Reference

#include <AnalogTemp.h>

Inheritance diagram for AnalogTemp:
Collaboration diagram for AnalogTemp:

Public Member Functions

 AnalogTemp ()
 Construct a new Analog Temp object with minimum period of 1000 ms.
 
 AnalogTemp (unsigned long minimum_period)
 Construct a new Analog Temp object with given minimum period.
 
bool verify () override
 Set up sensor and returns status (always true for the thermistor)
 
String readData () override
 Reads ADC value, returns String.
 
void readDataPacket (uint8_t *&packet) override
 Reads ADC value and appends to packet.
 
String decodeToCSV (uint8_t *&packet) override
 Decodes ADC reading from packet array.
 
- Public Member Functions inherited from Sensor
 Sensor (String sensor_name, String csv_header, unsigned long minimum_period)
 
 Sensor (String sensor_name, String csv_header)
 
 Sensor (String sensor_name, String csv_header, int fields)
 Construct a new Sensor object with default minimum_period of 0 (depreciated)
 
 Sensor (String sensor_name, String csv_header, int fields, unsigned long minimum_period)
 Construct a new Sensor object (Depreciated)
 
unsigned long getPeriod () const
 Get the minimum minimum_period between sensor reads in ms.
 
void setPeriod (int minimum_period)
 Set the minimum minimum_period between sensor reads in ms.
 
unsigned long getLastExecution () const
 Get the system time of the last execution in ms.
 
void setLastExecution (int last_execution)
 Set the system time of the last execution in ms.
 
const String & getSensorCSVHeader () const
 Get the csv header string associated with this sensor.
 
void getDataPacket (uint32_t &sensor_id, uint8_t *&packet)
 Append the data from a sensor to the packet if the minium period is satisfied.
 
String readEmpty () const
 Returns CSV line in the same format as readData() but with "-" instead of data.
 
String getDataCSV ()
 Uses readData and readEmpty to get the data-filled or empty-celled CSV line for the sensor.
 
- Public Member Functions inherited from Device
 Device (String device_name)
 Default constructor, sets a max_attempt of 1 (device recovery won't be attempted)
 
 Device (String device_name, int max_attempts, int wait_factor)
 
const String & getDeviceName ()
 
bool getVerified ()
 Get if the Device is Verified.
 
void recoveryConfig (int max_attempts, int wait_factor)
 Set recovery config (used keep default constructor)
 
void setWaitFactor (int wait_factor)
 Set wait_factor.
 
void setMaxAttempts (int max_attempts)
 Set max_attempts.
 
bool attemptConnection ()
 If the sensor is verified, return true, if not and it has been long enough since the last attempt (decided by wait_factor and attempt_number), attempt to reverify (reinitialize) it.
 

Additional Inherited Members

- Protected Attributes inherited from Sensor
int num_fields
 
- Protected Attributes inherited from Device
bool verified
 
String device_name
 

Constructor & Destructor Documentation

◆ AnalogTemp() [1/2]

AnalogTemp::AnalogTemp ( )

Construct a new Analog Temp object with minimum period of 1000 ms.

◆ AnalogTemp() [2/2]

AnalogTemp::AnalogTemp ( unsigned long  minimum_period)

Construct a new Analog Temp object with given minimum period.

Parameters
minimum_periodMinimum period between readings in ms

Member Function Documentation

◆ decodeToCSV()

String AnalogTemp::decodeToCSV ( uint8_t *&  packet)
overridevirtual

Decodes ADC reading from packet array.

Parameters
packetPointer to the packet byte array
Returns
String ADC reading

Reimplemented from Sensor.

◆ readData()

String AnalogTemp::readData ( )
overridevirtual

Reads ADC value, returns String.

Returns
String ADC value

Implements Sensor.

◆ readDataPacket()

void AnalogTemp::readDataPacket ( uint8_t *&  packet)
overridevirtual

Reads ADC value and appends to packet.

Parameters
packetPointer to the packet byte array

Reimplemented from Sensor.

◆ verify()

bool AnalogTemp::verify ( )
overridevirtual

Set up sensor and returns status (always true for the thermistor)

Returns
true
false

Implements Sensor.


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