Last active
August 29, 2015 14:03
-
-
Save Akkiesoft/0d121996a866d4cc1419 to your computer and use it in GitHub Desktop.
Bluetoothキーボードをペアリングするやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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