version.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. typedef struct Version Version;
  6. /**
  7. * Gets current running firmware version handle.
  8. * You can store it somewhere. But if you want to retrieve data,
  9. * you have to use 'version_*_get()' set of functions.
  10. * Also, 'version_*_get()' imply to use this
  11. * handle if no handle (NULL_PTR) provided.
  12. *
  13. * @return Handle to version data.
  14. */
  15. const Version* version_get(void);
  16. /**
  17. * Gets git hash of build commit.
  18. *
  19. * @param v - ptr to version handle. If zero - gets current running fw info.
  20. * @return git hash
  21. */
  22. const char* version_get_githash(const Version* v);
  23. /**
  24. * Gets git branch of build commit.
  25. *
  26. * @param v - ptr to version handle. If zero - gets current running fw info.
  27. * @return git branch
  28. */
  29. const char* version_get_gitbranch(const Version* v);
  30. /**
  31. * Gets git number of build commit.
  32. *
  33. * @param v - ptr to version handle. If zero - gets current running fw info.
  34. * @return number of commit
  35. */
  36. const char* version_get_gitbranchnum(const Version* v);
  37. /**
  38. * Gets build date.
  39. *
  40. * @param v - ptr to version handle. If zero - gets current running fw info.
  41. * @return build date
  42. */
  43. const char* version_get_builddate(const Version* v);
  44. /**
  45. * Gets build version.
  46. * Build version is last tag in git history.
  47. *
  48. * @param v - ptr to version handle. If zero - gets current running fw info.
  49. * @return build date
  50. */
  51. const char* version_get_version(const Version* v);
  52. /**
  53. * Gets firmware target.
  54. * Build version is last tag for build commit.
  55. *
  56. * @param v - ptr to version handle. If zero - gets current running fw info.
  57. * @return build date
  58. */
  59. const char* version_get_target(const Version* v);
  60. #ifdef __cplusplus
  61. }
  62. #endif