Skip to content

Instantly share code, notes, and snippets.

@mlalkaka
Last active October 30, 2022 11:31
Show Gist options
  • Star 18 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlalkaka/bc066e55d59e445a310fa37b9a6a661c to your computer and use it in GitHub Desktop.
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
#!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