MS_features.h 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /**
  2. * \file MS_features.h
  3. *
  4. * \brief EtherMind Compilation Switches Configuration File.
  5. *
  6. * This file lists all the Compilation Flags available in various
  7. * EtherMind Mesh Stack modules.
  8. */
  9. /*
  10. * Copyright (C) 2016. Mindtree Ltd.
  11. * All rights reserved.
  12. */
  13. #ifndef _H_MS_FEATURES_
  14. #define _H_MS_FEATURES_
  15. /* ----------------------------------------------------------------------- */
  16. /* ========== Platform =================================================== */
  17. /* ----------------------------------------------------------------------- */
  18. /*
  19. * WINDOWS
  20. *
  21. * This flag is used when the EtherMind stack is being compiled on
  22. * Windows User Mode platforms.
  23. *
  24. * Dependency: None.
  25. */
  26. #define WINDOWS
  27. /* ----------------------------------------------------------------------- */
  28. /* ==== Mesh Specification Flags ========================================= */
  29. /* ----------------------------------------------------------------------- */
  30. /*
  31. * MS_1_0
  32. *
  33. * This flag is used when the EtherMind stack is being compiled for
  34. * Mesh specification version 1.0.
  35. */
  36. #define MS_1_0
  37. /* ----------------------------------------------------------------------- */
  38. /* ==== Mesh v1.0 Feature Flags ========================================== */
  39. /* ----------------------------------------------------------------------- */
  40. /*
  41. * MS_PROVISIONING_SUPPORT
  42. *
  43. * This flag is used to enable support for Provisioning feature.
  44. *
  45. * Dependency: None.
  46. */
  47. #define MS_PROVISIONING_SUPPORT
  48. /*
  49. * MS_RELAY_SUPPORT
  50. *
  51. * This flag is used to enable support for Relay feature.
  52. *
  53. * Dependency: None.
  54. */
  55. #define MS_RELAY_SUPPORT
  56. /*
  57. * MS_PROXY_SUPPORT
  58. *
  59. * This flag is used to enable support for Proxy feature.
  60. *
  61. * Dependency: None.
  62. */
  63. #define MS_PROXY_SUPPORT
  64. /*
  65. * MS_PROXY_SERVER
  66. *
  67. * This flag is used to enable support for Proxy Server feature.
  68. *
  69. * Dependency: MS_PROXY_SUPPORT.
  70. */
  71. #ifdef MS_PROXY_SUPPORT
  72. #define MS_PROXY_SERVER
  73. #endif /* MS_PROXY_SUPPORT */
  74. /*
  75. * MS_PROXY_CLIENT
  76. *
  77. * This flag is used to enable support for Proxy Client feature.
  78. *
  79. * Dependency: MS_PROXY_SUPPORT.
  80. */
  81. #ifdef MS_PROXY_SUPPORT
  82. #define MS_PROXY_CLIENT
  83. #endif /* MS_PROXY_SUPPORT */
  84. /**
  85. * Check if the relevant roles for Proxy are Enabled
  86. */
  87. #ifdef MS_PROXY_SUPPORT
  88. #if !((defined MS_PROXY_SERVER) || (defined MS_PROXY_CLIENT))
  89. #error "Server or Client SHALL be supported when MS_PROXY_SUPPORT enabled"
  90. #endif /* !((defined MS_PROXY_SERVER) || (defined MS_PROXY_CLIENT)) */
  91. #endif /* MS_PROXY_SUPPORT */
  92. /*
  93. * MS_FRIEND_SUPPORT
  94. *
  95. * This flag is used to enable support for Friend feature.
  96. *
  97. * Dependency: None.
  98. */
  99. #define MS_FRIEND_SUPPORT
  100. /*
  101. * MS_LPN_SUPPORT
  102. *
  103. * This flag is used to enable support for Low Power feature.
  104. *
  105. * Dependency: None.
  106. */
  107. #define MS_LPN_SUPPORT
  108. #ifndef CFG_HEARTBEAT_MODE
  109. #define CFG_HEARTBEAT_MODE 0
  110. #endif
  111. /* ----------------------------------------------------------------------- */
  112. /* ==== Stack Architecture Flags ========================================= */
  113. /* ----------------------------------------------------------------------- */
  114. /* ----------------------------------------------------------------------- */
  115. /* ==== Stack Feature Flags ============================================== */
  116. /* ----------------------------------------------------------------------- */
  117. /*
  118. * MS_SUPPORT_STACK_VERSION_INFO
  119. *
  120. * This flag enables EtherMind MS_get_version_number() API.
  121. *
  122. * This API is used to retrieve the current stack build version
  123. * information
  124. *
  125. * Dependency: None.
  126. */
  127. #define MS_SUPPORT_STACK_VERSION_INFO
  128. /*
  129. * MS_HAVE_DYNAMIC_CONFIG
  130. *
  131. * This flag enables dynamic configuration of some of the parameters defined in MS_limits.h.
  132. *
  133. * Dependency: None.
  134. */
  135. #define MS_HAVE_DYNAMIC_CONFIG
  136. /*
  137. * MS_DEBUG_ASSERT
  138. *
  139. * This flag enables EtherMind MS_assert() macro, for evaluating truth
  140. * value of an expression. For details, refer to BT_assert.h for the
  141. * platform.
  142. *
  143. * The MS_assert() macro is used for debugging during development, and
  144. * can be excluded in builds for the final product.
  145. *
  146. * Dependency: None.
  147. */
  148. #define MS_DEBUG_ASSERT
  149. /*
  150. * MS_STATUS
  151. *
  152. * This flag enables EtherMind Status Flag APIs for reporting various
  153. * Status, as described in BT_status_api.h. The EtherMind Status APIs
  154. * are designed and to be used for debugging purposes during development
  155. * and can be excluded in builds for final products.
  156. *
  157. * Dependency: None.
  158. */
  159. /* #define MS_STATUS */
  160. /*
  161. * MS_DISABLE_MUTEX
  162. *
  163. * This flag disables the use of mutex and conditional variables from all
  164. * stack modules (protocols and profiles).
  165. * This should be defined in EtherMind builds where synchronization
  166. * primitives are not required (such as, single task build of EtherMind).
  167. *
  168. * Dependency: None.
  169. */
  170. #define MS_DISABLE_MUTEX
  171. /*
  172. * EM_HAVE_STATIC_DECL
  173. *
  174. * This flag enables provision for declaring functions and/or globals in
  175. * a file as 'static'.
  176. */
  177. #define EM_HAVE_STATIC_DECL
  178. /*
  179. * EM_HAVE_CONST_DECL
  180. *
  181. * This flag enables provision for declaring globals in a file as 'const'.
  182. */
  183. #define EM_HAVE_CONST_DECL
  184. /*
  185. * VAR_ARG_IN_MACRO_NOT_SUPPORTED
  186. *
  187. * This flag should be enabled if the compiler tool-chain does not support
  188. * variable argument in macro.
  189. */
  190. /* #define VAR_ARG_IN_MACRO_NOT_SUPPORTED */
  191. /*
  192. * MS_STORAGE
  193. *
  194. * This flag enables support of the Storage Module
  195. *
  196. * Dependency: None
  197. */
  198. #define MS_STORAGE
  199. /* ----------------------------------------------------------------------- */
  200. /* ==== Module Inclusion Flags for EtherMind Mesh Modules ================ */
  201. /* ----------------------------------------------------------------------- */
  202. /* Mesh Models */
  203. #define MS_MODEL_CONFIG
  204. /* ----------------------------------------------------------------------- */
  205. /* ==== Module Inclusion Flags for EtherMind Mesh Modules ================ */
  206. /* ----------------------------------------------------------------------- */
  207. /*
  208. * Module inclusion flags for various EtherMind Mesh Modules, and should be
  209. * defined according to the modules included in the build.
  210. *
  211. * Dependency: None.
  212. */
  213. #define MS_BRR
  214. #define MS_NET
  215. #define MS_LTRN
  216. #define MS_TRN
  217. #define MS_ACCESS
  218. /*
  219. * Topology - Roles.
  220. * Only one of the role shall be defined. Edge or Relay.
  221. */
  222. /*
  223. * An Edge node is capable of transmitting and receiving mesh packets,
  224. * but does not relay incoming packets.
  225. */
  226. /* #define MS_ROLE_EDGE_NODE */
  227. /*
  228. * A Relay node is capable of transmitting and receiving mesh packets,
  229. * and contributes to the multi-hop network infrastructure by relaying
  230. * incoming packets, which are authenticated against the network security
  231. * credentials.
  232. */
  233. #define MS_ROLE_RELAY_NODE
  234. /*
  235. * Topology - Sub-Roles.
  236. * Low Power Node or Friend Relay Node.
  237. */
  238. /*
  239. * A Low Power node is an Edge Node performing low duty cycle scanning.
  240. */
  241. /* #define MS_SUB_ROLE_LOW_POWER */
  242. /*
  243. * A Friend Relay node is a Relay node.
  244. * Friend Relay nodes will also allow Low Power nodes to establish friend
  245. * relationships with it, and once established will cache packets destined
  246. * for the Low Power node.
  247. */
  248. #define MS_SUB_ROLE_FRIEND_RELAY_NODE
  249. /* ----------------------------------------------------------------------- */
  250. /* ==== Bearer Module Specific Flags ===================================== */
  251. /* ----------------------------------------------------------------------- */
  252. /*
  253. * MS_BEARER_ADV
  254. *
  255. * An advertising bearer.
  256. */
  257. #define MS_BEARER_ADV
  258. /*
  259. * MS_BEARER_GATT
  260. *
  261. * A GATT bearer.
  262. */
  263. /* #define MS_BEARER_GATT */
  264. /*
  265. * BLEBRR_LP_SUPPORT
  266. *
  267. * Enables Low Power Mode interfaces in the bearer.
  268. */
  269. #undef BLEBRR_LP_SUPPORT
  270. /* ----------------------------------------------------------------------- */
  271. /* ==== Network Module Specific Flags ==================================== */
  272. /* ----------------------------------------------------------------------- */
  273. /* ----------------------------------------------------------------------- */
  274. /* ==== Transport Module Specific Flags ================================== */
  275. /* ----------------------------------------------------------------------- */
  276. /*
  277. * MS_TRN_SEND_UNSEG_MSG_SUPPORT
  278. *
  279. * Enables support for sending Unsegmented Transport Message procedure.
  280. */
  281. #define MS_TRN_SEND_UNSEG_MSG_SUPPORT
  282. /*
  283. * MS_TRN_SEND_CTRL_PKT_SUPPORT
  284. *
  285. * Enables support for sending Transport Control Packet procedure.
  286. */
  287. #define MS_TRN_SEND_CTRL_PKT_SUPPORT
  288. #ifdef MS_TRN_SEND_CTRL_PKT_SUPPORT
  289. /*
  290. * MS_TRN_CTRL_FRND_PING_SUPPORT
  291. *
  292. * Enables support for sending Transport Control Packet - Friend Poll procedure.
  293. */
  294. #define MS_TRN_CTRL_FRND_POLL_SUPPORT
  295. /*
  296. * MS_TRN_CTRL_FRND_UPDATE_SUPPORT
  297. *
  298. * Enables support for sending Transport Control Packet - Friend Update procedure.
  299. */
  300. #define MS_TRN_CTRL_FRND_UPDATE_SUPPORT
  301. /*
  302. * MS_TRN_CTRL_FRND_REQ_SUPPORT
  303. *
  304. * Enables support for sending Transport Control Packet - Friend Request procedure.
  305. */
  306. #define MS_TRN_CTRL_FRND_REQ_SUPPORT
  307. /*
  308. * MS_TRN_CTRL_FRND_OFFER_SUPPORT
  309. *
  310. * Enables support for sending Transport Control Packet - Friend Offer procedure.
  311. */
  312. #define MS_TRN_CTRL_FRND_OFFER_SUPPORT
  313. /*
  314. * MS_TRN_CTRL_FRND_CLEAR_SUPPORT
  315. *
  316. * Enables support for sending Transport Control Packet - Friend Clear procedure.
  317. */
  318. #define MS_TRN_CTRL_FRND_CLEAR_SUPPORT
  319. /*
  320. * MS_TRN_CTRL_FRND_CLEAR_CNF_SUPPORT
  321. *
  322. * Enables support for sending Transport Control Packet - Friend Clear Confirmation procedure.
  323. */
  324. #define MS_TRN_CTRL_FRND_CLEAR_CNF_SUPPORT
  325. /*
  326. * MS_TRN_CTRL_FRND_SUBSCRN_LIST_ADD_SUPPORT
  327. *
  328. * Enables support for sending Transport Control Packet - Friend Subscription List Add procedure.
  329. */
  330. #define MS_TRN_CTRL_FRND_SUBSCRN_LIST_ADD_SUPPORT
  331. /*
  332. * MS_TRN_CTRL_FRND_SUBSCRN_LIST_REMOVE_SUPPORT
  333. *
  334. * Enables support for sending Transport Control Packet - Friend Subscription List Remove procedure.
  335. */
  336. #define MS_TRN_CTRL_FRND_SUBSCRN_LIST_REMOVE_SUPPORT
  337. /*
  338. * MS_TRN_CTRL_FRND_SUBSCRN_LIST_CNF_SUPPORT
  339. *
  340. * Enables support for sending Transport Control Packet - Friend Subscription List Confirmation procedure.
  341. */
  342. #define MS_TRN_CTRL_FRND_SUBSCRN_LIST_CNF_SUPPORT
  343. /*
  344. * MS_TRN_CTRL_HEARTBEAT_SUPPORT
  345. *
  346. * Enables support for sending Transport Control Packet - Heartbeat procedure.
  347. */
  348. #define MS_TRN_CTRL_HEARTBEAT_SUPPORT
  349. #endif /* MS_TRN_SEND_CTRL_PKT_SUPPORT */
  350. /*
  351. * MS_TRN_NO_NULL_PARAM_CHECK
  352. *
  353. * This flag disables 'null' parameter check in Mesh Transport APIs
  354. *
  355. * When application using Mesh Transport APIs are validated and
  356. * it is ensured that none of the API call path is using
  357. * an unexpected 'null' parameter, this flag can be enabled
  358. * to reduce the code size.
  359. *
  360. * Dependency: None.
  361. */
  362. /* #define MS_TRN_NO_NULL_PARAM_CHECK */
  363. /*
  364. * MS_TRN_NO_RANGE_CHECK
  365. *
  366. * This flag disables the check in Mesh Transport APIs to verify if the parameter
  367. * values are within specification defined valid range
  368. *
  369. * When application using Mesh Transport APIs are validated and
  370. * it is ensured that none of the API call path is using
  371. * parameters with invalid value, this flag can be enabled
  372. * to reduce the code size.
  373. *
  374. * Dependency: None.
  375. */
  376. /* #define MS_TRN_NO_RANGE_CHECK */
  377. /* ----------------------------------------------------------------------- */
  378. /* ==== Access Module Specific Flags ===================================== */
  379. /* ----------------------------------------------------------------------- */
  380. /*
  381. * MS_ACCESS_PUBLISH_TIMER_SUPPORT
  382. *
  383. * This flag enables Publication Timer Support.
  384. *
  385. * Dependency: None.
  386. */
  387. #define MS_ACCESS_PUBLISH_TIMER_SUPPORT
  388. /* ----------------------------------------------------------------------- */
  389. /* ==== Model Specific Flags ============================================= */
  390. /* ----------------------------------------------------------------------- */
  391. /*
  392. * Support Generic OnOff Model.
  393. */
  394. #define HAVE_GENERIC_ONOFF_MODEL
  395. /*
  396. * Support Generic Level Model.
  397. */
  398. #define HAVE_GENERIC_LEVEL_MODEL
  399. /* ----------------------------------------------------------------------- */
  400. /* ==== Module Profiling Flags =========================================== */
  401. /* ----------------------------------------------------------------------- */
  402. /*
  403. * Profiling related definitions for all the layers (protocol and profiles)
  404. * shall be defined in this section.
  405. */
  406. /*
  407. * MS_ENABLE_SPY
  408. *
  409. * If defined, this flag enables module profiling.
  410. *
  411. * Dependency: None
  412. */
  413. #define MS_ENABLE_SPY
  414. #ifdef MS_ENABLE_SPY
  415. #define BRR_ENABLE_SPY
  416. #define NET_ENABLE_SPY
  417. #define TRN_ENABLE_SPY
  418. #define APP_ENABLE_SPY
  419. #endif /* MS_ENABLE_SPY */
  420. /* ----------------------------------------------------------------------- */
  421. /* ==== Debug Specification Flags ======================================== */
  422. /* ----------------------------------------------------------------------- */
  423. /*
  424. * Debug definitions for all the layers (protocol and profiles) should be
  425. * defined in this section.
  426. */
  427. /*
  428. * By default, the Error Logs of all the layers are enabled.
  429. * To disable error logging of a module, define <module>_NO_DEBUG flag.
  430. * Example: Define BRR_NO_DEBUG to disable error logging of Bearer layer.
  431. *
  432. * By default, the Trace, Information, Data and other Logs
  433. * of all the layers are disabled.
  434. * To enable debug logging of a module, define <module>_DEBUG flag.
  435. * Example: Define BRR_DEBUG to enable debug logging (Trace and Information)
  436. * of Bearer layer.
  437. */
  438. /* Protocol Modules */
  439. #define COMMON_NO_DEBUG
  440. /* #define COMMON_DEBUG */
  441. //#define BRR_DEBUG
  442. #define BRR_NO_DEBUG
  443. /* #define BRR_DEBUG */
  444. //#define NET_DEBUG
  445. #define NET_NO_DEBUG
  446. /* #define NET_DEBUG */
  447. #define LTRN_NO_DEBUG
  448. //#define LTRN_DEBUG
  449. /* #define LTRN_DEBUG */
  450. #define TRN_NO_DEBUG
  451. //#define TRN_DEBUG
  452. /* #define TRN_DEBUG */
  453. #define APP_NO_DEBUG
  454. //#define APP_DEBUG
  455. /* #define APP_DEBUG */
  456. #define STBX_NO_DEBUG
  457. //#define STBX_DEBUG
  458. /* #define STBX_DEBUG */
  459. #define ACCESS_NO_DEBUG
  460. //#define ACCESS_DEBUG
  461. /* #define ACCESS_DEBUG */
  462. #define PROV_NO_DEBUG
  463. //#define PROV_DEBUG
  464. /* #define PROV_DEBUG */
  465. #define CONFIG_NO_DEBUG
  466. //#define CONFIG_DEBUG
  467. /* #define CONFIG_DEBUG */
  468. #endif /* _H_MS_FEATURES_ */