Skip to content

Commit

Permalink
4.5.6 Add the service UUID to the advertisement packet.
Browse files Browse the repository at this point in the history
  • Loading branch information
liquitious committed Dec 20, 2015
1 parent aae8eef commit 6764584
Show file tree
Hide file tree
Showing 4 changed files with 653 additions and 635 deletions.
10 changes: 9 additions & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,10 @@ static void advertising_init(void)
{
uint32_t err_code;
ble_advdata_t advdata;
ble_advdata_t scanrsp;

// YOUR_JOB: Use UUIDs for service(s) used in your application.
ble_uuid_t adv_uuids[] = {{LBS_UUID_SERVICE, m_lbs.uuid_type}};

// Build advertising data struct to pass into @ref ble_advertising_init.
memset(&advdata, 0, sizeof(advdata));
Expand All @@ -499,13 +503,17 @@ static void advertising_init(void)
advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;
advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
advdata.uuids_complete.p_uuids = m_adv_uuids;

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

ble_adv_modes_config_t options = {0};
options.ble_adv_fast_enabled = BLE_ADV_FAST_ENABLED;
options.ble_adv_fast_interval = APP_ADV_INTERVAL;
options.ble_adv_fast_timeout = APP_ADV_TIMEOUT_IN_SECONDS;

err_code = ble_advertising_init(&advdata, NULL, &options, on_adv_evt, NULL);
err_code = ble_advertising_init(&advdata, &scanrsp, &options, on_adv_evt, NULL);
APP_ERROR_CHECK(err_code);
}

Expand Down
7 changes: 7 additions & 0 deletions pca10036/s132/arm5_no_packs/_build/arm_startup_nrf52._ia
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
--cpu Cortex-M4.fp --pd "__EVAL SETA 1" -g --apcs=interwork --pd "__MICROLIB SETA 1"
-I "C:\Users\Michael Dietz\Documents\nRF52_SDK_0.9.2_dbc28c9\examples\ble_peripheral\experimental_ble_app_blinky\pca10036\s132\arm5_no_packs\RTE"
-I C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.2.0\CMSIS\Include
-I C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.0.3\Device\Include
-I C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_DeviceFamilyPack\8.3.2\Device\Include
--pd "__UVISION_VERSION SETA 517" --pd "_RTE_ SETA 1" --pd "NRF52 SETA 1" --pd "BLE_STACK_SUPPORT_REQD SETA 1" --pd "BOARD_PCA10040 SETA 1" --pd "CONFIG_GPIO_AS_PINRESET SETA 1" --pd "S132 SETA 1" --pd "NRF52 SETA 1" --pd "SOFTDEVICE_PRESENT SETA 1" --pd "SWI_DISABLE0 SETA 1"
--list .\_build\arm_startup_nrf52.lst --xref -o .\_build\arm_startup_nrf52.o --depend .\_build\arm_startup_nrf52.d "RTE\Device\nRF52832_xxAA\arm_startup_nrf52.s"
Loading

0 comments on commit 6764584

Please sign in to comment.