Arduino LMIC
6.0.1
Arduino LoRaWAN(r) MAC in C
Toggle main menu visibility
Loading...
Searching...
No Matches
lmic_implementation.h
1
/*
2
3
Module: lmic_implementation.h
4
5
Function:
6
Internal file containing LMIC implementation APIs
7
8
Copyright and License:
9
This file copyright (C) 2022 by
10
11
MCCI Corporation
12
3520 Krums Corners Road
13
Ithaca, NY 14850
14
15
See accompanying LICENSE file for copyright and license information.
16
17
Author:
18
Terry Moore, MCCI Corporation February 2022
19
20
*/
21
22
#ifndef _lmic_implementation_h_
23
#define _lmic_implementation_h_
/* prevent multiple includes */
24
25
#pragma once
26
27
#ifndef _lmic_h_
28
# include "
lmic.h
"
29
#endif
30
31
LMIC_BEGIN_DECLS
32
33
static
inline
bit_t LMICJ_isShutdown(
void
) {
34
return
(LMIC.opmode &
OP_SHUTDOWN
) != 0;
35
}
36
37
static
inline
bit_t LMICJ_isFsmIdle() {
38
return
! (LMIC.opmode & (
OP_SCAN
|
OP_TXRXPEND
|
OP_SHUTDOWN
));
39
}
40
41
static
inline
bit_t LMICJ_isTxPathBusy(
void
) {
42
return
(LMIC.opmode & (
OP_POLL
|
OP_TXDATA
|
OP_JOINING
|
OP_TXRXPEND
)) != 0;
43
}
44
45
static
inline
bit_t LMICJ_isTxRequested(
void
) {
46
return
(LMIC.opmode & (
OP_JOINING
|
OP_REJOIN
|
OP_TXDATA
|
OP_POLL
)) != 0;
47
}
48
49
static
inline
bit_t LMICJ_isActiveBeaconTracking(
void
) {
50
#if defined(DISABLE_BEACON)
51
return
0;
52
#else
53
return
(LMIC.opmode &
OP_TRACK
) != 0;
54
#endif
55
}
56
57
static
inline
bit_t LMICJ_isEnabledBeaconTracking(
void
) {
58
#if defined(DISABLE_BEACON) || defined(DISABLE_PING)
59
return
0;
60
#else
61
return
(LMIC.opmode & (
OP_SCAN
|
OP_TRACK
)) != 0;
62
#endif
63
}
64
73
static
inline
bit_t LMICJ_isEnabledClassB(
void
) {
74
#if defined(DISABLE_BEACON) || defined(DISABLE_PING)
75
return
0;
76
#else
77
return
(LMIC.opmode & (
OP_SCAN
|
OP_TRACK
)) != 0 && (LMIC.opmode &
OP_PINGABLE
) != 0;
78
#endif
79
}
80
84
static
inline
bit_t LMICJ_isActiveClassB(
void
) {
85
#if defined(DISABLE_BEACON) || defined(DISABLE_PING)
86
return
0;
87
#else
88
return
(LMIC.opmode & (
OP_TRACK
|
OP_PINGABLE
)) == (
OP_TRACK
|
OP_PINGABLE
);
89
#endif
// DISABLE_BEACKON
90
}
91
92
LMIC_END_DECLS
93
94
#endif
/* _lmic_implementation_h_ */
lmic.h
LMIC API.
OP_SCAN
@ OP_SCAN
radio scan to find a beacon
Definition
lmic.h:219
OP_JOINING
@ OP_JOINING
device joining in progress (blocks other activities)
Definition
lmic.h:221
OP_REJOIN
@ OP_REJOIN
occasionally send JOIN REQUEST
Definition
lmic.h:224
OP_TRACK
@ OP_TRACK
track my networks beacon (netid)
Definition
lmic.h:220
OP_TXDATA
@ OP_TXDATA
TX user data (buffered in pendTxData).
Definition
lmic.h:222
OP_PINGABLE
@ OP_PINGABLE
we're pingable
Definition
lmic.h:229
OP_SHUTDOWN
@ OP_SHUTDOWN
prevent MAC from doing anything
Definition
lmic.h:225
OP_POLL
@ OP_POLL
send empty UP frame to ACK confirmed DN/fetch more DN data
Definition
lmic.h:223
OP_TXRXPEND
@ OP_TXRXPEND
TX/RX transaction pending.
Definition
lmic.h:226
src
lmic
lmic_implementation.h
Generated on
for Arduino LMIC by
1.18.0