devinfoservice.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : devinfoservice.h
  3. * Author : WCH
  4. * Version : V1.0
  5. * Date : 2018/12/11
  6. * Description :
  7. *********************************************************************************
  8. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  9. * Attention: This software (modified or not) and binary are used for
  10. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  11. *******************************************************************************/
  12. #ifndef DEVINFOSERVICE_H
  13. #define DEVINFOSERVICE_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /*********************************************************************
  18. * INCLUDES
  19. */
  20. /*********************************************************************
  21. * CONSTANTS
  22. */
  23. // Device Information Service Parameters
  24. #define DEVINFO_SYSTEM_ID 0
  25. #define DEVINFO_MODEL_NUMBER 1
  26. #define DEVINFO_SERIAL_NUMBER 2
  27. #define DEVINFO_FIRMWARE_REV 3
  28. #define DEVINFO_HARDWARE_REV 4
  29. #define DEVINFO_SOFTWARE_REV 5
  30. #define DEVINFO_MANUFACTURER_NAME 6
  31. #define DEVINFO_11073_CERT_DATA 7
  32. #define DEVINFO_PNP_ID 8
  33. // IEEE 11073 authoritative body values
  34. #define DEVINFO_11073_BODY_EMPTY 0
  35. #define DEVINFO_11073_BODY_IEEE 1
  36. #define DEVINFO_11073_BODY_CONTINUA 2
  37. #define DEVINFO_11073_BODY_EXP 254
  38. // System ID length
  39. #define DEVINFO_SYSTEM_ID_LEN 8
  40. // PnP ID length
  41. #define DEVINFO_PNP_ID_LEN 7
  42. /*********************************************************************
  43. * TYPEDEFS
  44. */
  45. /*********************************************************************
  46. * MACROS
  47. */
  48. /*********************************************************************
  49. * Profile Callbacks
  50. */
  51. /*********************************************************************
  52. * API FUNCTIONS
  53. */
  54. /*
  55. * DevInfo_AddService- Initializes the Device Information service by registering
  56. * GATT attributes with the GATT server.
  57. *
  58. */
  59. extern bStatus_t DevInfo_AddService(void);
  60. /*********************************************************************
  61. * @fn DevInfo_SetParameter
  62. *
  63. * @brief Set a Device Information parameter.
  64. *
  65. * @param param - Profile parameter ID
  66. * @param len - length of data to right
  67. * @param value - pointer to data to write. This is dependent on
  68. * the parameter ID and WILL be cast to the appropriate
  69. * data type (example: data type of uint16_t will be cast to
  70. * uint16_t pointer).
  71. *
  72. * @return bStatus_t
  73. */
  74. bStatus_t DevInfo_SetParameter(uint8_t param, uint16_t len, void *value);
  75. /*
  76. * DevInfo_GetParameter - Get a Device Information parameter.
  77. *
  78. * param - Profile parameter ID
  79. * value - pointer to data to write. This is dependent on
  80. * the parameter ID and WILL be cast to the appropriate
  81. * data type (example: data type of uint16_t will be cast to
  82. * uint16_t pointer).
  83. */
  84. extern bStatus_t DevInfo_GetParameter(uint8_t param, void *value);
  85. /*********************************************************************
  86. *********************************************************************/
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90. #endif /* DEVINFOSERVICE_H */