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

How to specify manufacturer specific data in advertisements with nRF Connect for Desktop?

I use nRF Connect BLE for Desktop (v.3.6.1) to emulate an app I currently develop.

Using the adveritisement dialog I specify "Complete local name", "UUID 16 bit complete list" to specify 3 UUIDs, "UUID 127 bit complete list" to specify one custom UUID for the scan response, but I cannot seem to figure out how to specify manufacturer specific data, i.e. for example the manufacturer ID? 

This is the corresponding advertising_init code of my app I want to mimic with nRF Connect for Desktop. 

static void advertising_init(void)
{
    ret_code_t             err_code;
    ble_advertising_init_t init;
    ble_advdata_service_data_t service_data;

    ble_advdata_manuf_data_t manuf_data;
    memset(&init, 0, sizeof(init));

    init.advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    init.advdata.include_appearance      = true;
    init.advdata.flags                   = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
    init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
    init.advdata.uuids_complete.p_uuids  = m_adv_uuids;
    
    uint8_t mdata[] = "";
    manuf_data.company_identifier = 0x????;
    manuf_data.data.p_data                    = mdata;
    manuf_data.data.size                      = sizeof(mdata);
    init.advdata.p_manuf_specific_data   = &manuf_data;
    
    init.srdata.name_type               = BLE_ADVDATA_NO_NAME;
    init.srdata.uuids_complete.uuid_cnt = sizeof(m_adv_sr_uuids) / sizeof(m_adv_sr_uuids[0]);
    init.srdata.uuids_complete.p_uuids  = m_adv_sr_uuids;

    // Service data AD type

    uint8_t data[3] = { 0x01, 0x32, 0x00 }; 
    service_data.service_uuid = BLE_UUID_FITNESS_MACHINE;  
    service_data.data.p_data = data;
    service_data.data.size = sizeof(data);

    init.srdata.service_data_count = 1;
    init.srdata.p_service_data_array = &service_data;
    init.config.ble_adv_fast_enabled  = true;
    init.config.ble_adv_fast_interval = APP_ADV_INTERVAL;
    init.config.ble_adv_fast_timeout  = APP_ADV_DURATION;

    init.evt_handler = on_adv_evt;

    err_code = ble_advertising_init(&m_advertising, &init);
    APP_ERROR_CHECK(err_code);

    ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);
}

Can you please advise how to configure nRF Connect for Desktop to be as close as possible to this? Thank you!

Parents
  • Hi, 

    If you do this: 

    The device will advertise manufacturer specific data (type 0xFF) with company ID of Nordic (0x0059) and the actual data is 0x1234. 
    If you want to learn more about the raw advertising packet, you can have a look at my blog here.

  • Dear Hung, thanks for that example. In your screenshot you've explicitly left out the advertised UUIDs in the advertising data and scan response data. The example in the referenced blog entry has those.

    Can I just add my service UUIDs using the existing form elements or will I need to add them to the "FF" AD type value as well all at once?

  • Hi, 
    It's up to you to decide if you want to include the UUIDs in the advertising packet or in scan response packet or not. 
    It's not obligated, the UUIDs usually put inside advertising/scan response packet so that the central/scanner would know if the device supports such services.
     You don't have to add the service UUID. If you want you can just add it by click the +Add to ... button. 
    Note that the max payload of advertising/scan response packet is 31 bytes, including all the headers, length etc. 

Reply
  • Hi, 
    It's up to you to decide if you want to include the UUIDs in the advertising packet or in scan response packet or not. 
    It's not obligated, the UUIDs usually put inside advertising/scan response packet so that the central/scanner would know if the device supports such services.
     You don't have to add the service UUID. If you want you can just add it by click the +Add to ... button. 
    Note that the max payload of advertising/scan response packet is 31 bytes, including all the headers, length etc. 

Children
Related