|
1.DFU功能
#ifdef BLE_DFU_APP_SUPPORT
/** @snippet [DFU BLE Service initialization] */
ble_dfu_init_t dfus_init;
// Initialize the Device Firmware Update Service.
memset(&dfus_init, 0, sizeof(dfus_init));
dfus_init.evt_handler = dfu_app_on_dfu_evt;
dfus_init.error_handler = NULL;
dfus_init.evt_handler = dfu_app_on_dfu_evt;
dfus_init.revision = DFU_REVISION;
err_code = ble_dfu_init(&m_dfus, &dfus_init);
APP_ERROR_CHECK(err_code);
dfu_app_reset_prepare_set(reset_prepare);
dfu_app_dm_appl_instance_set(m_app_handle);
/** @snippet [DFU BLE Service initialization] */
#endif
2.蓝牙数据传输服务
ble_nus_init_t nus_init;
memset(&nus_init, 0, sizeof(nus_init));
nus_init.data_handler = nus_data_handler;
err_code = ble_nus_init(&m_nus, &nus_init);
APP_ERROR_CHECK(err_code);
两个功能屏蔽任意一个都能正常工作,同时开启这两个服务会造成其中一个服务初始化失败(ble_dfu_init或者ble_nus_init初始化失败,连死循环都进不去)!调试提示内存不够!但这都是两个服务都是官方给的例子,我没有改动,也没发现有什么地方可改。有没有解决 办法?
|
|