/* Function for the Advertising functionality initialization. 
Encodes the required advertising data and passes it to the stack. Also builds a structure to be passed to the stack when starting advertising.  */
static void advertising_init(uint8_t adv_flags)
/* Function for the Advertising functionality initialization. 
Encodes the required advertising data and passes it to the stack. Also builds a structure to be passed to the stack when starting advertising.  */
static void advertising_init(uint8_t adv_flags)
{
    uint32_t      err_code;
    ble_advdata_t advdata;
    ble_uuid_t    service_uuid;
    service_uuid.type = m_dfu.uuid_type;
    service_uuid.uuid = BLE_DFU_SERVICE_UUID;
    memset(&advdata, 0, sizeof(advdata));
    advdata.name_type                     = BLE_ADVDATA_FULL_NAME;
    advdata.include_appearance            = false;
    advdata.flags                         = adv_flags;
    advdata.uuids_more_available.uuid_cnt = 1;
    advdata.uuids_more_available.p_uuids  = &service_uuid;
    err_code = ble_advdata_set(&advdata, NULL);
    APP_ERROR_CHECK(err_code);
}