Files
linuxSmartie/include/sys.h

48 lines
852 B
C

#ifndef LINUXSMARTIE_SYS_H
#define LINUXSMARTIE_SYS_H
#include <stdint.h>
struct time_date_t {
char date[12];
char time[9];
};
struct memory_t {
uint64_t free;
uint64_t used;
uint64_t total;
};
struct disk_t {
struct memory_t usage;
char mountpoint[64];
};
struct network_t {
uint32_t download;
uint32_t upload;
char device[16];
};
struct syssensors_t {
uint16_t fan_speed[1]; // just one fan (pump) we monitor
int16_t t_sensor; // ntc temp sensor
char hwmon[64];
};
void sys_get_time(struct time_date_t *td);
void sys_get_load_avg(double *load_avg);
void sys_get_ram(struct memory_t *ram);
void sys_get_disk(struct disk_t *disk);
void sys_get_network(struct network_t *network);
void sys_detect(struct syssensors_t *s, const char *platform);
void sys_update_sensors(struct syssensors_t *s);
#endif // LINUXSMARTIE_SYS_H