LoRaMesher Library
0.0.5
A LoRa Mesh library for the IoT
BuildOptions.h
1
#ifndef _LORAMESHER_BUILD_OPTIONS_H
2
#define _LORAMESHER_BUILD_OPTIONS_H
3
4
// LoRa band definition
5
// 433E6 for Asia
6
// 866E6 for Europe
7
// 915E6 for North America
8
#define LM_BAND 868.0F
9
#define LM_BANDWIDTH 125.0F
10
#define LM_LORASF 7U
// Spreading factor 6-12 (default 7)
11
#define LM_CODING_RATE 7U
12
#define LM_PREAMBLE_LENGTH 8U
13
#define LM_POWER 10
14
#define LM_DUTY_CYCLE 1
//In %
15
16
//Syncronization Word that identifies the mesh network
17
#define LM_SYNC_WORD 19U
18
19
// Comment this line if you want to remove the crc for each packet
20
#define LM_ADDCRC_PAYLOAD
21
22
// Routing table max size
23
#define RTMAXSIZE 256
24
25
//MAX packet size per packet
26
//If exceed it will be automatically separated through multiple packets
27
//In bytes (226 bytes [UE max allowed with SF7 and 125khz])
28
//MAX payload size for hello packets = MAXPACKETSIZE - 6 bytes of header
29
//MAX payload size for data packets = MAXPACKETSIZE - 6 bytes of header - 2 bytes of via
30
//MAX payload size for reliable and large packets = MAXPACKETSIZE - 6 bytes of header - 2 bytes of via - 3 of control packet
31
#define MAXPACKETSIZE 222
32
33
// Packet types
34
#define NEED_ACK_P 0b00000001
35
#define DATA_P 0b00000010
36
#define HELLO_P 0b00000100
37
#define ACK_P 0b00001000
38
#define XL_DATA_P 0b00010000
39
#define LOST_P 0b00100000
40
#define SYNC_P 0b01000000
41
42
// Packet configuration
43
#define BROADCAST_ADDR 0xFFFF
44
#define DEFAULT_PRIORITY 20
45
#define MAX_PRIORITY 40
46
47
//Definition Times in seconds
48
#define HELLO_PACKETS_DELAY 300
49
#define DEFAULT_TIMEOUT HELLO_PACKETS_DELAY*3
50
51
//Maximum times that a sequence of packets reach the timeout
52
#define MAX_TIMEOUTS 3
53
#define MAX_RESEND_PACKET 3
54
55
#endif
LoRaMesher
src
BuildOptions.h
Generated by
1.9.3