From 18b1ac50226d762bf82500d4915d65433d9cb6f1 Mon Sep 17 00:00:00 2001
From: Alexandre Abadie <alexandre.abadie@inria.fr>
Date: Tue, 9 Jan 2018 21:16:59 +0100
Subject: [PATCH] sys/net/loramac: various improvements

- add missing typedef enums
- add default device class parameter
---
 sys/include/net/loramac.h | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/sys/include/net/loramac.h b/sys/include/net/loramac.h
index 8621e95191..31b2cbcfba 100644
--- a/sys/include/net/loramac.h
+++ b/sys/include/net/loramac.h
@@ -101,6 +101,13 @@ extern "C" {
  * @name    LoRaMAC default values
  * @{
  */
+/**
+ * @brief   Default device class (A, B or C)
+ */
+#ifndef LORAMAC_DEVICE_CLASS
+#define LORAMAC_DEVICE_CLASS            (LORAMAC_CLASS_A)
+#endif
+
 /**
  * @brief   Default NetID (only valid with ABP join procedure)
  */
@@ -316,18 +323,18 @@ typedef enum {
 /**
  * @brief   LoRaMAC network join procedure type
  */
-enum {
+typedef enum {
     LORAMAC_JOIN_OTAA,                 /**< Other-the-air activation */
     LORAMAC_JOIN_ABP,                  /**< Activation by personnalization */
-};
+} loramac_join_mode_t;
 
 /**
  * @brief   LoRaMAC transmission mode
  */
-enum {
+typedef enum {
     LORAMAC_TX_CNF,                    /**< Confirmable transmission mode */
     LORAMAC_TX_UNCNF,                  /**< Unconfirmable transmission mode */
-};
+} loramac_tx_mode_t;
 
 /**
  * @brief   LoRaMAC datarate indexes
@@ -335,7 +342,7 @@ enum {
  *          Each index corresponds to a different modulation, spreading factor
  *          and bandwidth depending on the regions.
  */
-enum {
+typedef enum {
     /**
      * - ISM EU863-870: LoRa modulation, SF12, BW125 (250bit/s)
      * - ISM US902-928: LoRa modulation, SF10, BW125 (980bit/s)
@@ -514,7 +521,7 @@ enum {
      * - ISM KR920-923: reserved for future use
      */
     LORAMAC_DR_15,
-};
+} loramac_dr_idx_t;
 
 /**
  * @brief   LoRaMAC transmission power indexes
@@ -522,7 +529,7 @@ enum {
  *          Each index corresponds to a different modulation, spreading factor
  *          and bandwidth depending on the regions.
  */
-enum {
+typedef enum {
     /**
      * - EU863-870: 20dBm (if supported)
      * - US902-928: 30dBm (if supported)
@@ -701,7 +708,7 @@ enum {
      * - ISM KR920-923: Reserved for future use
      */
     LORAMAC_TX_PWR_15,
-};
+} loramac_tx_pwr_idx_t;
 /** @} */
 
 /**
-- 
GitLab