This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device name truncated (well is there a way to overcome)

nRF52832 / SDK V15.0.0 / nRF connect / DFU OTA Buttonless

Hello,

My device name is 21 chars but it is truncated and appears as 20 chars in nRF Connect "Discovery devices" list.

I know it's normal:I've added the battery service along the original NUS service:

static ble_uuid_t m_adv_uuids[] = {
            {BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE},
            {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE}
};

The truncation is done in "ret_code_t name_encode()" and the 31 chars allocated to the device name are actually used also for other elements. So de facto it shortens length for the device name.

But when I connect to the device, I see in "nRF Connect" the device name is displayed correctly  (in the small window appearing at the middle), so it means the full device name is conveyed through the BLE connection.

Then, is there a way to overcome this issue by telling the sniffer to display the full name in the "Discovery devices" list instead of taking it from these 31 chars?

(I can't check how this device is displayed in Android or IoS)

Thanks.

John.

Parents
  • Hi,

    The device name in the advertising packet is shortened if there is no room for the full device name. A sniffer/scanner cannot display this data before it connects to the device as it has not been transmitted over air, so there is no way it can know. However, the peer can read the device name characteristic after a connection is made, which is why you see the full name after connecting. 

    There are a few things you can do to get the full device name without connecting:

    • Use less other data in the advertisement packet (for instance you can remove the battery service UUID from the advertising packet).
    • Use a scan response and put some of the advertising data there (either the device name or something else)
  • ok thanks, I've deleted the UUID Batt service (whithout loosing the functionnality of course):

    Before:

    static ble_uuid_t m_adv_uuids[] = {
                {BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE},
                {BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE}
    };

    Then:

    static ble_uuid_t m_adv_uuids[] = {
                {BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE}
    };

    And  my device is ok again.

    John.

Reply Children
No Data
Related