Arduino LMIC 6.0.1
Arduino LoRaWAN(r) MAC in C
Loading...
Searching...
No Matches
lmic_bandplan_us915.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_bandplan_us915_h_
30# define _lmic_bandplan_us915_h_
31
32// preconditions for lmic_us_like.h
33#define LMICuslike_getFirst500kHzDR() (LORAWAN_DR4)
34#define LMICuslike_getJoin125kHzDR() (LORAWAN_DR0)
35
36#ifndef _lmic_us_like_h_
37# include "lmic_us_like.h"
38#endif
39
40LMIC_BEGIN_DECLS
41
42// return maximum frame length (including PHY header) for this data rate (us915); 0 --> not valid dr.
43uint8_t LMICus915_maxFrameLen(uint8_t dr);
44// return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr.
45#define LMICbandplan_maxFrameLen(dr) LMICus915_maxFrameLen(dr)
46
47int8_t LMICus915_pow2dbm(uint8_t mcmd_ladr_p1);
48#define pow2dBm(mcmd_ladr_p1) LMICus915_pow2dbm(mcmd_ladr_p1)
49
50ostime_t LMICus915_dr2hsym(uint8_t dr);
51#define dr2hsym(dr) LMICus915_dr2hsym(dr)
52
53
54#define LMICbandplan_getInitialDrJoin() (LORAWAN_DR0)
55
56void LMICus915_setBcnRxParams(void);
57#define LMICbandplan_setBcnRxParams() LMICus915_setBcnRxParams()
58
59u4_t LMICus915_convFreq(xref2cu1_t ptr);
60#define LMICbandplan_convFreq(ptr) LMICus915_convFreq(ptr)
61
62static inline u1_t
63LMICus915_queryMaxRx1DrOffset(void) {
64 return 3;
65}
66#define LMICbandplan_queryMaxRx1DrOffset() LMICus915_queryMaxRx1DrOffset()
67
68void LMICus915_initJoinLoop(void);
69#define LMICbandplan_initJoinLoop() LMICus915_initJoinLoop()
70
71void LMICus915_setRx1Params(void);
72#define LMICbandplan_setRx1Params() LMICus915_setRx1Params()
73
74void LMICus915_updateTx(ostime_t txbeg);
75#define LMICbandplan_updateTx(txbeg) LMICus915_updateTx(txbeg)
76
77#undef LMICbandplan_validDR
78bit_t LMICus915_validDR(dr_t dr);
79#define LMICbandplan_validDR(dr) LMICus915_validDR(dr)
80
82u4_t LMICus915_queryChannelUplinkFreq(u1_t channel);
83#define LMICbandplan_queryChannelUplinkFreq(ch) LMICus915_queryChannelUplinkFreq(ch)
84
86u4_t LMICus915_queryChannelDownlinkFreq(u1_t channel);
87#define LMICbandplan_queryChannelDownlinkFreq(ch) LMICus915_queryChannelDownlinkFreq(ch)
88
89LMIC_END_DECLS
90
91#endif // _lmic_bandplan_us915_h_