Last active
April 11, 2019 14:23
-
-
Save noahp/85566fc8e04624785f8321022b05ecf1 to your computer and use it in GitHub Desktop.
Crummy script for ble read on linux
This file contains hidden or 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 | |
BTMGMT=btmgmt | |
BTADDR=$1 | |
# hard reset the local HCI device, this helps ensure it's in a usable state | |
sudo $BTMGMT -i hci0 power off | |
sudo $BTMGMT -i hci0 le on | |
sudo $BTMGMT -i hci0 name "bt_adapter" | |
sudo $BTMGMT -i hci0 bredr off | |
sudo $BTMGMT -i hci0 sc off | |
sudo $BTMGMT -i hci0 bondable on | |
sudo $BTMGMT -i hci0 power on | |
# forever read characteristic handle 0x41 as fast as we can | |
while true; | |
do sudo gatttool -t random -b $BTADDR --char-read -a 0x41 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment