Learn Java

Prepare Environment

  1. Install some package:

     sudo apt-get update
     sudo apt-get upgrade
     sudo apt-get autoremove
     sudo apt-get install bluetooth bluez-utils blueman libbluetooth-dev
    
  2. Insert the dongle, and run command lsusb. My result:

    Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
    Bus 001 Device 004: ID 0a5c:21e8 Broadcom Corp.
    

    Broadcom Corp. is what I plug in.

  3. Run command/etc/init.d/bluetooth status. See below result to check whether your device is running.

    [....] bluetooth is running.
    
  4. Prepare another bluetooth device, and run hcitool scan. For me, I use Samsung GT-S7270, and make it discoverable.

    Scanning ...
    18:26:66:AD:24:A6    CHEN Yu Ting (GT-S7270
    

    18:26:66:AD:24:A6 is the MAC address of this device.

  1. We can ping this device with its MAC address via command l2ping. For me, I run : sudo l2ping -c 2 18:26:66:AD:24:A6. And result:

    Ping: 18:26:66:AD:24:A6 from 00:02:72:CC:BB:C1 (data size 44) ...
    0 bytes from 18:26:66:AD:24:A6 id 0 time 40.35ms
    0 bytes from 18:26:66:AD:24:A6 id 1 time 22.37ms
    2 sent, 2 received, 0% loss
    

Reference:

ModMyPi | Installing the Raspberry Pi Nano Bluetooth Dongle