LoRaMacParser.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. #ifdef __cplusplus
  40. extern "C"
  41. {
  42. #endif
  43. #include <stdint.h>
  44. #include "LoRaMacMessageTypes.h"
  45. /*!
  46. * LoRaMac Parser Status
  47. */
  48. typedef enum eLoRaMacParserStatus
  49. {
  50. /*!
  51. * No error occurred
  52. */
  53. LORAMAC_PARSER_SUCCESS = 0,
  54. /*!
  55. * Failure during parsing occurred
  56. */
  57. LORAMAC_PARSER_FAIL,
  58. /*!
  59. * Null pointer exception
  60. */
  61. LORAMAC_PARSER_ERROR_NPE,
  62. /*!
  63. * Undefined Error occurred
  64. */
  65. LORAMAC_PARSER_ERROR,
  66. }LoRaMacParserStatus_t;
  67. /*!
  68. * Parse a serialized join-accept message and fills the structured object.
  69. *
  70. * \param[IN/OUT] macMsg - Join-accept message object
  71. * \retval - Status of the operation
  72. */
  73. LoRaMacParserStatus_t LoRaMacParserJoinAccept( LoRaMacMessageJoinAccept_t *macMsg );
  74. /*!
  75. * Parse a serialized data message and fills the structured object.
  76. *
  77. * \param[IN/OUT] macMsg - Data message object
  78. * \retval - Status of the operation
  79. */
  80. LoRaMacParserStatus_t LoRaMacParserData( LoRaMacMessageData_t *macMsg );
  81. /*! \} addtogroup LORAMAC */
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif // __LORAMAC_PARSER_H__