@@ -30,12 +30,39 @@ Copyright & License:
30
30
| static binding.
31
31
\****************************************************************************/
32
32
33
+ #if defined(_DOXYGEN_ )
34
+ /// \brief Select the secure-element driver
35
+ ///
36
+ /// \details
37
+ /// This macro must be set to the name used by the secure element driver for
38
+ /// its API functions. The default is `Default`.
39
+ ///
40
+ /// \hideinitializer
41
+ ///
42
+ # define LMIC_CFG_SecureElement_DRIVER Default
43
+
44
+ /// \brief Select linkage style
45
+ ///
46
+ /// \details
47
+ /// If this macro is defined and non-zero, the secure element will
48
+ /// be integrated with the LMIC at compile time. If defined and zero,
49
+ /// the secure element driver will be accessed via external functions,
50
+ /// allowing the integration to be deferred to link time or run time.
51
+ ///
52
+ /// \note
53
+ /// At present, only compile-time integration is implemented.
54
+ ///
55
+ /// \hideinitializer
56
+ ////
57
+ # define LMIC_ENABLE_SecureElement_STATIC 1
58
+ #endif
59
+
33
60
#if ! defined(LMIC_CFG_SecureElement_DRIVER )
34
61
# define LMIC_CFG_SecureElement_DRIVER Default
35
62
#endif
36
63
37
64
#if ! defined(LMIC_ENABLE_SecureElement_STATIC )
38
- #define LMIC_ENABLE_SecureElement_STATIC 1
65
+ # define LMIC_ENABLE_SecureElement_STATIC 1
39
66
#endif
40
67
41
68
/****************************************************************************\
@@ -71,12 +98,65 @@ LMIC_SecureElement_aes128Encrypt_t LMIC_SecureElement_aes128Encrypt;
71
98
/*
72
99
|| Use static linkage for the APIs.
73
100
*/
101
+
102
+ /// \brief Generate a method function name without argument expansion
103
+ /// \param a_driver The name of the driver (will be macro-expanded)
104
+ /// \param a_fn The function-name fragment (will be macro-expanded)
105
+ ///
106
+ /// \details
107
+ /// This macro is like \ref LMIC_SecureElement_METHOD() except that
108
+ /// macros in the arguments are not expanded prior performing string substitution.
109
+ ///
110
+ /// For example, writing:
111
+ ///
112
+ /// \code
113
+ /// #define LMIC_CFG_SecureElement_DRIVER Foo
114
+ /// LMIC_SecureElement_METHOD(LMIC_CFG_SecureElement_DRIVER, initialize)();
115
+ /// \endcode
116
+ ///
117
+ /// is the same as writing:
118
+ ///
119
+ /// \code
120
+ /// LMIC_SecureElement_LMIC_CFG_SecureElement_DRIVER_initialize();
121
+ /// \endcode
122
+ ///
123
+ /// \see LMIC_SecureElement_METHOD()
124
+ /// \hideinitializer
125
+ ///
74
126
#define LMIC_SecureElement_METHOD_ (a_driver , a_fn ) \
75
127
(LMIC_SecureElement_##a_driver##_##a_fn)
128
+
129
+ /// \brief Generate a method function name
130
+ /// \param a_driver The name of the driver (will be macro-expanded)
131
+ /// \param a_fn The function-name fragment (will be macro-expanded)
132
+ ///
133
+ /// \details
134
+ /// This macro returns a standard method function name. Standard method
135
+ /// function names begin with `LMIC_SecureElement_`, followed by _a_driver_,
136
+ /// followed by an underscore `_`, and ending with _a_fn_.
137
+ /// For example, writing:
138
+ ///
139
+ /// \code
140
+ /// #define LMIC_CFG_SecureElement_DRIVER Foo
141
+ /// LMIC_SecureElement_METHOD(LMIC_CFG_SecureElement_DRIVER, initialize)();
142
+ /// \endcode
143
+ ///
144
+ /// is the same as writing:
145
+ ///
146
+ /// \code
147
+ /// LMIC_SecureElement_Foo_initialize();
148
+ /// \endcode
149
+ ///
150
+ /// This macro is primarily intended for internal use.
151
+ ///
152
+ /// \hideinitializer
153
+ ///
76
154
#define LMIC_SecureElement_METHOD (a_driver , a_fn ) \
77
155
LMIC_SecureElement_METHOD_(a_driver, a_fn)
78
156
157
+ /// \cond FALSE
79
158
LMIC_SecureElement_DECLARE_DRIVER_FNS (Default );
159
+ /// \endcond
80
160
81
161
/// \copydoc LMIC_SecureElement_initialize_t
82
162
static inline
@@ -200,7 +280,7 @@ LMIC_SecureElement_Error_t LMIC_ABI_STD
200
280
LMIC_SecureElement_decodeMessage (
201
281
const uint8_t * pPhyPayload , uint8_t nPhyPayload ,
202
282
uint32_t devAddr , uint32_t FCntDown ,
203
- LMIC_SecureElement_KeySelector_t iKey ,
283
+ LMIC_SecureElement_KeySelector_t iKey ,
204
284
uint8_t * pClearTextBuffer
205
285
) {
206
286
return LMIC_SecureElement_METHOD (LMIC_CFG_SecureElement_DRIVER , decodeMessage )(
0 commit comments