Arduino LMIC 6.0.1
Arduino LoRaWAN(r) MAC in C
Loading...
Searching...
No Matches
lmic_bandplan_au915.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_au915_h_
30# define _lmic_bandplan_au915_h_
31
32// preconditions for lmic_us_like.h
33#define LMICuslike_getFirst500kHzDR() (LORAWAN_DR6)
34#define LMICuslike_getJoin125kHzDR() (LORAWAN_DR2)
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 (au915); 0 --> not valid dr.
41uint8_t LMICau915_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) LMICau915_maxFrameLen(dr)
44
45int8_t LMICau915_pow2dbm(uint8_t mcmd_ladr_p1);
46#define pow2dBm(mcmd_ladr_p1) LMICau915_pow2dbm(mcmd_ladr_p1)
47
48ostime_t LMICau915_dr2hsym(uint8_t dr);
49#define dr2hsym(dr) LMICau915_dr2hsym(dr)
50
51
52#define LMICbandplan_getInitialDrJoin() (LORAWAN_DR2)
53
54void LMICau915_initJoinLoop(void);
55#define LMICbandplan_initJoinLoop() LMICau915_initJoinLoop()
56
57void LMICau915_setBcnRxParams(void);
58#define LMICbandplan_setBcnRxParams() LMICau915_setBcnRxParams()
59
60u4_t LMICau915_convFreq(xref2cu1_t ptr);
61#define LMICbandplan_convFreq(ptr) LMICau915_convFreq(ptr)
62
63static inline u1_t
64LMICau915_queryMaxRx1DrOffset(void) {
65 return 5;
66}
67#define LMICbandplan_queryMaxRx1DrOffset() LMICau915_queryMaxRx1DrOffset()
68
69void LMICau915_setRx1Params(void);
70#define LMICbandplan_setRx1Params() LMICau915_setRx1Params()
71
72void LMICau915_updateTx(ostime_t txbeg);
73#define LMICbandplan_updateTx(txbeg) LMICau915_updateTx(txbeg)
74
75#undef LMICbandplan_validDR
76bit_t LMICau915_validDR(dr_t dr);
77#define LMICbandplan_validDR(dr) LMICau915_validDR(dr)
78
79#endif // _lmic_bandplan_au915_h_