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

Setting advertisement parameter's for custom profile

Hi, How to set the advertisement parameter's (uuid's list) , while using both custom and SIG adopted services?

I modified the source code as below, but it is not showing the advertising data parameters and scan response data parameters while advertising.

ble_uuid_t adv_uuids[] =
    {
        {BLE_UUID_ACCEL_SERVICE ,         		m_accel.uuid_type},    
        {BLE_UUID_BATTERY_SERVICE,                      BLE_UUID_TYPE_BLE},
        {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
    };
	
    // Build and set advertising data
    memset(&advdata, 0, sizeof(advdata));

    advdata.name_type                        = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance            = true;
    advdata.flags.size                          = sizeof(flags);
    advdata.flags.p_data                       = &flags;

   memset(&scanrsp, 0, sizeof(scanrsp));
    scanrsp.uuids_complete.uuid_cnt = sizeof(adv_uuids) / sizeof(adv_uuids[0]);
    scanrsp.uuids_complete.p_uuids  = adv_uuids;
    
    err_code = ble_advdata_set(&advdata, &scanrsp);

     // Initialize advertising parameters (used when starting advertising)
    memset(&m_adv_params, 0, sizeof(m_adv_params));
    
    m_adv_params.type                = BLE_GAP_ADV_TYPE_ADV_IND;
    m_adv_params.p_peer_addr     = NULL;                           // Undirected advertisement
    m_adv_params.fp                  = BLE_GAP_ADV_FP_ANY;
    m_adv_params.interval            = APP_ADV_INTERVAL;
    m_adv_params.timeout             = NULL;

Regards, Balaji

ADV_MCP.png

Related