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

PSoC™ 4 Forum Discussions

moro_1580446
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

Hi everybody.

I am new in Bluetooth on CY8C4247LQI_BL483. I need to build a dongle that gives data by Bluetooth from application on phone and then convert on Zigbee(MRF24j40 microchip). second side include of Zigbee and everything that need on configuration of SPI for Zigbee is true and working well but my question is about Bluetooth?

could you say me how can I modify BLE on CY8C4247LQI_BL483 as a server and send data on GATT and receive it in database to prepare send on Zigbee module.

I have not any problem on GAP connection modify but most of problem is in GATT.

1- How can I write data from application on BLE GATT database?

2- How can read new data from GATT database to send on Zigbee after that?

3- Another thing I do not know how can remove GATT database after read?

I attached my project here. Please help me to run it. I try to run it on UART at first, when I can read data from GATT database, Subsequently can change UART to SPI to replace  for Zigbee.

Thankyou for attention...

0 Likes
1 Solution
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

You can use the following APIs to write and read data from GATT database, CyBle_GattsReadAttributeValue() and CyBle_GattsWriteAttributeValue(). Please refer BLE component datasheet fore more details about these APIs.

As per my understanding, your requirement is to write data to CYBLE_BLUETOOTH_TO_ZIGBEE_READ_CHAR_HANDLE and send the received data over Zigbee. Please correct me if I am wrong.

When you receive write request from client, you can use CyBle_GattsWriteAttributeValue() to write data to GATT database. After that, you can use CyBle_GattsReadAttributeValue()  to read data from GATT database.

Based on my understanding I made some changes to you project. It is attached with this response. It will read data from GATT database when client performs a write operation. Read data is sent to UART, you can see it on UART terminal. Please test it and let me know the results.

I tested your project using the device CY8C4248LQI-BL583. Please update the device in PSoC creator project before testing.

Thanks and Regards,

Sudheesh

View solution in original post

0 Likes
3 Replies
SudheeshK
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hello,

You can use the following APIs to write and read data from GATT database, CyBle_GattsReadAttributeValue() and CyBle_GattsWriteAttributeValue(). Please refer BLE component datasheet fore more details about these APIs.

As per my understanding, your requirement is to write data to CYBLE_BLUETOOTH_TO_ZIGBEE_READ_CHAR_HANDLE and send the received data over Zigbee. Please correct me if I am wrong.

When you receive write request from client, you can use CyBle_GattsWriteAttributeValue() to write data to GATT database. After that, you can use CyBle_GattsReadAttributeValue()  to read data from GATT database.

Based on my understanding I made some changes to you project. It is attached with this response. It will read data from GATT database when client performs a write operation. Read data is sent to UART, you can see it on UART terminal. Please test it and let me know the results.

I tested your project using the device CY8C4248LQI-BL583. Please update the device in PSoC creator project before testing.

Thanks and Regards,

Sudheesh

0 Likes

Hi. Thanks a lot my friend. Its solved. Now I will try to replace Zigbee with UART but i have another question about GATT database. How can I remove last payload to clear database? And how can I get RSSI and LQI in communication between phone and client(psoc4ble)?

Thank you for attention...

0 Likes

Hello,

1. You can use CyBle_GattsWriteAttributeValue() API to clear data in GATT database.

2. API CyBle_GetRssi() can be used to read RSSI data.

Please refer BLE component datasheet for more details about above APIs.


Thanks and Regards,

Sudheesh

0 Likes