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