ble_gatt_db.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Copyright (c) 2016 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. */
  11. /**@file
  12. *
  13. * @defgroup ble_sdk_lib_gatt_db GATT Database Service Structure
  14. * @{
  15. * @ingroup app_common
  16. */
  17. #ifndef BLE_GATT_DB_H__
  18. #define BLE_GATT_DB_H__
  19. #include <stdint.h>
  20. #include "ble.h"
  21. #include "ble_gattc.h"
  22. #define BLE_GATT_DB_MAX_CHARS 5 /**< The maximum number of characteristics present in a service record. */
  23. /**@brief Structure for holding the characteristic and the handle of its CCCD present on a server.
  24. */
  25. typedef struct
  26. {
  27. ble_gattc_char_t characteristic; /**< Structure containing information about the characteristic. */
  28. uint16_t cccd_handle; /**< CCCD Handle value for this characteristic. This will be set to BLE_GATT_HANDLE_INVALID if a CCCD is not present at the server. */
  29. } ble_gatt_db_char_t;
  30. /**@brief Structure for holding information about the service and the characteristics present on a
  31. * server.
  32. */
  33. typedef struct
  34. {
  35. ble_uuid_t srv_uuid; /**< UUID of the service. */
  36. uint8_t char_count; /**< Number of characteristics present in the service. */
  37. ble_gattc_handle_range_t handle_range; /**< Service Handle Range. */
  38. ble_gatt_db_char_t charateristics[BLE_GATT_DB_MAX_CHARS]; /**< Array of information related to the characteristics present in the service. This list can extend further than one. */
  39. } ble_gatt_db_srv_t;
  40. #endif /* BLE_GATT_DB_H__ */
  41. /** @} */