using the default configuration.25#ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT26#defineNRF_SDH_BLE_TOTAL_LINK_COUNT 127#endif2829//<o> NRF_SDH_BLE_GAP_EVENT_LENGTH - The time set aside for this connection on every connection interval in 1.25 ms units.30#ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH31#de...
1intmain(void)2{3boolerase_bonds;45//Initialize.6log_init();7timers_init();8buttons_leds_init(&erase_bonds);9ble_stack_init();10gap_params_init();11gatt_init();12advertising_init();13services_init();14conn_params_init();15peer_manager_init();1617//Start execution.18NRF_LOG_INFO(...
memset(&write_req, 0, sizeof(nrf_ble_gq_req_t));if (length > NRF_SDH_BLE_GATT_MAX_MTU_...
ret_code_t nrf_ble_gatt_init(nrf_ble_gatt_t * p_gatt, nrf_ble_gatt_evt_handler_t evt_handler) */staticvoidgatt_init(void){//nrf_ble_gatt_init定义了gatt主机,从机的最大MTU长度,以及协商数据的长度ret_code_terr_code=nrf_ble_gatt_init(&m_gatt,NULL);APP_ERROR_CHECK(err_code);} adv...
同时配置了一个按键控制函数 bsp_btn_ble_init,可以用按键休眠和启动蓝牙设备广播。 uint32_tbsp_btn_ble_init(bsp_btn_ble_error_handler_terror_handler,bsp_event_t* p_startup_bsp_evt) { uint32_terr_code = NRF_SUCCESS; m_error_handler = error_handler; ...
本文将通过介绍 bsp 和 ble_app_uart 这两个例程来分析nRF5 SDK的例程架构,这两个例程可以在nRF5_SDK_17.1.0_ddde560\examples\peripheral和nRF5_SDK_17.1.0\examples\ble_peripheral下找到。 一、bsp 例程浅析 bsp是不带协议栈的裸机例程,所以main函数非常简单,下面具体分析一下这几个函数的作用。
// <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. 37 changes: 20 additions & 17 deletions 37 examples/ble_peripheral/ble_app_uart/pca10040/s132/ses/ble_app_uart_pca10040_s132.emProject Original file line numberDiff line numberDiff line change @@ -15,27 +15,27 @...
{{ message }} xuzhijin / nrf52-ble-image-transfer-demo Public forked from NordicPlayground/nrf52-ble-image-transfer-demo Notifications You must be signed in to change notification settings Fork 0 Star 0 Code Pull requests Actions Projects ...
nrf52832/nrf52840作为BLE从设备时,最大发送数据包的长度可能需要调整,以下为配置方法。 1.config文件配置修改 修改宏NRF_SDH_BLE_GATT_MAX_MTU_SIZE的大小// <o> NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size.#ifndefNRF_SDH_BLE_GATT_MAX_MTU_SIZE#defineNRF_SDH_BLE_GATT_MAX_MTU_SIZE ...
MTU的设置,可修改sdk_config.h文件中的NRF_SDH_BLE_GATT_MAX_MTU_SIZE宏的值来实现。Demo中MTU缺省值为247。应用中的推荐设置:MTU为158,连接间隔为50ms。 2.6 增加服务 服务UUID设置?character UUID设置?characteristic 属性设置?属性实现? 附A:参考资料...