RumPi 1.0
A self-assembling C++ sensor & actuator library for the Raspberry Pi 5
Common.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <unordered_map>
#include <ctime>
#include <cmath>
#include <climits>
#include <condition_variable>
#include <thread>
#include <atomic>
#include <map>
#include <queue>
#include <cstdio>
#include <functional>
#include <mutex>
#include <vector>
#include <wiringPi.h>
#include <wiringSerial.h>
#include "AceLinux.h"
Include dependency graph for Common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  RumPi
 RumPi is the library's top-level facade.
 

Enumerations

enum  RumPi::EAlertLevel { RumPi::OK , RumPi::Warning , RumPi::Alert }
 Severity of a metric relative to its thresholds. More...
 

Variables

constexpr unsigned int RumPi::PIN_GPIO_5 = 5
 BCM GPIO pin 5. More...
 
constexpr unsigned int RumPi::PIN_GPIO_6 = 6
 BCM GPIO pin 6. More...
 
constexpr unsigned int RumPi::PIN_GPIO_12 = 12
 BCM GPIO pin 12. More...
 
constexpr unsigned int RumPi::PIN_GPIO_13 = 13
 BCM GPIO pin 13. More...
 
constexpr unsigned int RumPi::PIN_GPIO_14 = 14
 BCM GPIO pin 14. More...
 
constexpr unsigned int RumPi::PIN_GPIO_15 = 15
 BCM GPIO pin 15. More...
 
constexpr unsigned int RumPi::PIN_GPIO_16 = 16
 BCM GPIO pin 16. More...
 
constexpr unsigned int RumPi::PIN_GPIO_17 = 17
 BCM GPIO pin 17. More...
 
constexpr unsigned int RumPi::PIN_GPIO_18 = 18
 BCM GPIO pin 18. More...
 
constexpr unsigned int RumPi::PIN_GPIO_19 = 19
 BCM GPIO pin 19. More...
 
constexpr unsigned int RumPi::PIN_GPIO_20 = 20
 BCM GPIO pin 20. More...
 
constexpr unsigned int RumPi::PIN_GPIO_21 = 21
 BCM GPIO pin 21. More...
 
constexpr unsigned int RumPi::PIN_GPIO_22 = 22
 BCM GPIO pin 22. More...
 
constexpr unsigned int RumPi::PIN_GPIO_23 = 23
 BCM GPIO pin 23. More...
 
constexpr unsigned int RumPi::PIN_GPIO_24 = 24
 BCM GPIO pin 24. More...
 
constexpr unsigned int RumPi::PIN_GPIO_25 = 25
 BCM GPIO pin 25. More...
 
constexpr unsigned int RumPi::PIN_GPIO_26 = 26
 BCM GPIO pin 26. More...
 
constexpr unsigned int RumPi::PIN_GPIO_27 = 27
 BCM GPIO pin 27. More...
 
constexpr unsigned int RumPi::RUMPI_SINGLE_COMPONENT_BUFFER_SIZE = 2 << 9
 Buffer size for a single component's serial reads. More...
 
constexpr unsigned int RumPi::RUMPI_MAX_BUFFER_SIZE = 2 << 15
 Maximum overall buffer size. More...
 
constexpr unsigned int RumPi::RUMPI_MAX_PCF8591_PINS = 4
 Number of ADC channels on a PCF8591. More...
 
constexpr unsigned int RumPi::RUMPI_MAX_READ_ATTEMPTS = 2 << 15
 Maximum serial-read retry attempts before giving up. More...
 
constexpr unsigned int RumPi::RUMPI_MAX_NUM_SAMPLES = 5
 Default rolling-average window length. More...
 
constexpr size_t RumPi::RUMPI_MAX_LOG_FILES_TO_KEEP = 20
 
constexpr float RumPi::THRESHOLD_SYSTEMTEMPERATURE_WARNING_CELSIUS = 70.0f
 System temperature warning threshold, in Celsius. More...
 
constexpr float RumPi::THRESHOLD_SYSTEMTEMPERATURE_ALERT_CELSIUS = 80.0f
 System temperature alert threshold, in Celsius (Pi soft-throttles here). More...
 
constexpr bool RumPi::THRESHOLD_SYSTEMTEMPERATURE_HIGHER_IS_WORSE = true
 High system temperature is worse. More...
 
constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_WARNING_LOW_VOLTS = 4.9f
 5V rail low-side warning threshold, in volts. More...
 
constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_ALERT_LOW_VOLTS = 4.8f
 5V rail low-side alert threshold, in volts. More...
 
constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_WARNING_HIGH_VOLTS = 5.27f
 5V rail high-side warning threshold, in volts. More...
 
constexpr float RumPi::THRESHOLD_EXTERNALFIVEVOLT_ALERT_HIGH_VOLTS = 5.31f
 5V rail high-side alert threshold, in volts. More...
 
constexpr float RumPi::THRESHOLD_DISKUSAGE_WARNING_PERCENT = 80.0f
 Disk usage warning threshold, as a percent. More...
 
constexpr float RumPi::THRESHOLD_DISKUSAGE_ALERT_PERCENT = 90.0f
 Disk usage alert threshold, as a percent. More...
 
constexpr bool RumPi::THRESHOLD_DISKUSAGE_HIGHER_IS_WORSE = true
 High disk usage is worse. More...
 
constexpr float RumPi::THRESHOLD_MEMORY_WARNING_AVAILABLE_PERCENT = 15.0f
 Available-memory warning threshold, as a percent. More...
 
constexpr float RumPi::THRESHOLD_MEMORY_ALERT_AVAILABLE_PERCENT = 8.0f
 Available-memory alert threshold, as a percent (low available is bad). More...
 
constexpr float RumPi::THRESHOLD_MEMORY_WARNING_SWAP_PERCENT = 20.0f
 Swap-usage warning threshold, as a percent. More...
 
constexpr float RumPi::THRESHOLD_MEMORY_ALERT_SWAP_PERCENT = 50.0f
 Swap-usage alert threshold, as a percent (high swap is bad). More...
 
constexpr float RumPi::THRESHOLD_WIFISIGNAL_WARNING_DBM = -70.0f
 WiFi signal warning threshold, in dBm. More...
 
constexpr float RumPi::THRESHOLD_WIFISIGNAL_ALERT_DBM = -75.0f
 WiFi signal alert threshold, in dBm. More...
 
constexpr bool RumPi::THRESHOLD_WIFISIGNAL_HIGHER_IS_WORSE = false
 Low WiFi signal is worse (closer to 0 is stronger). More...