Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

BLE GATT Database macros.

Macros

#define CY_BLE_GATT_DB_GET_ATTR_PERMISSION(handle)   (uint32_t)(cy_ble_configPtr->gattDB[(handle) - 1u].permission)
 Get permission field of attribute handle.
 
#define CY_BLE_GATT_DB_ATTR_CHECK_PRPTY(handle, prpty)   ((0ul) != (CY_BLE_GATT_DB_GET_ATTR_PERMISSION(handle) & (prpty)))
 Compare permission field of attribute entry to check desired permission property.
 
#define CY_BLE_GATT_DB_ATTR_SET_GEN_VALUE(handle, src, length)
 Macro to set generic value of attribute. More...
 
#define CY_BLE_GATT_DB_ATTR_GET_GEN_VALUE(dst, handle, length)
 Macro to get generic value of attribute. More...
 
#define CY_BLE_GATT_DB_GET_START_HANDLE(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attHandle
 Macro to get start handle of attribute Start handle is only meaningful for Characteristic and service declaration.
 
#define CY_BLE_GATT_DB_GET_END_HANDLE(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attEndHandle
 Macro to get end handle of attribute Start handle is only meaningful for Characteristic and service declaration.
 
#define CY_BLE_GATT_DB_GET_UUID(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attType
 Macro to get attribute type (UUID) for handle.
 
#define CY_BLE_GATT_DB_GET_ATTR_VALUE_UUID(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attValueUuid
 Macro to get attribute value UUID for handle. More...
 
#define CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_LEN(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.attGenericValLen->actualLength
 Macro to get actual length of Characteristic generic value.
 
#define CY_BLE_GATT_DB_ATTR_SET_ATTR_GEN_LEN(handle, value)
 Macro to set actual length of Characteristic generic value. More...
 
#define CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_MAX_LEN(handle)   cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.maxAttrLength
 Macro to get maximum length of Characteristic generic value.
 
#define CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX(handle)
 Macro to get index of CCCD value. More...
 
#define CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_PTR(handle)   (uint8_t*)(cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.attGenericValLen->attGenericVal)
 Macro to get pointer to Characteristic generic value.
 
#define CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR(attId, handle)
 Macro to get pointer to CCCD value. More...
 
#define CY_BLE_IS_NOTIFICATION_SUPPORTED(handle)   CY_BLE_GATT_DB_ATTR_CHECK_PRPTY(handle, CY_BLE_GATT_DB_CH_PROP_NOTIFY)
 Checks Notification properties in permission field of attribute entry.
 
#define CY_BLE_IS_NOTIFICATION_ENABLED_IN_PTR(valPtr)   ((0u) != (CY_BLE_CCCD_NOTIFICATION & Cy_BLE_Get16ByPtr(valPtr)))
 Checks Notification bit in attribute value referenced by pointer.
 
#define CY_BLE_IS_NOTIFICATION_ENABLED(attId, handle)   CY_BLE_IS_NOTIFICATION_ENABLED_IN_PTR(CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR(attId, handle))
 Checks Notification bit in attribute value referenced by handle.
 
#define CY_BLE_IS_INDICATION_SUPPORTED(handle)   CY_BLE_GATT_DB_ATTR_CHECK_PRPTY(handle, CY_BLE_GATT_DB_CH_PROP_INDICATE)
 Checks Indication properties in permission field of attribute entry.
 
#define CY_BLE_IS_INDICATION_ENABLED_IN_PTR(valPtr)   ((0u) != (CY_BLE_CCCD_INDICATION & Cy_BLE_Get16ByPtr(valPtr)))
 Checks Indication bit in attribute value referenced by pointer.
 
#define CY_BLE_IS_INDICATION_ENABLED(attId, handle)   CY_BLE_IS_INDICATION_ENABLED_IN_PTR(CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR(attId, handle))
 Checks Indication bit in attribute value referenced by handle.
 
#define CY_BLE_IS_BROADCAST_SUPPORTED(handle)   CY_BLE_GATT_DB_ATTR_CHECK_PRPTY(handle, CY_BLE_GATT_DB_CH_PROP_BROADCAST)
 Checks Broadcast properties in permission field of attribute entry.
 
