API unique to WSS designs configured as a GATT Server role.
A letter 's' is appended to the API name: Cy_BLE_WSSS_
|
uint8_t | Cy_BLE_WSS_GetAdUserIdListSize (uint8_t advertisingParamIndex) |
| Returns the size (in bytes) of the User ID List in the advertisement packet. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSS_SetAdUserId (uint8_t listSize, const uint8_t userIdList[], uint8_t advertisingParamIndex) |
| Sets the User ID List to the advertisement packet. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSSS_SetCharacteristicValue (cy_en_ble_wss_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sets a value for one of two characteristic values of the Weight Scale service. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSSS_GetCharacteristicValue (cy_en_ble_wss_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Reads a characteristic value of the Weight Scale service, which is identified by charIndex from the GATT database. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSSS_SetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wss_char_index_t charIndex, cy_en_ble_wss_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sets the characteristic descriptor of the specified characteristic. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSSS_GetCharacteristicDescriptor (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wss_char_index_t charIndex, cy_en_ble_wss_descr_index_t descrIndex, uint8_t attrSize, uint8_t *attrValue) |
| Reads a a characteristic descriptor of a specified characteristic of the Weight Scale service from the GATT database. More...
|
|
cy_en_ble_api_result_t | Cy_BLE_WSSS_SendIndication (cy_stc_ble_conn_handle_t connHandle, cy_en_ble_wss_char_index_t charIndex, uint8_t attrSize, uint8_t *attrValue) |
| Sends an indication with a characteristic value of the Weight Scale service, which is a value specified by charIndex, to the client's device. More...
|
|
◆ Cy_BLE_WSS_GetAdUserIdListSize()
uint8_t Cy_BLE_WSS_GetAdUserIdListSize |
( |
uint8_t |
advertisingParamIndex | ) |
|
Returns the size (in bytes) of the User ID List in the advertisement packet.
- Parameters
-
advertisingParamIndex | The index of the peripheral and broadcast configuration in the customizer. For example:
- CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX
- CY_BLE_BROADCASTER_CONFIGURATION_0_INDEX
|
- Returns
- Size of User ID List.
◆ Cy_BLE_WSS_SetAdUserId()
cy_en_ble_api_result_t Cy_BLE_WSS_SetAdUserId |
( |
uint8_t |
listSize, |
|
|
const uint8_t |
userIdList[], |
|
|
uint8_t |
advertisingParamIndex |
|
) |
| |
Sets the User ID List to the advertisement packet.
To be able to set the User ID List with this function, the advertisement packet should be configured in the Component GUI to include Weight Scale service UUID in the service Data field. The service Data should have enough room to fit the User ID List that is planned to be advertised. To reserve the room for the User ID List, the service Data for WSS should be filled with Unknown User ID - 0xFF. The amount of 0xFF's should be equal to the User List Size that is planned to be advertised. This function must be called when Cy_BLE_StackGetBleSsState() returns CY_BLE_BLESS_STATE_EVENT_CLOSE state.
- Parameters
-
listSize | The size of the User List. |
userIdList | The array contains a User List. |
advertisingParamIndex | The index of the peripheral and broadcast configuration in the customizer. For example:
- CY_BLE_PERIPHERAL_CONFIGURATION_0_INDEX
- CY_BLE_BROADCASTER_CONFIGURATION_0_INDEX
|
- 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 | On NULL pointer, Data length in input parameter exceeds maximum advertisement packet length. |
CY_BLE_ERROR_INVALID_OPERATION | The advertisement packet doesn't contain the User List or it is to small or ADV event is not closed. |
◆ Cy_BLE_WSSS_SetCharacteristicValue()
Sets a value for one of two characteristic values of the Weight Scale service.
The characteristic is identified by charIndex.
- Parameters
-
charIndex | The index of a Weight Scale service characteristic. |
attrSize | The size of the characteristic value attribute. |
attrValue | The pointer to the characteristic value data that should be stored to 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_WSSS_GetCharacteristicValue()
Reads a characteristic value of the Weight Scale service, which is identified by charIndex from the GATT database.
- Parameters
-
charIndex | The index of the Weight Scale service characteristic. |
attrSize | The size of the Weight Scale service characteristic value attribute. |
attrValue | The 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 request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
◆ Cy_BLE_WSSS_SetCharacteristicDescriptor()
Sets the characteristic descriptor of the specified characteristic.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the service characteristic. |
descrIndex | The index of the descriptor. |
attrSize | The size of the characteristic descriptor attribute. |
attrValue | The pointer to the descriptor value data to 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_WSSS_GetCharacteristicDescriptor()
Reads a a characteristic descriptor of a specified characteristic of the Weight Scale service from the GATT database.
- Parameters
-
connHandle | The connection handle. |
charIndex | The index of the characteristic. |
descrIndex | The index of the descriptor. |
attrSize | The size of the descriptor value. |
attrValue | The pointer to the location where characteristic 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 request was handled successfully. |
CY_BLE_ERROR_INVALID_PARAMETER | Validation of the input parameter failed. |
◆ Cy_BLE_WSSS_SendIndication()
Sends an indication with a characteristic value of the Weight Scale service, which is a value specified by charIndex, to the client's device.
On enabling indication successfully it sends out a 'Handle Value Indication' which results in CY_BLE_EVT_WSSC_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. |
attrSize | The size of the characteristic value attribute. |
attrValue | The pointer to the characteristic value data that should be sent to the client's 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 | This operation is not permitted. |
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 WSS service-specific callback is registered with Cy_BLE_WSS_RegisterAttrCallback():
Otherwise (if the WSS service-specific callback is not registered):