LoRaMacConfig.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-07-13 Rick the first version
  9. */
  10. #ifndef RF_APPLICATION_LORAWAN_CONFIG_H_
  11. #define RF_APPLICATION_LORAWAN_CONFIG_H_
  12. #ifdef LORAWAN_DRIVER_REGION_CN470
  13. #define ACTIVE_REGION LORAMAC_REGION_CN470
  14. #endif
  15. #ifdef LORAWAN_DRIVER_REGION_EU433
  16. #define ACTIVE_REGION LORAMAC_REGION_EU433
  17. #endif
  18. #define APP_TX_DUTYCYCLE 3000
  19. #define APP_TX_DUTYCYCLE_RND 1000
  20. #define LORAWAN_CONFIRMED_MSG_ON false
  21. #define LORAWAN_ADR_ON false
  22. #define LORAWAN_APP_DATA_MAX_SIZE 242
  23. #define LORAWAN_DEFAULT_DATARATE LORAWAN_DRIVER_DEFAULT_DATARATE
  24. #define LORAWAN_APP_PORT LORAWAN_DRIVER_APP_PORT
  25. /*!
  26. * When set to 1 the application uses the Over-the-Air activation procedure
  27. * When set to 0 the application uses the Personalization activation procedure
  28. */
  29. #ifdef LORAWAN_DRIVER_ABP
  30. #define OVER_THE_AIR_ACTIVATION 0
  31. #else
  32. #define OVER_THE_AIR_ACTIVATION 1
  33. #endif
  34. /*!
  35. * When set to 2 the application use Mode Class C
  36. * When set to 1 the application use Mode Class B
  37. * When set to 0 the application use Mode Class A
  38. */
  39. #ifdef LORAWAN_DRIVER_ClassA
  40. #define DEVICE_CLASS 0
  41. #elif BSP_USING_LoRaWAN_ClassB
  42. #define DEVICE_CLASS 1
  43. #else
  44. #define DEVICE_CLASS 2
  45. #endif
  46. /*!
  47. * When using ABP activation the MAC layer must know in advance to which server
  48. * version it will be connected.
  49. */
  50. #define ABP_ACTIVATION_LRWAN_VERSION_V10x 0x01030000 // 1.0.3.0
  51. #define ABP_ACTIVATION_LRWAN_VERSION ABP_ACTIVATION_LRWAN_VERSION_V10x
  52. /*!
  53. * Indicates if the end-device is to be connected to a private or public network
  54. */
  55. #define LORAWAN_PUBLIC_NETWORK true
  56. /*!
  57. * IEEE Organizationally Unique Identifier ( OUI ) (big endian)
  58. * \remark This is unique to a company or organization
  59. */
  60. #define IEEE_OUI 0x00, 0x00, 0x00
  61. /*!
  62. * Mote device IEEE EUI (big endian)
  63. *
  64. * \remark In this application the value is automatically generated by calling
  65. * BoardGetUniqueId function
  66. */
  67. #define LORAWAN_DEVICE_EUI {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
  68. /*!
  69. * App/Join server IEEE EUI (big endian)
  70. */
  71. #define LORAWAN_JOIN_EUI {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}
  72. /*!
  73. * Application root key
  74. * WARNING: NOT USED FOR 1.0.x DEVICES
  75. */
  76. #define LORAWAN_APP_KEY LORAWAN_GEN_APP_KEY
  77. /*!
  78. * Application root key - Used to derive Multicast keys on 1.0.x devices.
  79. * WARNING: USED only FOR 1.0.x DEVICES
  80. */
  81. #define LORAWAN_GEN_APP_KEY {0x07, 0x7e, 0xe4, 0x5c, 0x6e, 0x45, 0x64, 0xd9, 0x6d, 0x76, 0xae, 0x55, 0xaf, 0xd3, 0xaa, 0x89}
  82. /*!
  83. * Network root key
  84. * WARNING: FOR 1.0.x DEVICES IT IS THE \ref LORAWAN_APP_KEY
  85. */
  86. #define LORAWAN_NWK_KEY {0x07, 0x7e, 0xe4, 0x5c, 0x6e, 0x45, 0x64, 0xd9, 0x6d, 0x76, 0xae, 0x55, 0xaf, 0xd3, 0xaa, 0x89}
  87. /*!
  88. * Current network ID
  89. */
  90. #define LORAWAN_NETWORK_ID ( uint32_t )0
  91. /*!
  92. * Device address on the network (big endian)
  93. */
  94. #define LORAWAN_DEVICE_ADDRESS ( uint32_t )0x22221111
  95. /*!
  96. * Forwarding Network session integrity key
  97. * WARNING: NWK_S_KEY FOR 1.0.x DEVICES
  98. */
  99. #define LORAWAN_F_NWK_S_INT_KEY { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }
  100. /*!
  101. * Serving Network session integrity key
  102. * WARNING: NOT USED FOR 1.0.x DEVICES. MUST BE THE SAME AS \ref LORAWAN_F_NWK_S_INT_KEY
  103. */
  104. #define LORAWAN_S_NWK_S_INT_KEY LORAWAN_F_NWK_S_INT_KEY
  105. /*!
  106. * Network session encryption key
  107. * WARNING: NOT USED FOR 1.0.x DEVICES. MUST BE THE SAME AS \ref LORAWAN_F_NWK_S_INT_KEY
  108. */
  109. #define LORAWAN_NWK_S_ENC_KEY LORAWAN_F_NWK_S_INT_KEY
  110. /*!
  111. * Application session key
  112. */
  113. #define LORAWAN_APP_S_KEY { 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11 }
  114. #endif /* RF_APPLICATION_LORAWAN_CONFIG_H_ */