1 /*!
2  * \file      LoRaMacParser.h
3  *
4  * \brief     LoRa MAC layer message parser functionality implementation
5  *
6  * \copyright Revised BSD License, see section \ref LICENSE.
7  *
8  * \code
9  *                ______                              _
10  *               / _____)             _              | |
11  *              ( (____  _____ ____ _| |_ _____  ____| |__
12  *               \____ \| ___ |    (_   _) ___ |/ ___)  _ \
13  *               _____) ) ____| | | || |_| ____( (___| | | |
14  *              (______/|_____)_|_|_| \__)_____)\____)_| |_|
15  *              (C)2013 Semtech
16  *
17  *               ___ _____ _   ___ _  _____ ___  ___  ___ ___
18  *              / __|_   _/_\ / __| |/ / __/ _ \| _ \/ __| __|
19  *              \__ \ | |/ _ \ (__| ' <| _| (_) |   / (__| _|
20  *              |___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
21  *              embedded.connectivity.solutions===============
22  *
23  * \endcode
24  *
25  * \author    Miguel Luis ( Semtech )
26  *
27  * \author    Gregory Cristian ( Semtech )
28  *
29  * \author    Daniel Jaeckle ( STACKFORCE )
30  *
31  * \author    Johannes Bruder ( STACKFORCE )
32  *
33  * addtogroup LORAMAC
34  * \{
35  *
36  */
37 #ifndef __LORAMAC_PARSER_H__
38 #define __LORAMAC_PARSER_H__
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 #include <stdint.h>
46 #include "LoRaMacMessageTypes.h"
47 
48 /*!
49  * LoRaMac Parser Status
50  */
51 typedef enum eLoRaMacParserStatus
52 {
53     /*!
54      * No error occurred
55      */
56     LORAMAC_PARSER_SUCCESS = 0,
57     /*!
58      * Failure during parsing occurred
59      */
60     LORAMAC_PARSER_FAIL,
61     /*!
62      * Null pointer exception
63      */
64     LORAMAC_PARSER_ERROR_NPE,
65     /*!
66      * Undefined Error occurred
67      */
68     LORAMAC_PARSER_ERROR,
69 }LoRaMacParserStatus_t;
70 
71 
72 /*!
73  * Parse a serialized join-accept message and fills the structured object.
74  *
75  * \param[IN/OUT] macMsg       - Join-accept message object
76  * \retval                     - Status of the operation
77  */
78 LoRaMacParserStatus_t LoRaMacParserJoinAccept( LoRaMacMessageJoinAccept_t *macMsg );
79 
80 /*!
81  * Parse a serialized data message and fills the structured object.
82  *
83  * \param[IN/OUT] macMsg       - Data message object
84  * \retval                     - Status of the operation
85  */
86 LoRaMacParserStatus_t LoRaMacParserData( LoRaMacMessageData_t *macMsg );
87 
88 /*! \} addtogroup LORAMAC */
89 
90 #ifdef __cplusplus
91 }
92 #endif
93 
94 #endif // __LORAMAC_PARSER_H__
95 
96