Hi,
Sorry for the late reply.
Here is my current code:
import cb
import sound
import struct
class MyCentralManagerDelegate (object) :
def __init__(self):
self.peripheral = None
def did_discover_peripheral(self, P):
print ( '+++ Discovered peripheral: %s (%s)' % (P.name, P.uuid))
if P.name and 'Apple Watch' in P.name and not self.peripheral:
self.peripheral = P
cb.connect_peripheral(self.peripheral)
def did_connect_peripheral(self,P):
print('***Connected: %s' % P.name)
print('Discovering services...')
P.discover_services()
def did_fail_to_connect_peripheral(self, P, error):
print('Failed to connect')
def did_discover_services(self, P, error):
for S in P.services:
print(S.uuid)