Several projects over here using ADC (first link) -
http://www.cypress.com/?id=5509 100 Projects in 100 Days with Bluetooth
http://www.cypress.com/?rID=102512 AN91445 - Antenna Design Guide
http://www.cypress.com/?rID=102505 AN94020 - Getting Started with PRoC™ BLE
http://www.cypress.com/?rID=110007 AN92584 - Designing for Low Power and Estimating Battery Life for BLE Applications
http://www.cypress.com/?rID=109900 AN91162 - Creating a BLE Custom Profile
http://www.cypress.com/?rID=110107 AN91184 - PSoC 4 BLE - Designing BLE Applications
http://www.cypress.com/?rID=102504 AN91267 - Getting Started with PSoC® 4 BLE
http://www.cypress.com/?rID=107332 AN95089 - PSoC® 4/PRoC™ BLE Crystal Oscillator Selection and Tuning Techniques
Also PSOC Creator start page, "Find Example projects" link.
Since my crystal-ball is in repair I am not able to check your program . I cannot see where ADC_volt_convert() is called and what you do with the result. Can you post your complete project, so that we all can have a look at all of your settings? To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
You mean this in his code -
Try out this example should work for you it reads a signal an transmits it back to your Cysmart app. Also this gitthub locations has 49 good examples for using PSOC BLE.
I have been able to solve the ADC read problem. Still I have some doubt regarding the CyBle API.
1. CYBLE_EVT_GATTS_WRITE_REQ event is generated whenever there is a write request from GATT client Please correct if I am wrong. Similary when would the CYBLE_EVT_GATTC_WRITE_RSP event would be generated. I guess CYBLE_EVT_GATTC_WRITE_RSP is generated at the client side??
2. If I want to send a read request seperatly from client instead of response to write request which API should I use.
3. Another thing I am confused with is If I am configuring the GATT server I should use only GATT server API function, not the GATTC client API fucntions ??
1) In your project, you will not get CYBLE_EVT_GATTC_WRITE_RSP as it is generated on the Client side. You are Server.
2) I did not understand this question. Does it mean that you want a way to send the latest data when you receive the Read request from connected GATT Client?
If yes, then note that unlike Write request from GATT Client, you do not get an event in Stack Handler when Client sends a read request. When a Read request comes, the stack automatically takes care of sending the correct data back. The only thing you need to do is to update the Database with the new value whenever you have. You updating the Database and Stack sending the data as part of read request are asynchronous.
Use the API CyBle_GattsWriteAttributeValue() to update your GATT database with new ADC data whenever it is available. The stack will take care of sending this data to Client when read request arrives.
Please check out the application note AN91162 at http://www.cypress.com/?rID=109900 regarding how to handle Custom GATT database on the server side.
3) Correct, the GATTS (GATT ending with S) are Server related API/macros and to be used in that role. GATTC (GATT with C) are Client based APIs which you don;t need in your project.
Following this conversation:
Imagine that the client wants to READ a timestamp. There is no sense that the server (proc 4 ble) must change the BLE database every second. I can see that the "CYBLE_EVT_GATTS_READ_CHAR_VAL_ACCESS_REQ" event is generated when the client try to read. The problem is that the previous value is sent even if I modify the database with the CyBle_GattsWriteAttributeValue() function. Is there a way to synchronize the READ action with a new data to send?