forked from gioblu/PJON
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTiming.h
56 lines (45 loc) · 2 KB
/
Timing.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/* ThroughLora data link layer
Proposed and developed by Matheus Eduardo Garbelini
____________________________________________________________________________
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
/* Maximum 1 second random initial delay */
#ifndef TL_INITIAL_DELAY
#define TL_INITIAL_DELAY 1000
#endif
/* Maximum 32 microseconds random delay in case of collision */
#ifndef TL_COLLISION_DELAY
#define TL_COLLISION_DELAY 64
#endif
/* Set 100 milliseconds as the maximum timeframe between transmission and
synchronous acknowledgement response. This value is strictly related to the
maximum time needed by receiver to receive, compute and transmit a response.
Higher if necessary. */
#ifndef TL_RESPONSE_TIME_OUT
#define TL_RESPONSE_TIME_OUT 100000
#endif
/* Maximum transmission attempts (re-transmission not supported) */
#ifndef TL_MAX_ATTEMPTS
#define TL_MAX_ATTEMPTS 5
#endif
/* Back-off exponential degree (re-transmission not supported) */
#ifndef TL_BACK_OFF_DEGREE
#define TL_BACK_OFF_DEGREE 5
#endif
/* Response length (the response is composed by the last TL_RESPONSE_LENGTH
bytes of the packet received). By default should be relatively safe.
(Few false positives per millennia)
If you are ready to trade safety for bandwidth reduce it, consider that
setting TL_RESPONSE_LENGTH < 4 reduces reliability and leads to higher
chances of detecting a false positive. */
#ifndef TL_RESPONSE_LENGTH
#define TL_RESPONSE_LENGTH 5
#endif