PSOC6 BLE - CTS and ANCS services

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
OscarC
Level 1
Level 1
5 sign-ins First reply posted First question asked

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
Moderator
500 solutions authored 1000 replies posted 5 likes given

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
Moderator
500 solutions authored 1000 replies posted 5 likes given

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.

0 Likes
OscarC
Level 1
Level 1
5 sign-ins First reply posted First question asked

Hello and thank you for your reply,

I will try the approach you have suggested to me.

Regards

0 Likes