cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

Sanyika
New Contributor II

Hello,

I configured the BLE component as a Central with just client elements.
I want to subscribe to multiple notification.

When I subscribe just one notification, my code works,
but when I send all notification one by one, it's not working

What is the good way to subscribe to different notification element.

Thank you
Alexandre

            apiResult = CyBle_GattcWriteCharacteristicDescriptors(cyBle_connHandle, &writeRequestData1);
            CyBle_ProcessEvents();
            if(apiResult != CYBLE_ERROR_OK)
            {
                DBG_PRINTF("WriteReq1 API Error: %d \r\n", apiResult);
                ShowError();
            }
            apiResult = CyBle_GattcWriteCharacteristicDescriptors(cyBle_connHandle, &writeRequestData2);
            CyBle_ProcessEvents();
            if(apiResult != CYBLE_ERROR_OK)
            {
                DBG_PRINTF("WriteReq2 API Error: %d \r\n", apiResult);
                ShowError();
            }
            apiResult = CyBle_GattcWriteCharacteristicDescriptors(cyBle_connHandle, &writeRequestData3);
            CyBle_ProcessEvents();
            if(apiResult != CYBLE_ERROR_OK)
            {
                DBG_PRINTF("WriteReq3 API Error: %d \r\n", apiResult);
                ShowError();
            }

 

0 Likes
1 Solution
Yugandhar
Moderator
Moderator

Hello,

CYBLE_EVT_GATTC_WRITE_RSP event will be received if the write operation is succeeded. An Error Response event (CYBLE_EVT_GATTC_ERROR_RSP) will be sent by the server if a write operation is not success.
Please check these events before calling the CyBle_GattcWriteCharacteristicDescriptors() functions in the code.

Thanks,
P Yugandhar.

View solution in original post

1 Reply
Yugandhar
Moderator
Moderator

Hello,

CYBLE_EVT_GATTC_WRITE_RSP event will be received if the write operation is succeeded. An Error Response event (CYBLE_EVT_GATTC_ERROR_RSP) will be sent by the server if a write operation is not success.
Please check these events before calling the CyBle_GattcWriteCharacteristicDescriptors() functions in the code.

Thanks,
P Yugandhar.

View solution in original post