simplekeys.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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: simplekeys.h
  30. Revised:
  31. Revision:
  32. Description: This file contains the Simple Keys Profile header file.
  33. **************************************************************************************************/
  34. #ifndef SIMPLEKEYS_H
  35. #define SIMPLEKEYS_H
  36. #ifdef __cplusplus
  37. extern "C"
  38. {
  39. #endif
  40. /*********************************************************************
  41. * INCLUDES
  42. */
  43. /*********************************************************************
  44. * CONSTANTS
  45. */
  46. // Profile Parameters
  47. #define SK_KEY_ATTR 0 // RW uint8 - Profile Attribute value
  48. // SK Service UUID
  49. #define SK_SERV_UUID 0xFFE0
  50. // Key Pressed UUID
  51. #define SK_KEYPRESSED_UUID 0xFFE1
  52. // Key Values
  53. #define SK_KEY_LEFT 0x01
  54. #define SK_KEY_RIGHT 0x02
  55. // Simple Keys Profile Services bit fields
  56. #define SK_SERVICE 0x00000001
  57. /*********************************************************************
  58. * TYPEDEFS
  59. */
  60. /*********************************************************************
  61. * MACROS
  62. */
  63. /*********************************************************************
  64. * Profile Callbacks
  65. */
  66. /*********************************************************************
  67. * API FUNCTIONS
  68. */
  69. /*
  70. * SK_AddService- Initializes the Simple Key service by registering
  71. * GATT attributes with the GATT server.
  72. *
  73. * @param services - services to add. This is a bit map and can
  74. * contain more than one service.
  75. */
  76. extern bStatus_t SK_AddService( uint32 services );
  77. /*
  78. * SK_SetParameter - Set a Simple Key Profile parameter.
  79. *
  80. * param - Profile parameter ID
  81. * len - length of data to right
  82. * pValue - pointer to data to write. This is dependent on
  83. * the parameter ID and WILL be cast to the appropriate
  84. * data type (example: data type of uint16 will be cast to
  85. * uint16 pointer).
  86. */
  87. extern bStatus_t SK_SetParameter( uint8 param, uint8 len, void *pValue );
  88. /*
  89. * SK_GetParameter - Get a Simple Key Profile parameter.
  90. *
  91. * param - Profile parameter ID
  92. * pValue - pointer to data to write. This is dependent on
  93. * the parameter ID and WILL be cast to the appropriate
  94. * data type (example: data type of uint16 will be cast to
  95. * uint16 pointer).
  96. */
  97. extern bStatus_t SK_GetParameter( uint8 param, void *pValue );
  98. /*********************************************************************
  99. *********************************************************************/
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103. #endif /* SIMPLEKEYS_H */