omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Apple watch peripheral characteristics scan using pythonista

    Pythonista
    3
    4
    1850
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Hameed
      Hameed last edited by

      Hi,

      I would like to scan the peripheral characteristics of the apple watch.
      I have tried to discover services as mentioned in Core bluetooth module document and I was able to get the UUIDs of the services.
      But now I need to get the names of the services and the characteristics, I would appreciate if anyone could guide me in this step.

      Further I would like to extract data from the apple watch( from aforementioned services), is any information available with regards to this as well.

      I eagerly wait for your help.

      Thanks and Regards
      Hameed

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by

        Please provide the code that you have so far.

        1 Reply Last reply Reply Quote 0
        • mcriley821
          mcriley821 last edited by

          I’ve been doing something similar. Here’s a list of GATT characteristics that helped me. https://www.bluetooth.com/specifications/gatt/characteristics/

          1 Reply Last reply Reply Quote 0
          • Hameed
            Hameed last edited by

            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)
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB Forums | Contributors