devinfoservice.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /**************************************************************************************************
  2. Phyplus Microelectronics Limited confidential and proprietary.
  3. All rights reserved.
  4. IMPORTANT: All rights of this software belong to Phyplus Microelectronics
  5. Limited ("Phyplus"). Your use of this Software is limited to those
  6. specific rights granted under the terms of the business contract, the
  7. confidential agreement, the non-disclosure agreement and any other forms
  8. of agreements as a customer or a partner of Phyplus. You may not use this
  9. Software unless you agree to abide by the terms of these agreements.
  10. You acknowledge that the Software may not be modified, copied,
  11. distributed or disclosed unless embedded on a Phyplus Bluetooth Low Energy
  12. (BLE) integrated circuit, either as a product or is integrated into your
  13. products. Other than for the aforementioned purposes, you may not use,
  14. reproduce, copy, prepare derivative works of, modify, distribute, perform,
  15. display or sell this Software and/or its documentation for any purposes.
  16. YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
  17. PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
  18. INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
  19. NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
  20. PHYPLUS OR ITS SUBSIDIARIES BE LIABLE OR OBLIGATED UNDER CONTRACT,
  21. NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
  22. LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
  23. INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
  24. OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
  25. OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
  26. (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
  27. **************************************************************************************************/
  28. /**************************************************************************************************
  29. Filename: devinfoservice.h
  30. Revised: $Date $
  31. Revision: $Revision $
  32. Description: This file contains the Device Information service definitions and
  33. prototypes.
  34. **************************************************************************************************/
  35. #ifndef DEVINFOSERVICE_H
  36. #define DEVINFOSERVICE_H
  37. #ifdef __cplusplus
  38. extern "C"
  39. {
  40. #endif
  41. /*********************************************************************
  42. * INCLUDES
  43. */
  44. /*********************************************************************
  45. * CONSTANTS
  46. */
  47. // Device Information Service Parameters
  48. #define DEVINFO_SYSTEM_ID 0
  49. #define DEVINFO_MODEL_NUMBER 1
  50. #define DEVINFO_SERIAL_NUMBER 2
  51. #define DEVINFO_FIRMWARE_REV 3
  52. #define DEVINFO_HARDWARE_REV 4
  53. #define DEVINFO_SOFTWARE_REV 5
  54. #define DEVINFO_MANUFACTURER_NAME 6
  55. #define DEVINFO_11073_CERT_DATA 7
  56. #define DEVINFO_PNP_ID 8
  57. // IEEE 11073 authoritative body values
  58. #define DEVINFO_11073_BODY_EMPTY 0
  59. #define DEVINFO_11073_BODY_IEEE 1
  60. #define DEVINFO_11073_BODY_CONTINUA 2
  61. #define DEVINFO_11073_BODY_EXP 254
  62. // System ID length
  63. #define DEVINFO_SYSTEM_ID_LEN 8
  64. // PnP ID length
  65. #define DEVINFO_PNP_ID_LEN 7
  66. /*********************************************************************
  67. * TYPEDEFS
  68. */
  69. /*********************************************************************
  70. * MACROS
  71. */
  72. /*********************************************************************
  73. * Profile Callbacks
  74. */
  75. /*********************************************************************
  76. * API FUNCTIONS
  77. */
  78. /*
  79. * DevInfo_AddService- Initializes the Device Information service by registering
  80. * GATT attributes with the GATT server.
  81. *
  82. */
  83. extern bStatus_t DevInfo_AddService( void );
  84. /*********************************************************************
  85. * @fn DevInfo_SetParameter
  86. *
  87. * @brief Set a Device Information parameter.
  88. *
  89. * @param param - Profile parameter ID
  90. * @param len - length of data to right
  91. * @param value - pointer to data to write. This is dependent on
  92. * the parameter ID and WILL be cast to the appropriate
  93. * data type (example: data type of uint16 will be cast to
  94. * uint16 pointer).
  95. *
  96. * @return bStatus_t
  97. */
  98. bStatus_t DevInfo_SetParameter( uint8 param, uint8 len, void *value );
  99. /*
  100. * DevInfo_GetParameter - Get a Device Information parameter.
  101. *
  102. * param - Profile parameter ID
  103. * value - pointer to data to write. This is dependent on
  104. * the parameter ID and WILL be cast to the appropriate
  105. * data type (example: data type of uint16 will be cast to
  106. * uint16 pointer).
  107. */
  108. extern bStatus_t DevInfo_GetParameter( uint8 param, void *value );
  109. /*********************************************************************
  110. *********************************************************************/
  111. #ifdef __cplusplus
  112. }
  113. #endif
  114. #endif /* DEVINFOSERVICE_H */