W: conn failed to establish. RF noise?

deleted

Parents Reply
  • Isn't this the same issue as mentioned here ?

    Yes, the infinite loop seems wrong like you already suspected and it is better to have a timeout and move on. I suggest the below for the cleanup code

    if (k_sem_take(&sem_connected, K_SECONDS(4)) != 0) {
        printk("W: Connection to device %d timed out. Skipping...\n", i);
        if (connections[i]) {
            bt_conn_disconnect(connections[i], BT_HCI_ERR_REMOTE_USER_TERM_CONN);
            bt_conn_unref(connections[i]);
            connections[i] = NULL;
        }
        continue; // Move on to the next device
    }
    

Children
Related