Cannot connect to nRF when in direct advertisement mode

Hello, I'm trying to manage connecting to my board (nRF52840-DK) which direct advertise (low prio) with peer address set to MAC address of my PC running Linux with bluez 5.62-1. Unfortunately I cannot connect to the board, no matter what. I develop the board with Zephyr RTOS. This is the code responsible for setting up advertisement:

static void bt_ready(void)
{
  int err;
  bt_addr_le_t dir_addr;

  const char *address = "D8:8F:76:5B:57:7E";
  const char *type = "public";
  if ((err = bt_addr_le_from_str(address, type, &dir_addr))) {
    printk("Bt_addr_le_from_str error: %d\n", err);
  }

  err = bt_le_adv_start(BT_LE_ADV_CONN_DIR_LOW_DUTY(&dir_addr), ad, ARRAY_SIZE(ad), NULL, 0);
  if (err) {
    printk("Advertising failed to start (err %d)\n", err);
    return;
  }

  printk("Advertising successfully started\n");
}

If i set the advertisement mode to BT_LE_ADV_CONN_NAME, then there is no problem - the device is scannable and connectable.

My question is - can someone post any code or describe any method that will allow me to connect my PC to the board?

Parents Reply Children
Related