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
40// return maximum frame length (including PHY header) for this data rate (us915); 0 --> not valid dr.
41uint8_t LMICus915_maxFrameLen(uint8_t dr);
42// return maximum frame length (including PHY header) for this data rate; 0 --> not valid dr.
43#define LMICbandplan_maxFrameLen(dr) LMICus915_maxFrameLen(dr)
44
45int8_t LMICus915_pow2dbm(uint8_t mcmd_ladr_p1);
46#define pow2dBm(mcmd_ladr_p1) LMICus915_pow2dbm(mcmd_ladr_p1)
47
48ostime_t LMICus915_dr2hsym(uint8_t dr);
49#define dr2hsym(dr) LMICus915_dr2hsym(dr)
50
51
52#define LMICbandplan_getInitialDrJoin() (LORAWAN_DR0)
53
54void LMICus915_setBcnRxParams(void);
55#define LMICbandplan_setBcnRxParams() LMICus915_setBcnRxParams()
56
57u4_t LMICus915_convFreq(xref2cu1_t ptr);
58#define LMICbandplan_convFreq(ptr) LMICus915_convFreq(ptr)
59
60static inline u1_t
61LMICus915_queryMaxRx1DrOffset(void) {
62 return 3;
63}
64#define LMICbandplan_queryMaxRx1DrOffset() LMICus915_queryMaxRx1DrOffset()
65
66void LMICus915_initJoinLoop(void);
67#define LMICbandplan_initJoinLoop() LMICus915_initJoinLoop()
68
69void LMICus915_setRx1Params(void);
70#define LMICbandplan_setRx1Params() LMICus915_setRx1Params()
71
72void LMICus915_updateTx(ostime_t txbeg);
73#define LMICbandplan_updateTx(txbeg) LMICus915_updateTx(txbeg)
74
75#undef LMICbandplan_validDR
76bit_t LMICus915_validDR(dr_t dr);
77#define LMICbandplan_validDR(dr) LMICus915_validDR(dr)
78
79#endif // _lmic_bandplan_us915_h_