Create customized gatt service

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

cross mob
BiWa_3702261
Level 1
Level 1
First like received

Dear Cypress,

I'm new for PSoc63. I want to add a gatt  customized gatt service. All operations I have done are in the TopDesign.cysch. And the demo project is based on BLE Apple Notification Client01.

Though the Configuration dialog for BLE Bluetooth 5.0 module, I successfully created a service with a 16bit UUID = 0xFFF0. And I have added 2 characteristics in this service. One with UUID=0xFFF6 is used to transmit data from Smart phone to the PSoC6 device which properity is "write" and "write whitout response". Another one with UUID=0xFFF7 is used to transmit data from PSoC6 device to the Smart phone which property is just "notify". After complete the configuration, I rebuild the project and program the firmware to the PSoC6 device successfully. After run, we can use a third party BLE central tool to connect the PSoC6 device which advertising name is ANCS. And when I complete all discovery about the services, characteristics and descriptors, then to enable the notifications of the characteristic which UUID is 0xFFF7, I found the PSOC6 didn't give the write response to the central device.

I need help to create customize service. Thanks for any reply.

BRs.

0 Likes
1 Solution

Hello,

In the GATT_OUT example, When we enable the notification the PSoC6 peripheral will give the write response to the central device using Cy_BLE_GATTS_WriteRsp() function. This function sends a Write Response from a GATT Server to the GATT Client. And, this write response results in CYBLE_EVT_GATTC_WRITE_RSP event at the GATT Client's end.

Thanks,

P Yugandhar.

View solution in original post

6 Replies
BiWa_3702261
Level 1
Level 1
First like received

微信图片_20190710232923.png微信图片_20190710232933.png微信图片_20190710232937.png微信图片_20190710232940.png

I forgot to insert some screenshot about the custom service. Above is another try to insert 128-bit UUID based Service. The same problem still.

0 Likes

Hello,

Please look at the "CE222046_Throughput_Measurement" GATT_OUT example project in the PSoC Creator to understand how to send data from PSoC6 peripheral to central device over BLE custom service.

Please let me know if this helps.

Thanks,

P Yugandhar.

0 Likes

Hi P Yugandhar,

I have tested the GATT_Out example, It seems it has the same problem. when enable the notification of  the characteristic in the customize service. The PSoC6 won't give the write response. From the BLE GATT Specification, the PSoC6 should give the write response.

0 Likes

Hello,

In the GATT_OUT example, When we enable the notification the PSoC6 peripheral will give the write response to the central device using Cy_BLE_GATTS_WriteRsp() function. This function sends a Write Response from a GATT Server to the GATT Client. And, this write response results in CYBLE_EVT_GATTC_WRITE_RSP event at the GATT Client's end.

Thanks,

P Yugandhar.

BiWa_3702261
Level 1
Level 1
First like received

Thanks for the comment. I found Cy_BLE_GATTS_WriteRsp() is called in the in the event CY_BLE_EVT_GATTS_WRITE_REQ processing in cy_ble_gatt_event_handler.c by default. But the IDE created a flag variable cy_ble_eventHandlerFlag that need to be cleared by the user manaully. If the clear operation "cy_ble_eventHandlerFlag &= (uint8_t) ~CY_BLE_CALLBACK" did not added before Cy_BLE_SendWriteResponse() function call. Then the Cy_BLE_GATTS_WriteRsp() won't be called. So I resovle this problem by adding the flag clear operation.

lock attach
Attachments are accessible only for community members.

Hello,

We can manually call Cy_BLE_GATTS_WriteRsp() function in CY_BLE_EVT_GATTS_WRITE_REQ event in user defined event handler as shown in attached image.

Thanks,

P Yugandhar.

0 Likes