#define CY_BLE_IS_BROADCAST_ENABLED_IN_PTR(valPtr)   ((0u) != (CY_BLE_SCCD_BROADCAST & Cy_BLE_Get16ByPtr(valPtr)))
 Checks Broadcast bit in attribute value referenced by pointer.
 
#define CY_BLE_IS_BROADCAST_ENABLED(handle)   CY_BLE_IS_BROADCAST_ENABLED_IN_PTR(CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_PTR(handle))
 Checks Broadcast bit in attribute value referenced by handle.
 
#define CY_BLE_IS_RELIABLE_WRITE_ENABLED_IN_PTR(valPtr)   ((0u) != (CY_BLE_CEPD_RELIABLE_WRITE & Cy_BLE_Get16ByPtr(valPtr)))
 Checks Reliable Write bit in attribute value referenced by pointer.
 
#define CY_BLE_IS_RELIABLE_WRITE_ENABLED(handle)   CY_BLE_IS_RELIABLE_WRITE_ENABLED_IN_PTR(CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_PTR(handle))
 Checks Reliable Write bit in attribute value referenced by handle.
 

Macro Definition Documentation

◆ CY_BLE_GATT_DB_ATTR_SET_GEN_VALUE

#define CY_BLE_GATT_DB_ATTR_SET_GEN_VALUE (   handle,
  src,
  length 
)
Value:
(void)memcpy \
( \
(void*)(cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.attGenericValLen->attGenericVal), \
(const void*)(src), \
(uint16_t)(length) \
)
const cy_stc_ble_gatts_db_t * gattDB
Pointer to GATT database structure used in the GAP server.
Definition: cy_ble.h:401

Macro to set generic value of attribute.

◆ CY_BLE_GATT_DB_ATTR_GET_GEN_VALUE

#define CY_BLE_GATT_DB_ATTR_GET_GEN_VALUE (   dst,
  handle,
  length 
)
Value:
(void)memcpy \
( \
(void*)(dst), \
(const void*)(cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.attGenericValLen->attGenericVal), \
(uint16_t)(length) \
)
const cy_stc_ble_gatts_db_t * gattDB
Pointer to GATT database structure used in the GAP server.
Definition: cy_ble.h:401

Macro to get generic value of attribute.

This macro also used to get UUID32 or UUID 128 of the attribute.

◆ CY_BLE_GATT_DB_GET_ATTR_VALUE_UUID

#define CY_BLE_GATT_DB_GET_ATTR_VALUE_UUID (   handle)    cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attValueUuid

Macro to get attribute value UUID for handle.

This macro is only applicable to UUID16. To get UUID32 or UUID 128 use CY_BLE_GATT_DB_ATTR_GET_GEN_VALUE().

◆ CY_BLE_GATT_DB_ATTR_SET_ATTR_GEN_LEN

#define CY_BLE_GATT_DB_ATTR_SET_ATTR_GEN_LEN (   handle,
  value 
)
Value:
do { \
cy_ble_configPtr->gattDB[(handle) - 1u].attValue.attFormatValue.attGenericValLen->actualLength = (value); \
} while(0)

Macro to set actual length of Characteristic generic value.

Note that this macro doesn't validate the actual length, which can't be greater then maximum length. Use CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_MAX_LEN macro to read and validate maximum length.

◆ CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX

#define CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX (   handle)
Value:
cy_ble_configPtr->attValuesCCCD)
#define CY_BLE_GATT_DB_ATTR_GET_ATTR_GEN_PTR(handle)
Macro to get pointer to Characteristic generic value.
Definition: cy_ble_gatt.h:830

Macro to get index of CCCD value.

◆ CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR

#define CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR (   attId,
  handle 
)
Value:
((uint8_t*) &cy_ble_configPtr->flashStorage->cccdRamPtr[ \
(((attId) * (cy_ble_configPtr->flashStorage->cccdCount + CY_BLE_CCCD_CRC_BYTE)) + CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX(handle))])\
uint8_t * cccdRamPtr
Pointer to CCCD values storage in auxiliary flash.
Definition: cy_ble.h:212
const cy_stc_ble_flash_storage_t * flashStorage
Pointer to structure to store bonding data.
Definition: cy_ble.h:395
uint8_t cccdCount
Pointer to CCCD values storage in RAM.
Definition: cy_ble.h:213
#define CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX(handle)
Macro to get index of CCCD value.
Definition: cy_ble_gatt.h:826

Macro to get pointer to CCCD value.