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. | |
| #define CY_BLE_GATT_DB_ATTR_SET_GEN_VALUE | ( | handle, | |
| src, | |||
| length | |||
| ) |
Macro to set generic value of attribute.
| #define CY_BLE_GATT_DB_ATTR_GET_GEN_VALUE | ( | dst, | |
| handle, | |||
| length | |||
| ) |
Macro to get generic value of attribute.
This macro also used to get UUID32 or UUID 128 of the attribute.
| #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().
| #define CY_BLE_GATT_DB_ATTR_SET_ATTR_GEN_LEN | ( | handle, | |
| value | |||
| ) |
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.
| #define CY_BLE_GATT_DB_ATTR_GET_CCCD_IDX | ( | handle | ) |
Macro to get index of CCCD value.
| #define CY_BLE_GATT_DB_ATTR_GET_CCCD_ATTR_GEN_PTR | ( | attId, | |
| handle | |||
| ) |
Macro to get pointer to CCCD value.