first commit
This commit is contained in:
48
components/ui/vars.c
Normal file
48
components/ui/vars.c
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <string.h>
|
||||
#include "vars.h"
|
||||
|
||||
char air_temperature[100] = { 0 };
|
||||
|
||||
const char *get_var_air_temperature() {
|
||||
return air_temperature;
|
||||
}
|
||||
|
||||
void set_var_air_temperature(const char *value) {
|
||||
strncpy(air_temperature, value, sizeof(air_temperature) / sizeof(char));
|
||||
air_temperature[sizeof(air_temperature) / sizeof(char) - 1] = 0;
|
||||
}
|
||||
|
||||
char air_humidity[100] = { 0 };
|
||||
|
||||
const char *get_var_air_humidity() {
|
||||
return air_humidity;
|
||||
}
|
||||
|
||||
void set_var_air_humidity(const char *value) {
|
||||
strncpy(air_humidity, value, sizeof(air_humidity) / sizeof(char));
|
||||
air_humidity[sizeof(air_humidity) / sizeof(char) - 1] = 0;
|
||||
}
|
||||
|
||||
|
||||
char soil_moisture[100] = { 0 };
|
||||
|
||||
const char *get_var_soil_moisture() {
|
||||
return soil_moisture;
|
||||
}
|
||||
|
||||
void set_var_soil_moisture(const char *value) {
|
||||
strncpy(soil_moisture, value, sizeof(soil_moisture) / sizeof(char));
|
||||
soil_moisture[sizeof(soil_moisture) / sizeof(char) - 1] = 0;
|
||||
}
|
||||
|
||||
char light_intensity[100] = { 0 };
|
||||
|
||||
const char *get_var_light_intensity() {
|
||||
return light_intensity;
|
||||
}
|
||||
|
||||
void set_var_light_intensity(const char *value) {
|
||||
strncpy(light_intensity, value, sizeof(light_intensity) / sizeof(char));
|
||||
light_intensity[sizeof(light_intensity) / sizeof(char) - 1] = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user