Cypress PSoC 6 Bluetooth Low Energy Middleware Library 3.60
WSS Server and Client Function

General Description

These are API common to both GATT Client role and GATT Server role.

You may use them in either roles.

No letter is appended to the API name: Cy_BLE_WSS_

Functions

cy_en_ble_api_result_t Cy_BLE_WSSS_Init (const cy_stc_ble_wsss_config_t *config)
 This function initializes server for the Weight Scale service. More...
 
cy_en_ble_api_result_t Cy_BLE_WSSC_Init (const cy_stc_ble_wssc_config_t *config)
 This function initializes client for the Weight Scale service. More...
 
void Cy_BLE_WSS_RegisterAttrCallback (cy_ble_callback_t callbackFunc)
 Registers a callback function for service-specific attribute operations. More...
 

Function Documentation

◆ Cy_BLE_WSSS_Init()

cy_en_ble_api_result_t Cy_BLE_WSSS_Init ( const cy_stc_ble_wsss_config_t config)

This function initializes server for the Weight Scale service.

Parameters
configConfiguration structure for the WSS.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. The following are possible error codes.
Error Codes Description
CY_BLE_SUCCESS The function completed successfully.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL as input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Buffer overflow in the registration callback.

◆ Cy_BLE_WSSC_Init()

cy_en_ble_api_result_t Cy_BLE_WSSC_Init ( const cy_stc_ble_wssc_config_t config)

This function initializes client for the Weight Scale service.

Parameters
configConfiguration structure for the WSS.
Returns
cy_en_ble_api_result_t : Return value indicates whether the function succeeded or failed. The following are possible error codes.
Error Codes Description
CY_BLE_SUCCESS The function completed successfully.
CY_BLE_ERROR_INVALID_PARAMETER On specifying NULL as input parameter.
CY_BLE_ERROR_MEMORY_ALLOCATION_FAILED Buffer overflow in the registration callback.

◆ Cy_BLE_WSS_RegisterAttrCallback()

void Cy_BLE_WSS_RegisterAttrCallback ( cy_ble_callback_t  callbackFunc)

Registers a callback function for service-specific attribute operations.

Service-specific Write Requests from the peer device will not be handled with an unregistered callback function.

Parameters
callbackFuncAn application layer event callback function to receive events from the PSoC 6 BLE Middleware. The definition of cy_ble_callback_t for WSS service is:
typedef void (* cy_ble_callback_t) (uint32_t eventCode, void *eventParam), where:
  • eventCode: Indicates the event that triggered this callback (e.g. CY_BLE_EVT_WSSS_INDICATION_ENABLED).
  • eventParam: Contains the parameters corresponding to the current event (e.g. pointer to cy_stc_ble_wss_char_value_t structure that contains details of the characteristic for which the notification enabled event was triggered).