Arduino LMIC
6.0.1
Arduino LoRaWAN(r) MAC in C
Toggle main menu visibility
Loading...
Searching...
No Matches
lmic_bandplan_eu868.h
1
/*
2
* Copyright (c) 2014-2016 IBM Corporation.
3
* Copyright (c) 2017, 2019-2021 MCCI Corporation.
4
* All rights reserved.
5
*
6
* Redistribution and use in source and binary forms, with or without
7
* modification, are permitted provided that the following conditions are met:
8
* * Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* * Redistributions in binary form must reproduce the above copyright
11
* notice, this list of conditions and the following disclaimer in the
12
* documentation and/or other materials provided with the distribution.
13
* * Neither the name of the <organization> nor the
14
* names of its contributors may be used to endorse or promote products
15
* derived from this software without specific prior written permission.
16
*
17
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
* DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
21
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
*/
28
29
#ifndef _lmic_eu868_h_
30
# define _lmic_eu868_h_
31
32
#ifndef _lmic_eu_like_h_
33
# include "lmic_eu_like.h"
34
#endif
35
36
LMIC_BEGIN_DECLS
37
38
// return maximum frame length (including PHY header) for this data rate (eu868); 0 --> not valid dr.
39
uint8_t LMICeu868_maxFrameLen(uint8_t dr);
40
// return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr.
41
#define LMICbandplan_maxFrameLen(dr) LMICeu868_maxFrameLen(dr)
42
43
int8_t LMICeu868_pow2dBm(uint8_t mcmd_ladr_p1);
44
#define pow2dBm(mcmd_ladr_p1) LMICeu868_pow2dBm(mcmd_ladr_p1)
45
46
// Times for half symbol per DR
47
// Per DR table to minimize rounding errors
48
ostime_t LMICeu868_dr2hsym(uint8_t dr);
49
#define dr2hsym(dr) LMICeu868_dr2hsym(dr)
50
51
52
// TODO(tmm@mcci.com) this looks bogus compared to current 1.02 regional
53
// spec. https://github.com/mcci-catena/arduino-lmic/issues/18
54
static
inline
int
55
LMICeu868_isValidBeacon1(
const
uint8_t *d) {
56
return
d[OFF_BCN_CRC1] != (u1_t)os_crc16(d, OFF_BCN_CRC1);
57
}
58
59
#undef LMICbandplan_isValidBeacon1
60
#define LMICbandplan_isValidBeacon1(pFrame) LMICeu868_isValidBeacon1(pFrame)
61
62
// override default for LMICbandplan_isFSK()
63
#undef LMICbandplan_isFSK
64
#define LMICbandplan_isFSK() (
/* RX datarate */
LMIC.dndr == EU868_DR_FSK)
65
66
#define LMICbandplan_getInitialDrJoin() (EU868_DR_SF7)
67
68
void
LMICeu868_setBcnRxParams(
void
);
69
#define LMICbandplan_setBcnRxParams() LMICeu868_setBcnRxParams()
70
71
u4_t LMICeu868_convFreq(xref2cu1_t ptr);
72
#define LMICbandplan_convFreq(ptr) LMICeu868_convFreq(ptr)
73
74
static
inline
u1_t
75
LMICeu868_queryMaxRx1DrOffset(
void
) {
76
return
5;
77
}
78
#define LMICbandplan_queryMaxRx1DrOffset() LMICeu868_queryMaxRx1DrOffset()
79
80
void
LMICeu868_initJoinLoop(
void
);
81
#define LMICbandplan_initJoinLoop() LMICeu868_initJoinLoop()
82
83
ostime_t LMICeu868_nextTx(ostime_t now);
84
#define LMICbandplan_nextTx(now) LMICeu868_nextTx(now)
85
86
ostime_t LMICeu868_nextJoinState(
void
);
87
#define LMICbandplan_nextJoinState() LMICeu868_nextJoinState()
88
89
void
LMICeu868_initDefaultChannels(bit_t join);
90
#define LMICbandplan_initDefaultChannels(join) LMICeu868_initDefaultChannels(join)
91
92
#undef LMICbandplan_nextJoinTime
93
ostime_t LMICeu868_nextJoinTime(ostime_t now);
94
#define LMICbandplan_nextJoinTime(now) LMICeu868_nextJoinTime(now)
95
96
void
LMICeu868_setRx1Params(
void
);
97
#define LMICbandplan_setRx1Params() LMICeu868_setRx1Params()
98
99
#undef LMICbandplan_validDR
100
bit_t LMICeu868_validDR(dr_t dr);
101
#define LMICbandplan_validDR(dr) LMICeu868_validDR(dr)
102
103
LMIC_END_DECLS
104
105
#endif
// _lmic_eu868_h_
src
lmic
lmic_bandplan_eu868.h
Generated on
for Arduino LMIC by
1.18.0