Scanning BLE sensors

Hi All,

Sorry for such a very basic question, but I've tried many things and combinations and cannot make this work.

I'm trying to discover BLE sensors using nrf_ble_scan_init but my handler is never called, even though I have two sensors near the board, a ST100.

The current code is:

    ret_code_t          err_code;
    nrf_ble_scan_init_t init_scan;

    memset(&init_scan, 0, sizeof(init_scan));

    err_code = nrf_ble_scan_init(&m_scan, &init_scan, handler);
    APP_ERROR_CHECK(err_code);

Any help is really appreciated.

Thanks in advance,

Andre

Parents
  • Sorry, I had to take care of something else.

    At this point, my code is not even the code I shared anymore. It seems to me that there are many different functions that seem to do the same thing: scan and connect to BLE devices.

    It would be really helpful if someone could point me to the correct functions, and even better if they could share some source code. At this point I really just need to scan the devices and list them.

    Thanks.

  • Hi Andre,

    I would suggest to have a look at our central example  and test it with correspondent peripheral. 

    You can test with the \examples\ble_central_and_peripheral\experimental\ble_app_hrs_rscs_relay. 

    In that example we don't do .connect_if_match = true; instead we wait for the callback scan_evt_handler() to return  and then connect from that handler. 

Reply Children
No Data
Related