I have succesfully got extended advertising working using the nRF SDK on the nRF52 DK, however I haven't been able to assign it a 128 bit service guid.
Setup:
The device advertises 94 characters, as follows, which has an example of an intended service uuid in the advertisement:
I've gone for this minimalistic example of 94 characters because, being between 31 and 255 characters, it falls into the extended advertising realm.
My advertising_init is as follows:
static void advertising_init(void)
{ ret_code_t err_code; ble_advertising_init_t init; memset(&init, 0, sizeof(init));
init.advdata.name_type = BLE_ADVDATA_FULL_NAME;
init.advdata.include_appearance = false; 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.config.ble_adv_primary_phy = BLE_GAP_PHY_1MBPS; init.config.ble_adv_secondary_phy = BLE_GAP_PHY_2MBPS; init.config.ble_adv_extended_enabled = true; init.advdata.p_service_data_array = createTestSingleServiceArray(); init.advdata.service_data_count = 0x01; 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);
}uint8_t *createTestService(void){ static const uint8_t buffer[] = { "{'uuid':'d3fa3aa0-ba50-4224-a68f-f73fbd5055b8','name':'Hello Extended Advertising in JSON'}" }; uint8_t *rv = malloc(sizeof(buffer)); if (rv != 0) memmove(rv, buffer, sizeof(buffer)); return rv;}static ble_advdata_service_data_t *createTestSingleServiceArray(void){ ble_advdata_service_data_t myservice; uint16_t my_service_uuid; uint8_array_t mydata; my_service_uuid = 0x0112; mydata.size = 91; mydata.p_data = createTestService(); myservice.data = mydata; myservice.service_uuid = my_service_uuid; const ble_advdata_service_data_t buffer[] = { myservice }; ble_advdata_service_data_t *rv = malloc(sizeof(buffer)); if (rv != 0) memmove(rv, buffer, sizeof(buffer)); return rv;}myservice.service_uuid = my_service_uuid;my_service_uuid