Skip to content

Instantly share code, notes, and snippets.

@Akkiesoft Akkiesoft/btkey.sh
Last active Aug 29, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.