Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft
Last active August 29, 2015 14:03
Show Gist options
  • Save Akkiesoft/0d121996a866d4cc1419 to your computer and use it in GitHub Desktop.
Save Akkiesoft/0d121996a866d4cc1419 to your computer and use it in GitHub Desktop.
Bluetoothキーボードをペアリングするやつ
#!/bin/bash
# How to get the Bluetooth device address: hcitool scan
BTKEYBOARD=
if $1 = pairing ; then
echo "1. Input PIN code at computer"
echo "2. Input PIN code at BT Keyboard"
echo "3. Done ;-)"
sudo bluez-simple-agent hci0 ${BTKEYBOARD}
sudo bluez-test-input connect ${BTKEYBOARD}
sudo bluez-test-device trusted ${BTKEYBOARD} yes
elif $1 = unpairing ; then
sudo bluez-test-device trusted ${BTKEYBOARD} no
sudo bluez-test-input disconnect ${BTKEYBOARD}
else
echo "btkey.sh [ pairing | unpairing ]"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment