Hello community
I'm trying to do a central app, for this im using the example of UART_Central with the SDK 13 and SD S132.
During the events cycle I am having only the ADV_Reports and not the EVT_Connected,
case BLE_GAP_EVT_ADV_REPORT:
{
NRF_LOG_INFO("AD_Report\r\n");
const ble_gap_evt_adv_report_t * p_adv_report = &p_gap_evt->params.adv_report;
if (is_uuid_present(&quatServ, p_adv_report))
{
err_code = sd_ble_gap_connect(&p_adv_report->peer_addr, &m_scan_params, &m_connection_param, CONN_CFG_TAG);
NRF_LOG_INFO("ERROR: %s \r\n",err_code);
if (err_code == NRF_SUCCESS)
{
//scan is automatically stopped by the connect
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
NRF_LOG_INFO("Connecting to target %02x%02x%02x%02x%02x%02x \r\n",
p_adv_report->peer_addr.addr[5],
p_adv_report->peer_addr.addr[4],
p_adv_report->peer_addr.addr[3],
p_adv_report->peer_addr.addr[2],
p_adv_report->peer_addr.addr[1],
p_adv_report->peer_addr.addr[0])
}
}
}break;
The err_code is iqual to NRF_SUCCESS and is pritting me the peer_address corectly but after that the main loop start
int main(void)
{
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_FLUSH();
NRF_LOG_INFO("Luces.\r\n");
bsp_board_leds_init();
for (int j = 0; j <10; j++)
{
for (int i = 0; i < LEDS_NUMBER; i++)
{
bsp_board_led_invert(i);
nrf_delay_ms(50);
}
}
timer_init();
log_init();
buttons_leds_init();
ble_stack_init();
//Start scanning for peripherals
printf("BLE Central Started.\r\n");
NRF_LOG_INFO("BLE_MASTER STARTED.\r\n");
scan_start();
for(;;)
{
power_manage();
} }// end main
And it 's not creating a connect event or somethig else.
Regards David