Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60

General Description

API unique to BMS designs configured as a GATT Client role.

A letter 'c' is appended to the API name: Cy_BLE_BMSC_

Functions

cy_en_ble_api_result_t Cy_BLE_BMSC_GetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bms_char_index_t charIndex)
 Sends a request to the peer device to get a characteristic value, as identified by its charIndex. More...
 
cy_en_ble_api_result_t Cy_BLE_BMSC_SetCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bms_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 This function is used to write the characteristic (which is identified by charIndex) value attribute in the server. More...
 
cy_en_ble_api_result_t Cy_BLE_BMSC_ReliableWriteCharacteristicValue (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bms_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue)
 Performs a Reliable Write command for the Bond Management Control Point characteristic (identified by charIndex) value attribute to the server. More...
 
cy_en_ble_api_result_t Cy_BLE_BMSC_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_bms_char_index_t charIndex, cy_en_ble_bms_descr_index_t descrIndex)
 Sends a request to the peer device to get the characteristic descriptor of the specified characteristic of Bond Management service. More...
 

Function Documentation

◆ Cy_BLE_BMSC_GetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_BMSC_GetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bms_char_index_t  charIndex 
)

Sends a request to the peer device to get a characteristic value, as identified by its charIndex.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic of cy_en_ble_bms_char_index_t. The valid values are,
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent 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_INVALID_STATE Connection with the server is not established.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular characteristic.
Events
If execution is successful(return value = CY_BLE_SUCCESS), these events can appear:
If a BMS service-specific callback is registered with Cy_BLE_BMS_RegisterAttrCallback(): Otherwise (if a BMS service-specific callback is not registered):

◆ Cy_BLE_BMSC_SetCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_BMSC_SetCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bms_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

This function is used to write the characteristic (which is identified by charIndex) value attribute in the server.

The function supports the Write Long procedure - it depends on the attrSize parameter - if it is larger than the current MTU size - 1, then the Write Long will be executed. As a result, a Write Request is sent to the GATT Server and on successful execution of the request on the server side, a CY_BLE_EVT_BMSS_WRITE_CHAR event is generated. On successful request execution on the server side, the Write Response is sent to the client.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic of cy_en_ble_bms_char_index_t. The valid values are,
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be sent to the server device.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent 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 The peer device doesn't have the particular characteristic.
CY_BLE_ERROR_INVALID_STATE Connection with the server is not established.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
Events
If execution is successful(return value = CY_BLE_SUCCESS), these events can appear:
If a BMS service-specific callback is registered with Cy_BLE_BMS_RegisterAttrCallback(): Otherwise (if a BMS service-specific callback is not registered):

◆ Cy_BLE_BMSC_ReliableWriteCharacteristicValue()

cy_en_ble_api_result_t Cy_BLE_BMSC_ReliableWriteCharacteristicValue ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bms_char_index_t  charIndex,
uint8_t  attrSize,
uint8_t *  attrValue 
)

Performs a Reliable Write command for the Bond Management Control Point characteristic (identified by charIndex) value attribute to the server.

The Write Response only confirms the operation success.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic of cy_en_ble_bms_char_index_t. The valid values are,
charIndexThe index of a service characteristic.
attrSizeThe size of the characteristic value attribute.
attrValueThe pointer to the characteristic value data that should be sent to the server device.
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent 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 The peer device doesn't have the particular characteristic.
CY_BLE_ERROR_INVALID_STATE Connection with the server is not established.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
Events
If execution is successful(return value = CY_BLE_SUCCESS), these events can appear:
If a BMS service-specific callback is registered with Cy_BLE_BMS_RegisterAttrCallback(): Otherwise (if a BMS service-specific callback is not registered):

◆ Cy_BLE_BMSC_GetCharacteristicDescriptor()

cy_en_ble_api_result_t Cy_BLE_BMSC_GetCharacteristicDescriptor ( cy_stc_ble_conn_handle_t  connHandle,
cy_en_ble_bms_char_index_t  charIndex,
cy_en_ble_bms_descr_index_t  descrIndex 
)

Sends a request to the peer device to get the characteristic descriptor of the specified characteristic of Bond Management service.

Parameters
connHandleThe connection handle.
charIndexThe index of the service characteristic of cy_en_ble_bms_char_index_t. The valid values are,
descrIndexThe index of the service characteristic descriptor of type cy_en_ble_bms_descr_index_t. The valid value is
Returns
A return value of type cy_en_ble_api_result_t.
Error Codes Description
CY_BLE_SUCCESS The request was sent successfully.
CY_BLE_ERROR_INVALID_PARAMETER Validation of the input parameter failed.
CY_BLE_ERROR_INVALID_OPERATION This operation is not permitted on the specified attribute.
CY_BLE_ERROR_INVALID_STATE The state is not valid.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Memory allocation failed.
CY_BLE_ERROR_GATT_DB_INVALID_ATTR_HANDLE The peer device doesn't have the particular descriptor.
Events
In case of successful execution (return value = CY_BLE_SUCCESS) the following events can appear:
If the BMS service-specific callback is registered with Cy_BLE_BMS_RegisterAttrCallback(): Otherwise (if an BMS service-specific callback is not registered):