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.

CC2540 Communication with Android 4.3 and BLE 4.0

Other Parts Discussed in Thread: CC2540

Hello.

In order to develop my project, I add some services to the original keyfob example.

One service has 3 characteristics, each one with a length of 256 bytes.

The second service has 1 characteristic with a length of 512 bytes.

To achieve successful trasmission of all bytes I needed to change the _ReadAttrCB routine for all services as discussed in a previous thread.

In the other side of the BLE communication, there is an application running and developed by a teammate.

At this moment, if we try to read only one of the services, the total time spent ( establish connection, data transfer and finish connection) is roughly around 2.5s-3s (Even so, i think it is very slow. Why?). Time counting is in the application.

Reading both services, there is an huge increase in reading time, more than 30s.

We tried to understand the problem, and we change array lengths in both services.

In the first service, all the characteristics length were set, each one, to only 2 bytes.

The characteristic of the second service was increased from 512 to 1024 bytes.

Reading only the second service, we get only 600 bytes from the bluetooth and take less than 3s to read.

I need your help to understand where is the problem (in cc2540 or in the application).

We also try to read only one characteristic in each connection. In the application a timer of 10ms and later of 100ms orders to establish a new connection and read a different caracteristic. This solution leads a smartphone malfunction.

Questions:

1 - Why we take so long to read one service/one characteristic? Data rate is 1Mbit/s...

2 - It is possible to know/track the problem of a maximum length of 600 bytes for one characteristic?

3 - How to decrease data transfer time for all the services? If we read, independently,  the first service in 3s and the second service in 2.5s, why when we try to read both services in the same connection, we take 30s to read all the data?

Best Regards,

Tiago

  • Tiago Marçal said:
    1 - Why we take so long to read one service/one characteristic? Data rate is 1Mbit/s...

    Application layer throughput is not 1Mbps (that is the PHY datarate) Please read the SW developer's guide or look at TI's training material for some BLE basics on connection intervals.

    Tiago Marçal said:
    2 - It is possible to know/track the problem of a maximum length of 600 bytes for one characteristic?

    The max length of a characteristic is 512 bytes, though to keep things simple I would recommend just using 20-byte characteristics and fragmenting / de-fragmenting larger data packets at the application layer.

    Tiago Marçal said:
    3 - How to decrease data transfer time for all the services? If we read, independently,  the first service in 3s and the second service in 2.5s, why when we try to read both services in the same connection, we take 30s to read all the data?

    You should check what connection interval is being used. You also could try reducing the number of services in your project.