API unique to GLS designs configured as a GATT Server role.
A letter 's' is appended to the API name: Cy_BLE_GLSS_
|
cy_en_ble_api_result_t | Cy_BLE_GLSS_SetCharacteristicValue (cy_en_ble_gls_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sets a characteristic value of the service, which is identified by charIndex. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_GLSS_GetCharacteristicValue (cy_en_ble_gls_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Gets a characteristic value of Glucose service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_GLSS_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_gls_char_index_t charIndex, cy_en_ble_gls_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Gets a characteristic descriptor of the specified characteristic of Glucose service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_GLSS_SendNotification (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_gls_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends a notification of the specified characteristic to the client device, as defined by the charIndex value. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_GLSS_SendIndication (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_gls_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends an indication of the specified characteristic to the client device, as defined by the charIndex value. More...
|
|
◆ Cy_BLE_GLSS_SetCharacteristicValue()
Sets a characteristic value of the service, which is identified by charIndex.
- Parameters
-
charIndex | The index of the service characteristic of type cy_en_ble_gls_char_index_t. |
attrSize | The size of the characteristic value attribute. |
*attrValue | The pointer to the characteristic value data that should be stored in the GATT database. |
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | The request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | An optional characteristic is absent. |
◆ Cy_BLE_GLSS_GetCharacteristicValue()
Gets a characteristic value of Glucose service.
The value is identified by charIndex.
- Parameters
-
charIndex | The index of the service characteristic of type cy_en_ble_gls_char_index_t. |
attrSize | The size of the characteristic value attribute. |
*attrValue | Pointer to the location where Characteristic value data should be stored. |
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | The characteristic value was read successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
◆ Cy_BLE_GLSS_GetCharacteristicDescriptor()
Gets a characteristic descriptor of the specified characteristic of Glucose service.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_gls_char_index_t. |
descrIndex | The index of the service characteristic descriptor of type cy_en_ble_gls_descr_index_t. |
attrSize | The size of the descriptor value attribute. |
*attrValue | Pointer to the location where the descriptor value data should be stored. |
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | The characteristic descriptor value was read successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
◆ Cy_BLE_GLSS_SendNotification()
Sends a notification of the specified characteristic to the client device, as defined by the charIndex value.
On enabling notification successfully for a service characteristic it sends out a 'Handle Value Notification' which results in CY_BLE_EVT_GLSC_NOTIFICATION event at the GATT Client's end.
- Parameters
-
connHandle | The connection handle which consist of the device ID and ATT connection ID. |
charIndex | The index of the service characteristic of type cy_en_ble_gls_char_index_t. |
attrSize | The size of the characteristic value attribute. |
*attrValue | Pointer to the Characteristic value data that should be sent to Client device. |
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | The request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_INVALID_OPERATION | Operation is invalid for this characteristic. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | An optional characteristic is absent. |
CY_BLE_ERROR_INVALID_STATE | Connection with the client is not established. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
CY_BLE_ERROR_NTF_DISABLED | Notification is not enabled by the client. |
◆ Cy_BLE_GLSS_SendIndication()
Sends an indication of the specified characteristic to the client device, as defined by the charIndex value.
On enabling indication successfully it sends out a 'Handle Value Indication' which results in CY_BLE_EVT_GLSC_INDICATION or CY_BLE_EVT_GATTC_HANDLE_VALUE_IND (if service-specific callback function is not registered) event at the GATT Client's end.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the service characteristic of type cy_en_ble_gls_char_index_t. |
attrSize | The size of the characteristic value attribute. |
*attrValue | Pointer to the Characteristic value data that should be sent to Client device. |
- Returns
- A return value of type cy_en_ble_api_result_t.
Error Codes | Description |
CY_BLE_SUCCESS | The request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
CY_BLE_ERROR_INVALID_OPERATION | Operation is invalid for this characteristic. |
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE | An optional characteristic is absent. |
CY_BLE_ERROR_INVALID_STATE | Connection with the client is not established. |
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED | Memory allocation failed. |
CY_BLE_ERROR_IND_DISABLED | Indication is not enabled by the client. |
- Events
- In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the GLS service-specific callback is registered with Cy_BLE_GLS_RegisterAttrCallback():
Otherwise (if the GLS service-specific callback is not registered):