Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
include
general
node_cfg.h
Go to the documentation of this file.
1
#ifndef NODE_CFG_H
2
#define NODE_CFG_H
3
4
#include <stdint.h>
5
6
#if defined(MASTER_NODE) + defined(SLAVE_NODE) != 1
7
#error Currently Master and Slave Node define is set, please choose one
8
#endif
9
10
#define MAX_SLAVE_NUM 16
11
#define MEASURE_INTERVAL_SEC 30
// two minutes. set higher later
12
#define LAT_LON_TO_UINT 1e6
13
#define SEC_TO_US 1000000ULL
14
15
typedef
struct
16
{
17
uint8_t
identifier
;
18
uint64_t
last_notified
;
19
uint8_t mac_address[6];
// slave puts master mac, master puts slave mac
20
char
name[32];
21
int32_t
lat
;
22
int32_t
lon
;
23
uint8_t
battery_percentage
;
24
uint8_t
moisture
;
25
26
uint8_t
alarm
;
27
uint8_t
registered
;
28
}
slave_data
;
29
30
#endif
slave_data
Definition
node_cfg.h:16
slave_data::registered
uint8_t registered
Definition
node_cfg.h:27
slave_data::identifier
uint8_t identifier
Definition
node_cfg.h:17
slave_data::alarm
uint8_t alarm
Definition
node_cfg.h:26
slave_data::battery_percentage
uint8_t battery_percentage
Definition
node_cfg.h:23
slave_data::lat
int32_t lat
Definition
node_cfg.h:21
slave_data::moisture
uint8_t moisture
Definition
node_cfg.h:24
slave_data::lon
int32_t lon
Definition
node_cfg.h:22
slave_data::last_notified
uint64_t last_notified
Definition
node_cfg.h:18
Generated by
1.9.8