def addDevice(self, device): if device.coreConfigurations( ) & QtBluetooth.QBluetoothDeviceInfo.LowEnergyCoreConfiguration: self.m_devices.append(QtBluetooth.QBluetoothDeviceInfo(device)) print("Discovered LE Device name: {name} ,Address: {address} ". format(name=device.name(), address=device.address().toString())) print("Low Energy device found. Scanning more...")
def addDevice(self, device): if self.m_device is None and device.coreConfigurations() & QtBluetooth.QBluetoothDeviceInfo.LowEnergyCoreConfiguration: # print("Discovered LE Device name: {name} ,Address: {address} ".format(name=device.name(),address=device.address().toString())) m_device = QtBluetooth.QBluetoothDeviceInfo(device) if self.deviceHasService(m_device,self.SERVICE_UUID): self.m_device = m_device # we found our device and stop scanning self.m_deviceDiscoveryAgent.stop()
def setDevice(self, dev): self.device = QtBt.QBluetoothDeviceInfo(dev) self.deviceChanged.emit()