1515 * limitations under the License.
1616 */
1717
18+ /* * @addtogroup LoRaWAN
19+ * Mbed OS LoRaWAN Stack
20+ * @{
21+ */
22+
1823#ifndef LORAWANINTERFACE_H_
1924#define LORAWANINTERFACE_H_
2025
2530#include " LoRaRadio.h"
2631#include " lorawan_types.h"
2732
33+ // Forward declaration of LoRaPHY class
2834class LoRaPHY ;
2935
36+ /* * LoRaWANInterface Class
37+ * A network interface for LoRaWAN
38+ */
3039class LoRaWANInterface {
3140
3241public:
@@ -341,8 +350,7 @@ class LoRaWANInterface {
341350 * LORAWAN_STATUS_PORT_INVALID if trying to send to an invalid port (e.g. to 0)
342351 * LORAWAN_STATUS_PARAMETER_INVALID if NULL data pointer is given or flags are invalid.
343352 */
344- int16_t send (uint8_t port, const uint8_t *data,
345- uint16_t length, int flags);
353+ int16_t send (uint8_t port, const uint8_t *data, uint16_t length, int flags);
346354
347355 /* * Receives a message from the Network Server on a specific port.
348356 *
@@ -409,34 +417,37 @@ class LoRaWANInterface {
409417 *
410418 * An example of using this API with a latch onto 'lorawan_events' could be:
411419 *
412- * LoRaWANInterface lorawan(radio);
413- * lorawan_app_callbacks_t cbs;
414- * static void my_event_handler();
415- *
416- * int main()
417- * {
418- * lorawan.initialize();
419- * cbs.lorawan_events = mbed::callback(my_event_handler);
420- * lorawan.add_app_callbacks(&cbs);
421- * lorawan.connect();
422- * }
423- *
424- * static void my_event_handler(lorawan_event_t event)
425- * {
426- * switch(event) {
427- * case CONNECTED:
428- * //do something
429- * break;
430- * case DISCONNECTED:
431- * //do something
432- * break;
433- * case TX_DONE:
434- * //do something
435- * break;
436- * default:
437- * break;
438- * }
439- * }
420+ *\code
421+ * LoRaWANInterface lorawan(radio);
422+ * lorawan_app_callbacks_t cbs;
423+ * static void my_event_handler();
424+ *
425+ * int main()
426+ * {
427+ * lorawan.initialize();
428+ * cbs.lorawan_events = mbed::callback(my_event_handler);
429+ * lorawan.add_app_callbacks(&cbs);
430+ * lorawan.connect();
431+ * }
432+ *
433+ * static void my_event_handler(lorawan_event_t event)
434+ * {
435+ * switch(event) {
436+ * case CONNECTED:
437+ * //do something
438+ * break;
439+ * case DISCONNECTED:
440+ * //do something
441+ * break;
442+ * case TX_DONE:
443+ * //do something
444+ * break;
445+ * default:
446+ * break;
447+ * }
448+ * }
449+ *
450+ *\endcode
440451 *
441452 * @param callbacks A pointer to the structure containing application callbacks.
442453 *
@@ -523,18 +534,35 @@ class LoRaWANInterface {
523534 */
524535 lorawan_status_t cancel_sending (void );
525536
537+ /* * Provides exclusive access to the stack.
538+ *
539+ * Use only if the stack is being run in it's own separate thread.
540+ */
526541 void lock (void )
527542 {
528543 _lw_stack.lock ();
529544 }
545+
546+ /* * Releases exclusive access to the stack.
547+ *
548+ * Use only if the stack is being run in it's own separate thread.
549+ */
530550 void unlock (void )
531551 {
532552 _lw_stack.unlock ();
533553 }
534554
535555private:
556+ /* * ScopedLock object
557+ *
558+ * RAII style exclusive access
559+ */
536560 typedef mbed::ScopedLock<LoRaWANInterface> Lock;
537561
562+ /* * LoRaWANStack object
563+ *
564+ * Handle for the LoRaWANStack class
565+ */
538566 LoRaWANStack _lw_stack;
539567
540568 /* * PHY object if created by LoRaWANInterface
@@ -546,3 +574,4 @@ class LoRaWANInterface {
546574};
547575
548576#endif /* LORAWANINTERFACE_H_ */
577+ /* * @}*/
0 commit comments