Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

125 lines
2.8 KiB

  1. /*!
  2. * \file LoRaMacClassBNvm.h
  3. *
  4. * \brief LoRa MAC Class B non-volatile data.
  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 Daniel Jaeckle ( STACKFORCE )
  28. *
  29. * \addtogroup LORAMACCLASSB
  30. *
  31. * \{
  32. */
  33. #ifndef __LORAMACCLASSBNVM_H__
  34. #define __LORAMACCLASSBNVM_H__
  35. #ifdef __cplusplus
  36. extern "C"
  37. {
  38. #endif
  39. #include <stdint.h>
  40. /*!
  41. * LoRaMac Class B Context structure for NVM parameters
  42. * related to ping slots
  43. */
  44. typedef struct sLoRaMacClassBPingSlotNvmData
  45. {
  46. struct sPingSlotCtrlNvm
  47. {
  48. /*!
  49. * Set when the server assigned a ping slot to the node
  50. */
  51. uint8_t Assigned : 1;
  52. /*!
  53. * Set when a custom frequency is used
  54. */
  55. uint8_t CustomFreq : 1;
  56. }Ctrl;
  57. /*!
  58. * Number of ping slots
  59. */
  60. uint8_t PingNb;
  61. /*!
  62. * Period of the ping slots
  63. */
  64. uint16_t PingPeriod;
  65. /*!
  66. * Reception frequency of the ping slot windows
  67. */
  68. uint32_t Frequency;
  69. /*!
  70. * Datarate of the ping slot
  71. */
  72. int8_t Datarate;
  73. /*!
  74. * Set to 1, if the FPending bit is set
  75. */
  76. uint8_t FPendingSet;
  77. } LoRaMacClassBPingSlotNvmData_t;
  78. /*!
  79. * LoRaMac Class B Context structure for NVM parameters
  80. * related to beaconing
  81. */
  82. typedef struct sLoRaMacClassBBeaconNvmData
  83. {
  84. struct sBeaconCtrlNvm
  85. {
  86. /*!
  87. * Set if the node has a custom frequency for beaconing and ping slots
  88. */
  89. uint8_t CustomFreq : 1;
  90. }Ctrl;
  91. /*!
  92. * Beacon reception frequency
  93. */
  94. uint32_t Frequency;
  95. } LoRaMacClassBBeaconNvmData_t;
  96. /*!
  97. * LoRaMac Class B Context structure
  98. */
  99. typedef struct sLoRaMacClassBNvmData
  100. {
  101. /*!
  102. * Class B ping slot context
  103. */
  104. LoRaMacClassBPingSlotNvmData_t PingSlotCtx;
  105. /*!
  106. * Class B beacon context
  107. */
  108. LoRaMacClassBBeaconNvmData_t BeaconCtx;
  109. /*!
  110. * CRC32 value of the ClassB data structure.
  111. */
  112. uint32_t Crc32;
  113. } LoRaMacClassBNvmData_t;
  114. #ifdef __cplusplus
  115. }
  116. #endif
  117. #endif // __LORAMACCLASSBNVM_H__