19 lines
389 B
Python
19 lines
389 B
Python
|
|
||
|
#import pygatt
|
||
|
import os
|
||
|
|
||
|
#adapter = pygatt.GATTToolBackend()
|
||
|
on = 'cc2333'
|
||
|
off = 'cc2433'
|
||
|
|
||
|
try:
|
||
|
# adapter.start()
|
||
|
# device = adapter.connect("b2:3b:03:00:14:d6")
|
||
|
# device.char_write_handle(0x0009, bytearray.fromhex(off))
|
||
|
os.system('gatttool -i hci0 -b b2:3b:03:00:14:d6 --char-write-req -a 0x0009 -n cc2333')
|
||
|
except error as ex:
|
||
|
print(ex)
|
||
|
#finally:
|
||
|
# adapter.stop()
|
||
|
|