Last active
December 28, 2024 00:38
-
-
Save mlalkaka/bc066e55d59e445a310fa37b9a6a661c to your computer and use it in GitHub Desktop.
Power on and off a UE Roll via Bluetooth using GATT and SPP
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
#!env sh | |
mac=C0:28:8D:00:2A:A8 | |
function ue_on() { | |
handle=0x0003 | |
value=b469218dd9e701 | |
gatttool -b $mac --char-write-req --handle=$handle --value $value | |
} | |
function ue_off() { | |
off_req='\x02\x01\xb6' | |
sudo rfcomm bind 0 $mac 1 | |
echo -en $off_req | sudo dd of=/dev/rfcomm0 | |
sudo rfcomm release 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment