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/41 Maximum length for device name attribute

Other Parts Discussed in Thread: CC2540, CC2541DK-MINI, CC2541

Hello,

I am doing an initial study about the features of CC2540/41Mini Development Kit and I was wondering about the device name attribute maximum length.

Based on some earlier discussions, I understood that there is maximum length of 20 bytes for the device name attribute. I checked some of the sample applications (KeyFobDemo, SimpleBLEPeripheral, and so on) and saw that the device name (and the 20 byte limitation) is probably defined in the sample code as follows:

static uint8 attDeviceName[GAP_DEVICE_NAME_LEN] = "TI BLE Keyfob";
#define GAP_DEVICE_NAME_LEN (20+1)

My questions:
1. Is it possible to use longer device names than 20 bytes/characters?
2. What is the maximum length for the device name?
3. Is this also the "visible name" for the device that is broadcasted and can be seen in mobile phones or other BT devices?
4. What has to be changed in the code in order to define longer device name? Is it enough if I change the previously mentioned definitions?

I noticed that there is related, but unanswered question here: e2e.ti.com/.../242464

Best regards,
Jaakko

  • Hello Jaakko,

    The BLE spec says that the device name field may be between 0 and 248 octets. I have upped the device name define and changed the name string to be over 200 bytes. Seems to work
  • Sean,

    Thank you very much for your prompt response!

    BR,
    Jaakko

  • Hi,

    Now I was able to actually test this with CC2541DK-MINI and by using the sample projects KeyFob and SimpleBLEPeripheral. Unfortunately, I am still having some troubles while changing the name. I am trying to change the device name that is visible to other Bluetooth devices that are scanning BT devices in the area.

    I have tried changing the previously mentioned definitions in both projects incrementally up to the maximum 248 octets:
    #define GAP_DEVICE_NAME_LEN (20+1)
    static uint8 attDeviceName[GAP_DEVICE_NAME_LEN] = "TI BLE Keyfob";

    Unfortunately this does not seem to change the name that I want. I also verified this multiple times with multiple different devices as I noticed that there has been a case in which an external BT device did not refresh the updated name for some reason:
    https://e2e.ti.com/support/wireless_connectivity/f/538/t/360540

    Perhaps I am doing something wrong with the attDeviceName definition, but according to the linked discussion, it seems that the device name I want to change is defined in the following array (simpleBLEPeripheral.c):

    // GAP - SCAN RSP data (max size = 31 bytes)
    static uint8 scanRspData[] = ...

    I verified that this changes the visible name. However, according to the comment (and my own tests) it seems that the array length is limited to 31 bytes which limits also the device name length.

    Now, my question is: Is it possible to increase the array size limit, and how?

    Ultimately my goal is just to find out what is the easiest way to define longer (as long as possible) name for the device that can be discovered by other BT devices, such as mobile phones. So the solution does not necessarily have to be this array definition approach.

    Best regards,
    Jaakko



  • Jaakko,

    You are correct that the array size is limited to be 31 bytes(octets). This is a limit imposedon the scan response data by the BLE spec, and thus cannot be raised for any device that is spec compliant.

    Your central (phone) could read this field and then prompt the device for the full name (up to 248 bytes) by reading the device name characteristic.

    What is your end application of such a long name? Knowing this can assist me in finding a solution for you.
  • Thank you again for your quick response.

    The application is a system in which Bluetooth beacon is used to advertise information (such as name and contact information) to mobile devices. This data string is easily very long.

    Mobile devices are typically mobile phones or tablets having Bluetooth 4.0. It has been verified that the concept is working with this kind of mobile devices - it is possible to write the information to the 248 character long Bluetooth “Friendly name” field and once BT is “turned on” other devices are able to read the Friendly name.

    The goal is to implement the same functionality with a Bluetooth beacon. It should be possible to ”program” Bluetooth beacon's ”Friendly name” with some mechanism, preferably over the air, and make the beacon advertise the name to other devices. No pairing, no voice, no other data (sensor values etc.) are needed. Just advertising of the "Friendly name".

    Or maybe you could propose other suitable chipset – e.g. is there any benefit in cc256x family over the cc2541?

    BR,
    Jaakko

  • Jaakko,

    Thank you, that gives me a clearer picture of your issue. It sounds like you are trying to implement a BLE connectable beacon. This is possible using the CC2541. Take a look at this app note which explains beacon implementation on the CC254x. www.ti.com/.../swra475.pdf

    The limitation here is in the BLE spec. The BLE spec defines that the maximum size of an advertising packet is 31 bytes. There is a lot of information you can fit into this advertisement data packet, for example, the Google eddystone spec works within this packet to transmit telemetry, URLs, and ID information
    (https://github.com/google/eddystone/blob/master/protocol-specification.md)

    In summary, the length of the device name attribute can be up to 248 bytes, but only a shorter device name can be included in advertisements. This is not a limitation of the chip, but rather a rule imposed by the spec.

  • OK, thank you very much again.

    So the limitation comes directly from the BLE specification. However, you said that this is not limitation of the chip. So I guess my final question is that do you know if there is some "non-BLE-compliant" way to achieve the long advertisement using CC254x (or CC256x)? As it seems that Bluetooth itself supports longer names, since they work with the mobile devices described earlier.

    BR,

    Jaakko

  • Since our stack implements the BLE spec, there is no support for non BLE compliant behavior. The longest possible advertisement length is 31 bytes. Attribute discovery can reveal the full device name, but it is not included in the advertisement data.

    Technically this is not a limitation of the chip, with a custom radio stack the chip could achieve this, but there is no support for non spec compliant development.
  • In addition, since all mobile phones implement the BLE spec as well they wouldn't be able to understand an advertising packet longer than 31 bytes.
  • Ok, thank you Sean very much for your help. I tried to post this earlier, but I had some problems logging in.