Esempio n. 1
0
    def RemoveDevice(self, deviceAddress):
        objMgr = ObjectManager()
        qpath = objMgr.DoesDeviceExist(0, deviceAddress)
        if qpath == None:
            print("Device at %s not found" % deviceAddress)
        else:
            print("Removing device at path:  %s" % qpath)
            adapter1 = self.bus.get(self.busName, self.path)
            adapter1.RemoveDevice(qpath)

            # Verify its gone:
            qpath = objMgr.DoesDeviceExist(0, deviceAddress)
            if qpath == None:
                print("Device Successfully removed")
            else:
                print("Unable to remove device")
Esempio n. 2
0
    def pairDevice(self, addressString):

        objMgr = ObjectManager()
        devices = objMgr.GetAddresses()

        newPath = objMgr.DoesDeviceExist(0, addressString)

        if newPath != None:
            print "Attempting to pair device at path: %s" % newPath
            device = self.bus.get(self.busName, newPath)
            device.Pair()
        else:
            print "Unable to find device at: %s" % addressString