[riot-notifications] [RIOT-OS/RIOT] net/lorawan/hdr: add lorawan header helpers (#11143)

Alexandre Abadie notifications at github.com
Mon Mar 11 21:03:19 CET 2019


aabadie commented on this pull request.



> +    uint8_t app_nonce[LORAMAC_APP_NONCE_LEN];   /**< application nonce */
+    uint8_t net_id[LORAMAC_NETWORK_ID_LEN];     /**< network id */
+    uint8_t dev_addr[LORAMAC_DEVADDR_LEN];      /**< device address */
+    uint8_t dl_settings;                        /**< downlink settings */
+    uint8_t rx_delay;                           /**< first reception window delay */
+} lorawan_join_accept_t;
+
+/**
+ * @brief Set LoRaWAN header MType
+ *
+ * @param[in] hdr LoRaWAN hdr
+ * @param[in] mtype desired MType
+ */
+static inline void lorawan_hdr_set_mtype(lorawan_hdr_t *hdr, uint8_t mtype)
+{
+    hdr->mt_maj &= 0x1f;

I think those hard coded values should be provided as defines. What about `LORAWAN_HDR_MTYPE_MASK`, `LORAWAN_HDR_MTYPE_POS` or something ? The same could apply with other fields in the header.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11143#pullrequestreview-213055331
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190311/eb985bdc/attachment-0001.html>


More information about the notifications mailing list