LoRaMacSerializer.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*!
  2. * \file LoRaMacSerializer.h
  3. *
  4. * \brief LoRa MAC layer message serializer 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_SERIALIZER_H__
  38. #define __LORAMAC_SERIALIZER_H__
  39. #ifdef __cplusplus
  40. extern "C"
  41. {
  42. #endif
  43. #include <stdint.h>
  44. #include "LoRaMacMessageTypes.h"
  45. /*!
  46. * LoRaMac Serializer Status
  47. */
  48. typedef enum eLoRaMacSerializerStatus
  49. {
  50. /*!
  51. * No error occurred
  52. */
  53. LORAMAC_SERIALIZER_SUCCESS = 0,
  54. /*!
  55. * Null pointer exception
  56. */
  57. LORAMAC_SERIALIZER_ERROR_NPE,
  58. /*!
  59. * Incompatible buffer size
  60. */
  61. LORAMAC_SERIALIZER_ERROR_BUF_SIZE,
  62. /*!
  63. * Undefined Error occurred
  64. */
  65. LORAMAC_SERIALIZER_ERROR,
  66. }LoRaMacSerializerStatus_t;
  67. /*!
  68. * Creates serialized MAC message of structured object.
  69. *
  70. * \param[IN/OUT] macMsg - Join-request message object
  71. * \retval - Status of the operation
  72. */
  73. LoRaMacSerializerStatus_t LoRaMacSerializerJoinRequest( LoRaMacMessageJoinRequest_t* macMsg );
  74. /*!
  75. * Creates serialized MAC message of structured object.
  76. *
  77. * \param[IN/OUT] macMsg - Join-request message object
  78. * \retval - Status of the operation
  79. */
  80. LoRaMacSerializerStatus_t LoRaMacSerializerReJoinType1( LoRaMacMessageReJoinType1_t* macMsg );
  81. /*!
  82. * Creates serialized MAC message of structured object.
  83. *
  84. * \param[IN/OUT] macMsg - Join-request message object
  85. * \retval - Status of the operation
  86. */
  87. LoRaMacSerializerStatus_t LoRaMacSerializerReJoinType0or2( LoRaMacMessageReJoinType0or2_t* macMsg );
  88. /*!
  89. * Creates serialized MAC message of structured object.
  90. *
  91. * \param[IN/OUT] macMsg - Data message object
  92. * \retval - Status of the operation
  93. */
  94. LoRaMacSerializerStatus_t LoRaMacSerializerData( LoRaMacMessageData_t* macMsg );
  95. /*! \} addtogroup LORAMAC */
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif // __LORAMAC_SERIALIZER_H__