Communicate two microcontrollers via BLE

Hello,

I'm using a nRF52 DK to test BLE communication with another microcontroller. What I need to test is the nRF52 pairing with another brand microcontroller, send a data stream and close the connection.

Could you please tell me which example from the Bluetooth samples list I can use for starting?

Thanks for your attention.

Regards,

Parents Reply
  • I have added a call to the 'bt_gatt_dm_conn_get' function in the 'discovery_complete' function as follows:

    static void discovery_complete(struct bt_gatt_dm *dm,
    			       void *context)
    {
    	struct bt_nus_client *nus = context;
    	LOG_INF("Service discovery completed");
    	printk("Service discovery completed\n");
    
    	bt_gatt_dm_data_print(dm);
    
    	/* Assign connection instance. */
    	nus_client.conn = bt_gatt_dm_conn_get(dm);
    
    	bt_nus_handles_assign(dm, nus);
    	bt_nus_subscribe_receive(nus);
    
    	bt_gatt_dm_data_release(dm);
    }

    This way the microcontroller doesn't reset anymore. Nevertheless, the pairing still fails:

    Starting Bluetooth Central UART example
    scan err: 0
    Scanning
    Scanning successfully started
    connected conn_err: 0
    Connected: 60:55:F9:F5:29:D2 (public)
    Pairing failed conn: 60:55:F9:F5:29:D2 (public), reason 9
    Service discovery completed

    How can I solve this problem?

Children
Related