MS_version.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /**
  2. * \file MS_version.h
  3. *
  4. * This EtherMind Header File containing version number of the stack.
  5. */
  6. /*
  7. * Copyright (C) 2017. Mindtree Ltd.
  8. * All rights reserved.
  9. */
  10. #ifndef _H_MS_VERSION_
  11. #define _H_MS_VERSION_
  12. /* -------------------------------------------- Header File Inclusion */
  13. #include "MS_common.h"
  14. /* -------------------------------------------- Global Definitions */
  15. /**
  16. * An increment in the major number of the stack implies a large update to
  17. * the stack. Such an update could occur due to multiple factors, including
  18. * changes to stack to adhere to new version of the specification or
  19. * support for new device specializations or in extreme cases a design
  20. * overhaul to address future needs.
  21. *
  22. * An update in the major number would signify an update to the application
  23. * interface offered by the stack. Update need not necessarily imply a
  24. * change in existing interface, it could be additional APIs or events.
  25. * When an increment in major number occurs, minor & sub-minor numbers
  26. * are reset to zero. In event of minor number reaching 255, the max
  27. * permissible number, a change resulting in increment in minor version
  28. * number will result in increment in major number.
  29. */
  30. #define MS_MAJOR_VERSION_NUMBER 1
  31. /**
  32. * An increment in the minor number of the stack implies an update to fix
  33. * an observed defect or changes resulting from optimzations performed on the
  34. * stack or enhancement to accommodate addendums to specifications. Minor
  35. * utility functions added may also result in increase in this number, however
  36. * none of these changes are categorized as causing an increment in minor
  37. * number, cause any change in existing interface. It is possible that an
  38. * existing functionality is required to be conditionally included; hence
  39. * feature flag may be introduced to enable or disable inclusion of the
  40. * functionality. Such a change would be categorized under a change resulting
  41. * in increment in minor number.
  42. * When an increment in minor number occurs, sub-minor number is reset
  43. * to zero. In event of sub-minor number reaching 255, the max permissible
  44. * number, a change resulting in increment in sub-minor number will result in
  45. * increment in minor number.
  46. */
  47. #define MS_MINOR_VERSION_NUMBER 2
  48. /**
  49. * An increment in this number implies a trivial change, changes such as
  50. * update in debug log, updating comments, macros, conditions renaming,
  51. * internal function/variable names etc are viewed as changes that result in
  52. * increment in this number.
  53. */
  54. #define MS_SUB_MINOR_VERSION_NUMBER 0
  55. /* -------------------------------------------- Macros */
  56. /* -------------------------------------------- Structures/Data Types */
  57. /** Version Number Structure */
  58. typedef struct _MS_VERSION_NUMBER
  59. {
  60. /** Major Version Number */
  61. UCHAR major;
  62. /** Minor Version Number */
  63. UCHAR minor;
  64. /** Sub-minor Version Number */
  65. UCHAR subminor;
  66. } MS_VERSION_NUMBER;
  67. /* -------------------------------------------- Function/API Declarations */
  68. #ifdef __cplusplus
  69. extern "C"{
  70. #endif
  71. #ifdef MS_SUPPORT_STACK_VERSION_INFO
  72. /**
  73. * \brief Routine to get Stack Version Number
  74. *
  75. * \par Description
  76. * Routine to get the version number of the stack as return value.
  77. * The version number consists of 3 fields:
  78. * Major Number
  79. * Minor Number
  80. * Sub-minor Number
  81. *
  82. * \param [out] version_number
  83. * Pointer to \ref MS_VERSION_NUMBER structure to be filled.
  84. */
  85. void MS_get_version_number
  86. (
  87. /* OUT */ MS_VERSION_NUMBER * version_number
  88. );
  89. #endif /* MS_SUPPORT_STACK_VERSION_INFO */
  90. #ifdef __cplusplus
  91. };
  92. #endif
  93. #endif /* _H_MS_VERSION_ */