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.

CC2541 example code for GATT service similar to SPP profile?

Other Parts Discussed in Thread: CC2541, CC2540

Hi,

we bought SensorTag and got example code for BLE and iBeacon applications.

We need a 2 way communication between CC2541 and a generic host (Windows PC, android and iOS devices).

Can you provide example code for fw on CC2541 and for SW to develop applications that can implement a bidirectional communication with it? 

We saw other manufacturers provide fw and example code for a bidirectional communication.

Are you planning to devlop something about it?

Many thanks

  • Hi Elisa,

    Have you taken a look at the Example Projects on the TI BLE Wiki page? I'm not sure about your application, but perhaps the "SerialBLEbridge" example may help get you started: http://processors.wiki.ti.com/index.php/SerialBLEbridge

    More Embedded Examples: http://processors.wiki.ti.com/index.php/CC254X_Embedded_Examples
    TI BLE Wiki: www.ti.com/ble-wiki

    Best wishes.
  • Thanks very much for the prompt response but is not really what we need.
    Let me try to explain better.
    We need our device to send and receice strings (commands and responses) via BLE to a Host
    (smartphone, tablet) equipped with BLE, exactly as we do now using Bluetooth standard in SPP profile.
    For example, other BLE module manufacturers (like ACK.me) provide BLE modules with a fw that allows to send
    and receive strings using a peripheral_tx_service and a peripheral_rx_service. They also provide
    sample code (e.g. in object C) for app on smartphone or tablet, to communicate wirelessly via BLE
    with that devices.

    We would like to implement similar services on CC2541 to send via BLE commands and receive answers according our
    proprietary protocol.
    Do you have any similar sample code in C language to include in our fw?
    Do you have also sample code for android or iOS devices to implement app to communicate with that
    BLE peripherals?
    I had a look at the doc you provide, TI BLE Sample Applications Guide and TI BLE Software developper's Guide,
    but I could't see anything close to a tx_service and rx_service, is it right?

    Kind regards

    Elisa

  • Hi Elisa,

    Unfortunately, there is no equivalent SPP adopted profile for BLE. While I don't know exactly what "peripheral_tx_service" and "peripheral_rx_service" are doing as these are not BLE terms, I presume they are using GATT procedures to exchange Attribute (ATT) data. This is how the SerialBLEBridge example is implemented. In your case, you would define a set of Characteristics (a Service) and read/write to those characteristics with your custom data/protocol (i.e strings). A quick example would be to use a CC2541 dev kit and the TI BLE MultiTool or LightBlue iOS app to enteract with the SimpleGATTProfile using the SimpleBLEPeripheral example project.

    We do have sample Smartphone code/reference on our BLE wiki: http://processors.wiki.ti.com/index.php/CC254X_Smart_Phone_Examples

    You can see examples on how iOS/Android communicates with the SensorTag HW. However, I recommend reviewing the latest BLE design / API guides for the respective phone OS.

    Best wishes

  • Hi JXS,

    do you provide similar code example also for CC26xx? In particular I still need code for CC26xx to emulate serial interface (my device need to receive/transmit data from/to USB and send/receive through BLE to a BLE device).

    Kind regards
    Elisa
  • Dear JXS,

    I have a look at SerialBLEbridge", I could compile the project and I would like to  test it.

    I've read I need:

    • 1 SmartRF05 EB + CC2541 EM 
    • 1 CC2540 USB Dongle

    but what SW I should use on the host (PC)?

    Can I send a string from my PC using SmartRF05 EB + CC2541 EM to the CC2540 USB Dongle using a common terminal sw like HyperTerminal?

    And how can I see the string received by the CC2540 USB Dongle? Only using BLE packet Sniffer?

    Thanks in advance

    Kind reagards

    Elisa