|
- static void ble_stack_init(void)
- {
- uint32_t err_code;
- nrf_clock_lf_cfg_t clock_lf_cfg = NRF_CLOCK_LFCLKSRC;
- // Initialize SoftDevice.
- SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
- ble_enable_params_t ble_enable_params;
- err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
- PERIPHERAL_LINK_COUNT,
- &ble_enable_params);
- APP_ERROR_CHECK(err_code);
- //Check the ram settings against the used number of links
- CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
- // Enable BLE stack.
- #if (NRF_SD_BLE_API_VERSION == 3)
- ble_enable_params.gatt_enable_params.att_mtu = NRF_BLE_MAX_MTU_SIZE;
- #endif
- err_code = softdevice_enable(&ble_enable_params);
- APP_ERROR_CHECK(err_code);
- // Subscribe for BLE events.
- err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
- APP_ERROR_CHECK(err_code);
- }
复制代码 SDK自带的EXAMPLE CODE: ble_app_uart_pca10028_s130, 请高手帮忙解! 感谢!感谢!
|
|