@@ -88,78 +88,29 @@ class LoRaWANStack: private mbed::NonCopyable<LoRaWANStack> {
88
88
89
89
/* * Connect OTAA or ABP using Mbed-OS config system
90
90
*
91
- * Connect by Over The Air Activation or Activation By Personalization.
92
- * You need to configure the connection properly via the Mbed OS configuration
93
- * system.
94
- *
95
- * When connecting via OTAA, the return code for success (LORAWAN_STATUS_CONNECT_IN_PROGRESS) is negative.
96
- * However, this is not a real error. It tells you that the connection is in progress and you will
97
- * be notified of the completion via an event. By default, after the Join Accept message
98
- * is received, base stations may provide the node with a CF-List that replaces
99
- * all user-configured channels except the Join/Default channels. A CF-List can
100
- * configure a maximum of five channels other than the default channels.
101
- *
102
- * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns.
103
- * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection.
104
- * By default, the PHY layers configure only the mandatory Join channels. The retransmission back-off restrictions
105
- * on these channels are severe and you may experience long delays or even failures in the confirmed traffic.
106
- * If you add more channels, the aggregated duty cycle becomes much more relaxed as compared to the Join (default) channels only.
107
- *
108
- * **NOTES ON RECONNECTION:**
109
- * Currently, the Mbed OS LoRaWAN implementation does not support non-volatile
110
- * memory storage. Therefore, the state and frame counters cannot be restored after
111
- * a power cycle. However, if you use the `disconnect()` API to shut down the LoRaWAN
112
- * protocol, the state and frame counters are saved. Connecting again would try to
113
- * restore the previous session. According to the LoRaWAN 1.0.2 specification, the frame counters are always reset
114
- * to zero for OTAA and a new Join request lets the network server know
115
- * that the counters need a reset. The same is said about the ABP but there
116
- * is no way to convey this information to the network server. For a network
117
- * server, an ABP device is always connected. That's why storing the frame counters
118
- * is important, at least for ABP. That's why we try to restore frame counters from
119
- * session information after a disconnection.
120
- *
121
- * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS
122
- * on success, or a negative error code on failure.
91
+ * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by
92
+ * a 'CONNECTED' event. Otherwise a negative error code is returned.
93
+ * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows.
94
+ *
95
+ * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call.
96
+ * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection
97
+ * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully).
98
+ * A 'CONNECTED' event is sent to the application when the JoinAccept is received.
123
99
*/
124
100
lorawan_status_t connect ();
125
101
126
102
/* * Connect OTAA or ABP with parameters
127
- *
128
- * All connection parameters are chosen by the user and provided in the
129
- * data structure passed down.
130
- *
131
- * When connecting via OTAA, the return code for success (LORAWAN_STATUS_CONNECT_IN_PROGRESS) is negative.
132
- * However, this is not a real error. It tells you that connection is in progress and you will
133
- * be notified of completion via an event. By default, after Join Accept message
134
- * is received, base stations may provide the node with a CF-List which replaces
135
- * all user-configured channels except the Join/Default channels. A CF-List can
136
- * configure a maximum of five channels other than the default channels.
137
- *
138
- * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns.
139
- * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection.
140
- * By default, the PHY layers configure only the mandatory Join
141
- * channels. The retransmission back-off restrictions on these channels
142
- * are severe and you may experience long delays or even
143
- * failures in the confirmed traffic. If you add more channels, the aggregated duty
144
- * cycle becomes much more relaxed as compared to the Join (default) channels only.
145
- *
146
- * **NOTES ON RECONNECTION:**
147
- * Currently, the Mbed OS LoRaWAN implementation does not support non-volatile
148
- * memory storage. Therefore, the state and frame counters cannot be restored after
149
- * a power cycle. However, if you use the `disconnect()` API to shut down the LoRaWAN
150
- * protocol, the state and frame counters are saved. Connecting again would try to
151
- * restore the previous session. According to the LoRaWAN 1.0.2 specification, the frame counters are always reset
152
- * to zero for OTAA and a new Join request lets the network server know
153
- * that the counters need a reset. The same is said about the ABP but there
154
- * is no way to convey this information to the network server. For a network
155
- * server, an ABP device is always connected. That's why storing the frame counters
156
- * is important, at least for ABP. That's why we try to restore frame counters from
157
- * session information after a disconnection.
158
103
*
159
104
* @param connect Options for an end device connection to the gateway.
160
105
*
161
- * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS,
162
- * a negative error code on failure.
106
+ * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by
107
+ * a 'CONNECTED' event. Otherwise a negative error code is returned.
108
+ * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows.
109
+ *
110
+ * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call.
111
+ * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection
112
+ * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully).
113
+ * A 'CONNECTED' event is sent to the application when the JoinAccept is received.
163
114
*/
164
115
lorawan_status_t connect (const lorawan_connect_t &connect);
165
116
0 commit comments