Announcements
IMPORTANT: Cypress Developer Community currently doesn’t allow sign-in to prepare for the upcoming transition. To learn more, check out our announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 6

OscarC
New Contributor II

Hi all,

I'm trying to use the two services CTS and ANCS, to update the clock and to receive notifications from iOS.

On event CY_BLE_EVT_GATTC_DISCOVERY_COMPLETE:

If I only call the function Cy_BLE_CTSC_SetCharacteristicDescriptor, it works

If I only call the function Cy_BLE_ANCSC_SetCharacteristicDescriptor, it works

if I call them both, the second returns the error 0x160002

what could be the mistake I make?

Thank you

 

Oscar

0 Likes
1 Solution
Yugandhar
Moderator
Moderator

Hello,

In case of successful execution of Cy_BLE_ANSC_SetCharacteristicDescriptor api (return value = CY_BLE_SUCCESS) the following events can appear:
If the ANS service-specific callback is registered with Cy_BLE_ANS_RegisterAttrCallback():
CY_BLE_EVT_ANSC_WRITE_DESCR_RESPONSE - In case if the requested attribute is successfully written on the peer device, the details (char index, descr index etc.) are provided with event parameter structure of type cy_stc_ble_ans_descr_value_t.
Otherwise (if an ANC service-specific callback is not registered):
CY_BLE_EVT_GATTC_WRITE_RSP - If the requested attribute is successfully written on the peer device.
CY_BLE_EVT_GATTC_ERROR_RSP - If an error occurred with the requested attribute on the peer device, the details are provided with an event parameter structure ( cy_stc_ble_gatt_err_param_t).

In case of successful execution of Cy_BLE_CTSC_SetCharacteristicDescriptor api (return value = CY_BLE_SUCCESS) the following events can appear:
If the CTS service-specific callback is registered with Cy_BLE_CTS_RegisterAttrCallback():
CY_BLE_EVT_CTSC_WRITE_DESCR_RESPONSE - In case if the requested attribute is successfully written on the peer device, the details (char index, descr index etc.) are provided with event parameter structure of type cy_stc_ble_cts_descr_value_t.
Otherwise (if an CTS service-specific callback is not registered):
CY_BLE_EVT_GATTC_WRITE_RSP - If the requested attribute is successfully written on the peer device.
CY_BLE_EVT_GATTC_ERROR_RSP - If an error occurred with the requested attribute on the peer device, the details are provided with an event parameter structure ( cy_stc_ble_gatt_err_param_t).

Please check these events before calling other function.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
2 Replies
Yugandhar
Moderator
Moderator

Hello,

In case of successful execution of Cy_BLE_ANSC_SetCharacteristicDescriptor api (return value = CY_BLE_SUCCESS) the following events can appear:
If the ANS service-specific callback is registered with Cy_BLE_ANS_RegisterAttrCallback():
CY_BLE_EVT_ANSC_WRITE_DESCR_RESPONSE - In case if the requested attribute is successfully written on the peer device, the details (char index, descr index etc.) are provided with event parameter structure of type cy_stc_ble_ans_descr_value_t.
Otherwise (if an ANC service-specific callback is not registered):
CY_BLE_EVT_GATTC_WRITE_RSP - If the requested attribute is successfully written on the peer device.
CY_BLE_EVT_GATTC_ERROR_RSP - If an error occurred with the requested attribute on the peer device, the details are provided with an event parameter structure ( cy_stc_ble_gatt_err_param_t).

In case of successful execution of Cy_BLE_CTSC_SetCharacteristicDescriptor api (return value = CY_BLE_SUCCESS) the following events can appear:
If the CTS service-specific callback is registered with Cy_BLE_CTS_RegisterAttrCallback():
CY_BLE_EVT_CTSC_WRITE_DESCR_RESPONSE - In case if the requested attribute is successfully written on the peer device, the details (char index, descr index etc.) are provided with event parameter structure of type cy_stc_ble_cts_descr_value_t.
Otherwise (if an CTS service-specific callback is not registered):
CY_BLE_EVT_GATTC_WRITE_RSP - If the requested attribute is successfully written on the peer device.
CY_BLE_EVT_GATTC_ERROR_RSP - If an error occurred with the requested attribute on the peer device, the details are provided with an event parameter structure ( cy_stc_ble_gatt_err_param_t).

Please check these events before calling other function.

Thanks,
P Yugandhar.

View solution in original post

0 Likes
OscarC
New Contributor II

Hello and thank you for your reply,

I will try the approach you have suggested to me.

Regards

0 Likes
Top labels