Safe Sprinkler
Master/slave irrigation system (ESP-NOW + LoRaWAN)
Loading...
Searching...
No Matches
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
15typedef 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;
24 uint8_t moisture;
25
26 uint8_t alarm;
27 uint8_t registered;
29
30#endif
Definition node_cfg.h:16
uint8_t registered
Definition node_cfg.h:27
uint8_t identifier
Definition node_cfg.h:17
uint8_t alarm
Definition node_cfg.h:26
uint8_t battery_percentage
Definition node_cfg.h:23
int32_t lat
Definition node_cfg.h:21
uint8_t moisture
Definition node_cfg.h:24
int32_t lon
Definition node_cfg.h:22
uint64_t last_notified
Definition node_cfg.h:18