Created
December 14, 2014 10:18
-
-
Save ampledata/48d7cfe984a8dba37dfd to your computer and use it in GitHub Desktop.
example nano script
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
import pygatt | |
str_buf = '' | |
def print_str_buf(x,y): | |
global str_buf | |
str_y = "%s" % y | |
if str_y == '$': | |
print str_buf | |
sb = str_y | |
else: | |
str_buf = str_buf + str_y | |
pygatt.util.reset_bluetooth_controller() | |
bgn = pygatt.pygatt.BluetoothLEDevice('00:07:80:71:D5:89') | |
bgn.connect() | |
bgn.char_write(32, bytearray([0x03, 0x00])) | |
bgn.subscribe('a1e8f5b1-696b-4e4c-87c6-69dfe0b0093b', print_str_buf) | |
bgn.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment