This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I want to send some data (for example. "hello", byte, int etc) from android phone to keyfob

Other Parts Discussed in Thread: CC2541

I have cc2541 mini DK.

no problem with scan and connection between keyfob and android phone.

I am trying to send and receive some date(string, byte, int etc) between cc2541 and Android phone.

I want to send some data (for example. "hello", byte, int etc) from android phone to keyfob then

return some data (for example. "welcome", byte, int etc) from keyfob to android phone

 

i am using keyfob source from "BLE-CC254x-1.4.0\Projects\ble\SimpleBLEPeripheral" and 

android source from here.  http://developer.android.com/samples/BluetoothLeGatt/index.html

not modified, It just works without error.

I can advert data in keyforb, scan, connect the keyforb in android app.

android app shows device name, rssi when scanning, and connection status, service UUIDs, charicteristic UUIDs when connected.

 

but I coulnd find data transfer(send and receive) function in these examples. 

Is there example code implemented that functions?

and where is it?

 

  • When in a BLE connection, all data communication happens through GATT (generic attribute profile). You will need to either modify one of the existing profiles (e.g. SimpleGATTprofile) or create your own if you want to send/receive data from the phone. I would suggest reading the GATT section of the SW Developer's Guide and looking through the SimpleGATTprofile sample code for more information.
  • you can start off with SPPBLESERVER project which has bidirectional communication in built in it