NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code); APP_ERROR_CHECK(err_code); } } while (err_code == NRF_ERROR_BUSY); } if (p_evt->params.rx_data.p_data[p_evt->params.rx_data.length - 1] == '
APP_ERROR_CHECK(ret); return ret; } 实际测量和应用 1. 经笔者实际体验和使用,发现longrange模式下时,常规的BLE主机是无法扫描到该设备的,只有两个设备同时处于longrange模式才能通信,这会限制从设备和APP上应用的场景。 2. 经测试,RSSI受天线和遮挡物的影响很大,基本上没法和距离形成比例关系,不建议通过RSSI...
APP_ERROR_CHECK(err_code); ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG);} 设置完成后,就可以使用支持蓝牙5.0的智能手机使用nrf_connectAPP进行扫描广播包,我们测试用的是华为Mate20,几乎支持蓝牙5.0的所有特性。 此函数主要设置的是蓝牙器件名,连接间隔和从机延时等等相关的参数,...
.base_clock = (nrf_pwm_clk_t)BS_TIM1_PRESCALER, .count_mode = NRF_PWM_MODE_UP, .top_value = m_pwm0_top, .load_mode = NRF_PWM_LOAD_INDIVIDUAL, .step_mode = NRF_PWM_STEP_AUTO }; APP_ERROR_CHECK(nrf_drv_pwm_init(&m_pwm0, &config0,NULL)); m_pwm0_seq_values.channel_0 ...
APP_ERROR_CHECK(err_code); ble_advertising_conn_cfg_tag_set(&m_advertising, APP_BLE_CONN_CFG_TAG); } 设置完成后,就可以使用支持蓝牙5.0的智能手机使用nrf_connectAPP进行扫描广播包,我们测试用的是华为Mate20,几乎支持蓝牙5.0的所有特性。 此函数主要设置的是蓝牙器件名,连接间隔和从机延时等等相关的参数...
APP_ERROR_CHECK(err_code); 该问题是由于系统没有分配足够的空间给服务引起的。需要修改私有服务的数量以及GATT_ATTR_TAB的大小 ->staticvoidble_stack_init(void)-> ret_code_t nrf_sdh_ble_default_cfg_set(uint8_t conn_cfg_tag, uint32_t *p_ram_start)->//Configure number of custom UUIDS. 设...
APP_ERROR_CHECK(nrf_drv_spi_init(&spi1, &spi1_config, spi1_event_handler, NULL)); } As far as I can tell, when the command has been sent from the UART, `spi1_event_handler` is never called. First workaround The first workaround I have tried is to ignore the flag, by modifyin...
+ APP_ERROR_CHECK( sd_softdevice_enable(&clock_cfg, app_error_fault_handler, ANT_LICENSE_KEY) ); sd_nvic_EnableIRQ(SD_EVT_IRQn); /*———- Configure BLE params ———-*/ view raw main.diff hosted with by GitHub 4. Patch the Makefile to use the s340 soft device files This fil...
APP_ERROR_CHECK(nrf_drv_pwm_init(&m_pwm2, &config2, NULL)); m_pwm2_seq_values.channel_0 = 0x8000; m_pwm2_seq_values.channel_1 = 0x8000; m_pwm2_seq_values.channel_2 = 0x8000; m_pwm2_seq_values.channel_3 = 0x8000;
APP_ERROR_CHECK(NRF_LOG_INIT(NULL)); NRF_LOG_DEFAULT_BACKENDS_INIT(); while(1) { if(NRF_LOG_PROCESS() ==false) { nrf_pwr_mgmt_run(); } NRF_LOG_INFO("wakeup"); NRF_LOG_FLUSH(); } } does not idle in nrf_pwr_mgmt_run(). Could be there anything wrong in my sdk config?