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