Bash  

Example

: Scanning bluetooth devices


Code
  1. #!/bin/bash
  2. hci=`hciconfig | grep hci | cut -f1 -d:`
  3. hci_info=`hciconfig -a $hci name`
  4. echo "Name: $hci_info"
  5. hcitool scan


Returns
        Name: hci0:     Type: USB
        BD Address: 00:80:5A:20:EB:9C ACL MTU: 192:8 SCO MTU: 64:8
        Name: 'hormiga-0'
Scanning ...
        00:17:E5:D8:2B:B0       Tarantula
        00:1F:5D:BF:F0:01       Cucaracha
        00:1E:3B:A5:7B:16       Libeliula
        00:25:C7:33:97:85       Mosquito
        00:24:90:43:0B:71       Mantis
        


Invocation:

sh BluetoothExample.sh -> As root user
sudo sh BluetoothExample.sh -> As other user


Require

Require root privileges


© Libelium Comunicaciones Distribuidas S.L.

| Terms of use