NRF52 central connect to peripheral by MAC address

Hi,

is it possible for a central device to connect to a peripheral device directly (without using nrf_ble_scan_init( ), nrf_ble_scan_filter_set( ), nrf_ble_scan_filters_enable( ), whitelist, etc) if the MAC address of the peripheral is known in advance?

I see a lot of topics in the forums about this but none of them is answered ...

Regards,

L. B.

Parents
  • I have done this by putting the MAC address into the manuf_data struct and let my mobile device search for this specific parameter. 

      ble_gap_addr_t ble_addr;
      sd_ble_gap_addr_get(&ble_addr);
      
        ble_advdata_manuf_data_t                  manuf_data; //Variable to hold manufacturer specific data
      uint8_t data[]                            = {NRF_FICR->DEVICEADDR[0]>>8, NRF_FICR->DEVICEADDR[0]}; //data to advertise (put as much of the MAC address as you want)
      manuf_data.company_identifier             = 0x0000; //Nordics company ID
      manuf_data.data.p_data                    = data;
      manuf_data.data.size                      = sizeof(uint16_t);
      init.srdata.p_manuf_specific_data = &manuf_data;
     

    I can in turn find this data e.g. in the LightBlue App by connecting to the device and opening the ade data tab.

  • Yes, I could also do that, but my question is more like - "is there an API function that does that". Currently I have to scan before I can connect, but I want to try ONLY to connect, IF possible ...

Reply Children
Related