This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 DK: lte_ble_gateway example project: Does this project allow more than one BLE connection simultaneously?

Hi,

As the title asks, I am using the lte_ble_gateway example project on the nRF9160 DK. I am able to connect one nRF52840 DK to the nRF9160 DK over BLE. I am trying to connect a second nRF52840 DK to the nRF9160 DK, but am having issues. Is this possible? If not, could I be pointed to a sample project that would allow simultaneous BLE connections?

Any help would be appreciated.

Thank you!

Parents
  • One way of doing it is to add bt_scan_start() to the connected callback, at least that worked for me.

    static void connected(struct bt_conn *conn, u8_t conn_err)
    {
    	int err;
    	char addr[BT_ADDR_LE_STR_LEN];
    
    	bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
    
    	if (conn_err) {
    		printk("Failed to connect to %s (%u)\n", addr, conn_err);
    		return;
    	}
    
    	printk("Connected: %s\n", addr);
    
    	err = bt_gatt_dm_start(conn, BT_UUID_TMS, &discovery_cb, NULL);
    	if (err) {
    		printk("Could not start service discovery, err %d\n", err);
    	}
    	bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
    }

Reply
  • One way of doing it is to add bt_scan_start() to the connected callback, at least that worked for me.

    static void connected(struct bt_conn *conn, u8_t conn_err)
    {
    	int err;
    	char addr[BT_ADDR_LE_STR_LEN];
    
    	bt_addr_le_to_str(bt_conn_get_dst(conn), addr, sizeof(addr));
    
    	if (conn_err) {
    		printk("Failed to connect to %s (%u)\n", addr, conn_err);
    		return;
    	}
    
    	printk("Connected: %s\n", addr);
    
    	err = bt_gatt_dm_start(conn, BT_UUID_TMS, &discovery_cb, NULL);
    	if (err) {
    		printk("Could not start service discovery, err %d\n", err);
    	}
    	bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
    }

Children
Related