Ejemplo n.º 1
0
        def finish_pairing(pin):
            Controller.check_pin_format(pin)
            pairing = perform_pair_setup_part2(pin, str(uuid.uuid4()),
                                               write_fun, salt, pub_key)

            pairing['AccessoryMAC'] = accessory_mac
            pairing['Connection'] = 'BLE'

            self.pairings[alias] = BlePairing(pairing, adapter)
Ejemplo n.º 2
0
 def finish_pairing(pin):
     Controller.check_pin_format(pin)
     try:
         pairing = perform_pair_setup_part2(pin, str(uuid.uuid4()),
                                            write_fun, salt, pub_key)
     finally:
         conn.close()
     pairing['AccessoryIP'] = connection_data['ip']
     pairing['AccessoryPort'] = connection_data['port']
     pairing['Connection'] = 'IP'
     self.pairings[alias] = IpPairing(pairing)
Ejemplo n.º 3
0
        def finish_pairing(pin):
            Controller.check_pin_format(pin)

            state_machine = perform_pair_setup_part2(pin, str(uuid.uuid4()), salt, pub_key)
            request, expected = state_machine.send(None)
            while True:
                try:
                    response = write_fun(request, expected)
                    request, expected = state_machine.send(response)
                except StopIteration as result:
                    pairing = result.value
                    break

            pairing['AccessoryMAC'] = accessory_mac
            pairing['Connection'] = 'BLE'

            self.pairings[alias] = BlePairing(pairing, adapter)
Ejemplo n.º 4
0
        def finish_pairing(pin):
            Controller.check_pin_format(pin)
            try:
                state_machine = perform_pair_setup_part2(pin, str(uuid.uuid4()), salt, pub_key)
                request, expected = state_machine.send(None)
                while True:
                    try:
                        response = write_fun(request, expected)
                        request, expected = state_machine.send(response)
                    except StopIteration as result:
                        pairing = result.value
                        break
            finally:
                conn.close()

            pairing['AccessoryIP'] = connection_data['ip']
            pairing['AccessoryPort'] = connection_data['port']
            pairing['Connection'] = 'IP'
            self.pairings[alias] = IpPairing(pairing)