STIMA  3
sensor_config.h
1 #include <sensors_config.h>
2 #include <mqtt_config.h>
3 #include <constantdata_config.h>
4 #include <gsm_config.h>
5 #include <ntp_config.h>
6 #include <ntp_config.h>
7 #include <typedef.h>
8 
9 
10 /*********************************************************************
11 * TYPEDEF
12 *********************************************************************/
13 
18 typedef struct {
22 
27 typedef struct {
28  uint8_t module_main_version;
29  uint8_t module_configuration_version;
30  uint8_t module_type;
31 
32  #if (USE_MQTT)
33  uint16_t mqtt_port;
34  char mqtt_server[MQTT_SERVER_LENGTH];
35  char mqtt_root_topic[MQTT_ROOT_TOPIC_LENGTH];
36  char mqtt_maint_topic[MQTT_MAINT_TOPIC_LENGTH];
37  char mqtt_rpc_topic[MQTT_RPC_TOPIC_LENGTH];
38  char mqtt_username[MQTT_USERNAME_LENGTH];
39  char mqtt_password[MQTT_PASSWORD_LENGTH];
40  char stationslug[STATIONSLUG_LENGTH];
41  char boardslug[BOARDSLUG_LENGTH];
42  #endif
43 
44  #if (USE_NTP)
45  char ntp_server[NTP_SERVER_LENGTH];
46  #endif
47 
48  sensor_t sensors[SENSORS_MAX];
49  uint8_t sensors_count;
50  uint16_t report_seconds;
51 
54 
55  #if (MODULE_TYPE == STIMA_MODULE_TYPE_SAMPLE_ETH || MODULE_TYPE == STIMA_MODULE_TYPE_REPORT_ETH || MODULE_TYPE == STIMA_MODULE_TYPE_PASSIVE_ETH)
57  uint8_t ethernet_mac[ETHERNET_MAC_LENGTH];
58  uint8_t ip[ETHERNET_IP_LENGTH];
59  uint8_t netmask[ETHERNET_IP_LENGTH];
60  uint8_t gateway[ETHERNET_IP_LENGTH];
61  uint8_t primary_dns[ETHERNET_IP_LENGTH];
62 
63  #elif (MODULE_TYPE == STIMA_MODULE_TYPE_SAMPLE_GSM || MODULE_TYPE == STIMA_MODULE_TYPE_REPORT_GSM || MODULE_TYPE == STIMA_MODULE_TYPE_PASSIVE_GSM)
64  char gsm_apn[GSM_APN_LENGTH];
65  char gsm_username[GSM_USERNAME_LENGTH];
66  char gsm_password[GSM_PASSWORD_LENGTH];
67 
68  #endif
70 
#define MQTT_SERVER_LENGTH
Length in bytes for mqtt server.
Definition: mqtt_config.h:66
#define MQTT_USERNAME_LENGTH
Length in bytes for mqtt username.
Definition: mqtt_config.h:72
#define MQTT_MAINT_TOPIC_LENGTH
Length in bytes for mqtt maint topic.
Definition: mqtt_config.h:36
#define MQTT_ROOT_TOPIC_LENGTH
Length in bytes for mqtt root topic.
Definition: mqtt_config.h:30
#define MQTT_PASSWORD_LENGTH
Length in bytes for mqtt password.
Definition: mqtt_config.h:78
#define MQTT_RPC_TOPIC_LENGTH
Length in bytes for mqtt rpc topic.
Definition: mqtt_config.h:42
#define CONSTANTDATA_VALUE_LENGTH
Maximum lenght of value plus terminator for one constant data.
Definition: constantdata_config.h:36
#define CONSTANTDATA_BTABLE_LENGTH
Maximum lenght of btable code plus terminator that describe one constant data.
Definition: constantdata_config.h:30
#define ETHERNET_MAC_LENGTH
Length in bytes for mac address.
Definition: ethernet_config.h:96
#define ETHERNET_IP_LENGTH
Length in bytes for ip address.
Definition: ethernet_config.h:102
#define GSM_USERNAME_LENGTH
Length in bytes for username.
Definition: gsm_config.h:72
#define GSM_PASSWORD_LENGTH
Length in bytes for password.
Definition: gsm_config.h:78
#define GSM_APN_LENGTH
Length in bytes for apn.
Definition: gsm_config.h:66
#define STATIONSLUG_LENGTH
Length in bytes for station slug.
Definition: mqtt_config.h:102
#define BOARDSLUG_LENGTH
Length in bytes for board slug.
Definition: mqtt_config.h:108
#define NTP_SERVER_LENGTH
Length in bytes for ntp server data buffer.
Definition: ntp_config.h:30
#define USE_CONSTANTDATA_COUNT
Constantdata count.
Definition: stima-config.h:430
EEPROM saved configuration.
Definition: i2c-leaf.h:55
bool is_dhcp_enable
dhcp status
Definition: sensor_config.h:56
uint16_t report_seconds
seconds for report values
Definition: sensor_config.h:50
uint8_t constantdata_count
configured constantdata number
Definition: sensor_config.h:53
uint8_t sensors_count
configured sensors number
Definition: sensor_config.h:49
Definition: sensor_config.h:18
sensors configuration.
Definition: typedef.h:112